micropython / micropython/micropython-lib
umqtt.simple publish with qos 1 pid rollover
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.1k
- Avg merge
- 7d 6h
- Merged PRs (30d)
- 3
Description
In continuously running data logging applications the pid value can overflow the 16 bit field. In this instance struct.pack_into constrains the result to 16 bits but produces an illegal value of 0 (MQTT spec section 2.3.1).
I don't know if this is also a valid concern but cPython's struct.pack_into throws an exception on overflow: if the MicroPython implementation ever became conformant the code would fail.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the umqtt.simple publish path and its struct.pack_into call, then compare the packet identifier handling with MQTT specification section 2.3.1. Check the rollover behavior and the stated difference from CPython's overflow handling. Done means continuous QoS 1 publishing does not emit packet identifier 0 or fail unexpectedly at the 16-bit boundary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100