Ubidots Community

[SOLVED] Esp32 over mqtt

please, I need an explanation(in more details) for every code line in connecting esp32 to ubidots over mqtt

Greetings, this article may serve you as reference.

All the best

1 Like

Thanks a lot for helping me
I need another help
I was wanting to send two variables (random data) to ubidots and I did ,
But there is a problem there is no data on ubidots appeared only on serial monitor?
this is the code
sketch_jul30a.ino (3.4 KB)

and this is the serial monitor screenshot

Please refer to this example to know how to send properly data through MQTT.

All the best

It doesn’t work with esp 32 ,so what now?

I have not noticed that you were using an esp32, the examples provided are intended for ESP8266, for ESP32 we have a reference example using microPython here.

You can find several resources that may serve you as reference at our help center too.

All the best.

I used this
http://help.ubidots.com/connect-your-devices/connect-an-esp32-devkitc-to-ubidots-over-mqtt
as a reference it works only with one variable
if I added two or three variables it doesn’t work
why??

Greetings, you will have to modify the payload built in the code to fit the structure below:

topic:
/v1.6/devices/LABEL_DEVICE

payload:
{"var-1": {"value": value-1}, "var-2": {"value": value-2}}

All the best