Page 1 of 1

Scketchs com QoS MQTT.

Posted: Tue Apr 28, 2026 1:42 am
by FlavioRedes
Friends,
I'm starting out with ESP32, I don't have much knowledge yet.
I need 3 sketches to measure temperature with DHT11, but each sketch must have a different MQTT QoS configuration. One sketch with QoS 0, another with QoS 1, and the third with QoS 3.
The data will be sent to a cloud platform, and the ESP32 will be connected to the wireless network.

I discovered that the PubSubClient library (by knolleary) doesn't work with QoS 1 and 2. I need sketches that work with other libraries.
Regards,
Flávio.

Re: Scketchs com QoS MQTT.

Posted: Tue Apr 28, 2026 11:24 am
by nopnop2002
ESP-MQTT supports three QoS levels.

https://docs.espressif.com/projects/esp ... /mqtt.html#

You can use esp_mqtt_client_publish() or esp_mqtt_client_enqueue().

Example code is here.
https://github.com/espressif/esp-mqtt/t ... r/examples

Re: Scketchs com QoS MQTT.

Posted: Tue Apr 28, 2026 5:21 pm
by FlavioRedes
Thank you.
I am going to try.
I found a file, made the changes according to my environment (passwords, User, etc), but it's giving the error:assert failed: udp_new_ip_type /IDF/components/lwip/lwip/src/core/udp.c:1278 (Required to lock TCPIP core functionality!) .

I'll try using the files you suggested.