Esp32 over mqtt


#1

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


#2

Greetings, this article may serve you as reference.

All the best


#3

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


#4

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

All the best


#5

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


#6

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.


#7

I used this


as a reference it works only with one variable
if I added two or three variables it doesn’t work
why??


#8

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