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

update to 2.0.12 breaks simple micropython mqtt 3.1.1 clients #2361

Closed
brianwyld opened this issue Nov 1, 2021 · 6 comments
Closed

update to 2.0.12 breaks simple micropython mqtt 3.1.1 clients #2361

brianwyld opened this issue Nov 1, 2021 · 6 comments

Comments

@brianwyld
Copy link

My embedded devices using the umqtt micropython MQTT v3.1.1 client (from PyCom and in the micropython respositry) stopped being able to connect to my 2.0.12 mosquitto server : they get a CONNACK with a response code of 2 (ie bad)
After digging thru the mosquitto code, it seems to me that this is due to the update
"Apply max_keepalive to MQTT v3.1.1 and v3.1 clients." commit on the 21 Aug 2021, which checks the max keepalive config for 3.1.1 clients (where before this only applied to v5 clients).
The umqtt.py code (which is pretty simplistic) always passes 'keepalive' as 0 in the CONNECT attempt, and in the mosquitto default config this now breaks.
Is this correct protocol behaviour (and if so, is there a server side config to avoid it...)?
thanks

@brianwyld
Copy link
Author

update: I don't see why the check includes the keepalive=0 case as an error?

@brianwyld
Copy link
Author

update : I tried setting
max_keepalive 0
as per the comments in the mosquitto.conf, but the latest docker image for 2.0 doesn't accept this as a legitimate value.

@ckrey
Copy link

ckrey commented Nov 1, 2021

duplicate of #2309 (we are waiting for a new version)

@brianwyld
Copy link
Author

ok thanks, didn't manage to relate my 'identifier rejected' issue to the keepalive issue until after logging the initial issue.

@gdt
Copy link

gdt commented Jan 27, 2022

If it's a dup would be good to close this. And, to read the spec to see if keepalive 0 is legit or not. If not, seems best to fix the client.

@brianwyld
Copy link
Author

The client asking for keepalive=0 is legit, the issue is that the server doesn't let you configure max_keepalive=0 for 3.1.1 client so that it can deal with it.
As its a duplicate of #2309 (which is duplicate of #2117, which has a fix in the 'fixed" branch to allow setting max_keepalive to 0). I'm closing this issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants