MQTT client msg_id is always 0?

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

MQTT client msg_id is always 0?

Postby RichPiano » Tue Feb 22, 2022 1:58 pm

What is the use of event->msg_id in the exposed mqtt event loop? I have tested multiple messages in a row and it always seems to be 0.. Is this the expected behaviour? I was thinking it might be some kind of counter that increases with every message sent?

filo_gr
Posts: 110
Joined: Wed Jul 28, 2021 12:25 pm
Location: Italy

Re: MQTT client msg_id is always 0?

Postby filo_gr » Wed Feb 23, 2022 7:23 am

As you can read here https://docs.espressif.com/projects/esp ... /mqtt.html, if you set a QoS = 0, the message ID will be always 0. Can you confirm you are using a Qos = 0?
message_id of the publish message (for QoS 0 message_id will always be zero) on success. -1 on failure.
Filippo

RichPiano
Posts: 123
Joined: Mon May 18, 2020 2:51 pm

Re: MQTT client msg_id is always 0?

Postby RichPiano » Wed Feb 23, 2022 7:27 am

No I'm actually using qos 1. However, in any case the msg_id is not what I expected then.

Who is online

Users browsing this forum: Baidu [Spider], Google Adsense [Bot], MicroController and 78 guests