I am finally able to send a simple message over MQTT using Mosquitto broker and Paho based client. At this point I have a doubt. I am sending to the client a simple string, but I want obviously send the result of another operation (such as a Data ACquisition). What should I do in this case? I read that payload of function below must be a string:
and I read also that I sould send JSON. I tried to do this transformation:
but at this point I think that it’s not the correct way. What do you advise me to do in these cases?
Any help will be appreciated.