Hi @DanR,
Overall, your setup seems close to correct, however, I’m hesitating on 3 particular fields, the JSON format
, Host
and Topic
:
-
JSON format
: As you might already know, Ubidots MQTT broker receives a standardized JSON format as explained here. The format you’re sending, namely, {"value": %a}
doesn’t seem compatible because, according to the image, the %a
is a JSON itself, which I’m pretty sure that at runtime, it deviates from what Ubidots expects.
-
Host
: You typed in mqtt://industrial.api.ubidots.com
but I’m thinking, based on the Docs, that it should be without the leading mqtt://
prefix
-
Topic
: You have an extra trailing /
in the topic. It should be /v1.6/devices/rut955
With the above in mind, I propose the following 2 paths (they’re not exclusive to one another, rather steps):
-
Adjusting the fields for Host
and Topic
based on the above, that is, lose the mqtt://
prefix and the trailing /
. Once you make the change and if my suspicious is right, you should see a device and variable labelled as “rut955” and “value”, respectively, in your account. The variable won’t have data as the %a
probably makes the whole JSON incompatible, but at least we can confirm the modem router connected properly and a payload was sent and partially parsed.
-
We need to understand what the JSON payload –rendered out of {"value": %a}
, looks like, and the way to do so involves using a different data ingestion path: MQTT+UbiFunctions. It is still MQTT, but instead of going directly to Ubidots, it first lands at an UbiFunction which will allow you to inspect the payload, understand it and give us clue how to parse it. Please follow the Docs in the link to setup your modem router to send data to an UbiFunction.
The Python snippet below prints everything getting to the UbiFunction to the console and will let us see the payload.
def main(args):
print(args)
return args
We will be here in case you stumble upon a wall along the way of making theses changes.