MQTT Publish to TAGO.io

5 visualizaciones (últimos 30 días)
Rodrigo Botelho
Rodrigo Botelho el 1 de Abr. de 2021
Respondida: Rodrigo Botelho el 6 de Abr. de 2021
Hi,
I'm trying to publish to Tago using RaspberryPi MQTT Publish block, but I haven't had any success, yet. I'm getting status -1 from the block.
I set the mqtt details in Target hardware resources as:
mqtt.tago.io
Username: Any value
Password: my device token
Client ID: Any value
MQTT Publish Block:
topic: tago/data/post
TAGO expects a json string vector. I tried to convert a string vector to ASCII, but it didn't work. Any idea on how to solve it?
Thanks

Respuestas (1)

Rodrigo Botelho
Rodrigo Botelho el 6 de Abr. de 2021
I have figured out one way of solving it.
Since the MQTT Publish block does not support Strings, it's possible to send raw data to Tago.io platform and use the Payload Parser to format the data being received.
In Simulink, one should add the String to ASCII block before the Publish.
On Tago.io parser, one should write a small script in JS getting the data from a raw payload and comnverting to desired data type. Then it will be trivial to find the new variable for plotting.

Categorías

Más información sobre Block Libraries en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by