Could someone suggest me the easiest way to send data from my android phone to my local Orion Broker Instance via MQTT? I have installed locally Orion Broker and IoT Agent for the Ultralight 2.0 protocol.
Asked
Active
Viewed 180 times
1
-
Have you already seen this: http://stackoverflow.com/questions/29930412/orion-context-broker-context-subscriptions-with-android-client ? Maybe it can help you. – Dalton Cézane Mar 20 '17 at 20:30
-
Not sure if MQTT is supported in the case of Bastly... – fgalan Mar 24 '17 at 15:07
1 Answers
1
Assuming that IoTAgent is correctly configured to interact with Orion and with MQTT broker, the steps would be as follow:
- Provision your phone device at IoTAgent, using the IoTAgent provisioning API
- Start sending data using MQTT transport, from your device to the MQTT broker. IoTAgent will get that data and publish at Orion Context Broker.
- Get your data from Orion Context Broker, either using synchronous queries or subscriptions/notifications.
The step by step guide at IOTAgent documentation explains bullets 1 and 2 with more detail. However, note this document is based in JSON payloads, so you have to adapt them to UltraLight 2.0. For example, the UltraLigth 2.0 equivalent for
mosquitto_pub -t /1234/sensor01/attrs -m '{"l":4,"t": "31.5"}'
would be
mosquitto_pub -t /1234/sensor01/attrs -m 'l|4|t|31.5'
-
You shouldn't create such entity, the IoTAgent will create as a consequence of the provisiniong step (step 1). Having a entity created by you which matches the one that IoTAgent created will cause conflict and unexpected behaviour. – fgalan Mar 24 '17 at 11:56