Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packet_id_counter incrementing even if packet is dropped #208

Open
eguarda opened this issue Feb 2, 2022 · 0 comments
Open

packet_id_counter incrementing even if packet is dropped #208

eguarda opened this issue Feb 2, 2022 · 0 comments

Comments

@eguarda
Copy link

eguarda commented Feb 2, 2022

Hello! I found that during the publish routine (bool Adafruit_MQTT::publish(...)), using QoS = 1, the packet_id_counter variable gets incremented even if the length check fails. Therefore, if a package is dropped, the counter adds one, but the broker counter doesn't, so it perpetually fails the packnum != packet_id_counter check because of an offset in these two counters.

This would make it so the microcontroller would incorrectly assume that it's failing every publish, making it so you couldn't send multiple messages during one MQTT connection using QoS > 0 if even a single publish message is dropped.

I'm using an ESP32 connected to a SIM800 module, and sending messages to a public HiveMQ topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant