Scketchs com QoS MQTT.

FlavioRedes
Posts: 2
Joined: Tue Apr 28, 2026 1:18 am

Scketchs com QoS MQTT.

Postby FlavioRedes » Tue Apr 28, 2026 1:42 am

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.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Scketchs com QoS MQTT.

Postby nopnop2002 » Tue Apr 28, 2026 11:24 am

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

FlavioRedes
Posts: 2
Joined: Tue Apr 28, 2026 1:18 am

Re: Scketchs com QoS MQTT.

Postby FlavioRedes » Tue Apr 28, 2026 5:21 pm

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.

Who is online

Users browsing this forum: Google [Bot], PerplexityBot, PetalBot and 11 guests