This update package ships a sample MQTT simulation for a Bosch sensor, as detailed in this Blog post. <.
To run this simulation, you must have installed the following optional modules as documented in the online documentation:
To run the simulation, invoke the File->Open menu from the MIMICView GUI, and select the mqtt-bosch1.cfg file.
This simulation will generate a payload every 5 seconds as detailed in this video and as shown in this mosquitto subscriber output:
% ./mosquitto_sub -h 192.9.200.14 -t BCDS/#a -v BCDS/XDK/single/20:19:AB:F4:00:01/out/stream {"sn":"xx:xx:xx:xx:xx:xx","data":{ "acc":{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-2319,"unit":"mdeg/s"}, "mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":{"value":227520,"unit":"mLux"}, "temp":{"value":30880,"unit":"mCelsius"},"pressure":{"value":98897,"unit":"Pascal"}, "humidity":{"value":39,"unit":"%rh"}}} BCDS/XDK/single/20:19:AB:F4:00:01/out/stream {"sn":"xx:xx:xx:xx:xx:xx","data":{ "acc":{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-2319,"unit":"mdeg/s"}, "mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":{"value":227520,"unit":"mLux"}, "temp":{"value":30880,"unit":"mCelsius"},"pressure":{"value":98897,"unit":"Pascal"}, "humidity":{"value":39,"unit":"%rh"}}}
Notice that sn contains the constant xx:xx:xx:xx:xx:xx. Let's change the simulation to put in a proper serial number:
"sn": "xx:xx:xx:xx:xx:xx",to
"sn": { "MIMIC_action" : "store_get(SN)", "MIMIC_json_type" : "string" },
Once you do, and start the agent, the payload is now something like
% ./mosquitto_sub -h 192.9.200.14 -t BCDS/# -v BCDS/XDK/single/20:19:AB:F4:00:01/out/stream {"sn":"20:19:AB:F4:00:01","data":{ "acc":{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-2319,"unit":"mdeg/s"}, "mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":{"value":227520,"unit":"mLux"}, "temp":{"value":30880,"unit":"mCelsius"},"pressure":{"value":98897,"unit":"Pascal"}, "humidity":{"value":39,"unit":"%rh"}}} BCDS/XDK/single/20:19:AB:F4:00:01/out/stream {"sn":"20:19:AB:F4:00:01","data":{ "acc":{"x":26,"y":32,"z":1012,"unit":"mG"},"gyro":{"x":1220,"y":-6835,"z":-2319,"unit":"mdeg/s"}, "mag":{"x":40,"y":1,"z":-4,"unit":"uT"},"light":{"value":227520,"unit":"mLux"}, "temp":{"value":30880,"unit":"mCelsius"},"pressure":{"value":98897,"unit":"Pascal"}, "humidity":{"value":39,"unit":"%rh"}}}
Notice that sn now is not the constant xx:xx:xx:xx:xx:xx any more because the value of is retrieved from the Agent Store. You can make this variable unique for every agent that is running.
This process is seen in this Youtube video.
The mqtt-bosch3.cfg file is already setup to make the serial number unique for every sensor, and temp changeable in real-time via the Agent Store.