Bosch Building Technologies

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Who rated this article

    What is MQTT and how does it work (Bosch ONVIF Profile M)?

    Rate this article:
    100% helpful (1/1)

    Question

     

    What is MQTT and how does it work (Bosch ONVIF Profile M)?

     

    Answer

     

    “MQTT is a Client Server publish/subscribe messaging transport protocol. It is light weight, open, simple, and designed so as to be easy to implement. These characteristics make it ideal for use in many situations, including constrained environments such as for communication in Machine to Machine (M2M) and Internet of Things (IoT) contexts where a small code footprint is required and/or network bandwidth is at a premium.” (Citation from Official MQTT 3.1.1 specification)

    Central_Support_0-1638430981274.png

     

    MQTT Key Features

     

    • Asynchronous communication model with messages
    • Publisher and Subscriber model
    • Low overhead
    • Decoupled architecture design – Publisher and Subscriber does not need to know each other
    • Scalability – no restriction to the number of publishers or subscribers
    • Message filtering – by subject-based filtering, content-based filtering & Type-based filtering

     

    Central_Support_1-1638431012829.png

     

    The Client and the Broker

     

    • In MQTT terminology, the Client can either be the Publisher or the Subscriber
    • Clients need to subscribe to messages to publish data or to receive the data
    • Broker receive the messages and based on clients’ subscription forward these to the interested clients
    • Messages are call Topics.  Each Topic has it defined pattern, the client need to knows the pattern in order to subscript to it and the structure to extract the data.

    E.g:

    This is a Topic: “BoschCamera1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter 4”

    Data contains in this topic are: UtcTime, Source, Data

     

    Subscribing to Topics

     

    • A Client can subscribe to single or multiple topics.
    • One of the main advantage of MQTT is its’ ability to allow usage of “wildcards” when subscribing to Topics.
    • Two types of wildcards :
      • # (hash character) – multiple level wildcard
      • + (plus character) – single level wildcard
    • Subscription to a single topics

    ‒BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter_1

     

    • Subscription using # wildcard

    ‒BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/#

    ‒This means all topics that starts with

    “BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/” will be subscribed, e.g:

    BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter_1

    BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter_2

    BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter_3

     

    • Subscription using + wildcard

    “BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/+/Counter_1”

    ‒This means all topics that starts with:

    “BoschCamer1/onvif-ej/RuleEngine/CountAggregation/Counter/”

    and ends with “/Counter_1” will be subscribed.  It is not too useful in our usage, cause the Topics created in the camera does not utilize this wildcard much.

    ‒Here is an example, not use in ONVIF Profile M MQTT but to allows you to understand how to use the plus wildcard.

    ‒For example, you have in an home automation, the following topics

      house/room1/main-light

      house/room2/main-light

      house/room3/main-light

    ‒By subscribing to “house/+/main-light”  you will be subscribed to all the 3 topics.

     

    NOTE: 

    1. Each client (Pub/Sub) need an unique ClientID.  During configuration of the Camera setting, do make sure that the correct unique “Prefix identifier” is been enter as a ClientID.
    2. MQTT includes support for MQTTS
    3. The followings are links to website and video that gives you a better understanding of what MQTT does.

     

    • MQTT Broker
      • Mosquitto, VerneMQ, EMQ, etc

     

    Supported hardware & Software

    Supported Cameras :

    -CPP 6, 7 and 7.3 

    - Firmware 7.81.0060 and above.

    -CPP 13 & 14 

    - Firmware 8.71.0066 and above.

     

    Supported software:

    -MQTT broker 3.1 & 3.11 (5.0 still unknown if we can support)

    -Configuration Manager 7.50 and above is required to configure MQTT in the cameras

    -Support MQTT configuration in Configuration Manager when camera is added as ONVIF camera or Bosch native camera.

     

     

    MQTT Topics

    MQTT Topics defines what are the data you can receive from the camera.  For Bosch cameras, there are 5 main Topics :

    1.RuleEngine Topic

    2.IVA Topic

    3.VideoSource Topic

    4.Device Topic

    5.RecordingConfig Topic

    Note: recall what is a topic looks like : 

    BoschCamera1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter 4

     

    1. RuleEngine Topics:

    RuleEngine Topics has 3 sub-topics:

    1.CounterAggregation: Provides the IVA counter/occupancy value

    2.FieldDetector: Provides the event status of Loitering, Object in Field, Idle object & remove object.

    3.LineDetector: Is triggered when object crosses an IVA line, Enter a field or Existed a field

    Note : currently ONVIF Profile M do not have any defined VCA rule for Follow Route and Crowd Detection.  These 2 rules event is currently temporary place under SignalLoss Topics.

    Note: recall what is a topic looks like :

    BoschCamera1/onvif-ej/RuleEngine/CountAggregation/Counter/&1/Counter 4

     

    2. IVA Topics:

     

    IVA Topics are customized Topics only Bosch camera has and it has 9 sub-topics:

    1.ObjectInField

    2.Loitering

    3.CrowdDetection

    4.EnteringField

    5.LeavingField

    6.IdleObject

    7.RemovedObject

    8.FollowingRoute

    9.Counter

    These are events status, only when the event is been triggered will the camera publish these status.  Do note for Counter and CrowdDetection, it will only triggers if you have configured the IVA rule to trigger an alarm when counter or crowd reaches a threshold.

     

    3. VideoSource Topics

    VideoSource Topics are related to “tamper” alarms and it has 5 sub-topics:

    1.MotionAlarm

    2.SignalLoss

    3.GlobalSceneChange

    4.ImageTooBright

    5.ImageTooDark

     

    The events are self explanatory.

    MotionAlarm will trigger whenever there is any IVA or motionplus alarm, it does not tell you what causes the alarm.

     

    4. Device Topics:

    Device Topics has 2 sub-topics:

    1.Relay

    2.DigitalInput

    These are status events for the cameras inputs and outputs.

     

    5. RecordingConfig Topics:

    RecordingConfig Topics has 1 sub-topic, it publish a message when the camera start recording. 

     

    Central_Support_2-1638431054827.png 
    Additional information:
    Version history
    Last update:
    ‎03-03-2023 10:42 AM
    Updated by:
    Contributors
    Who rated this article
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist