You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running umqttsimple.py with Micropython 1.17 on an ESP32 client. Everything was running perfectly and then, by accident, I used the same MQTT client ID on another device. MQTT responded by disconnecting the original device - it is designed to disconnect the "older" client. I did have a dummy callback in place but was not expecting any topic messages as I had not subscribed to any.
I assume that when MQTT disconnected it created a socket error. The code at line 175 says: "if res == b"": raise OSERROR(-1)". This is the error I got and the main program stopped right there. This may be a socket handling error elsewhere but, in order to make the code more robust I changed the logic to "if res is None or res == b"": return None"
This patch works. Even if the code is not going to be patched, I hope that, by raising the issue, others will see what is happening when it happens to them.
Maybe the real problem is with the socket code which should return "none" when disconnected?
The text was updated successfully, but these errors were encountered:
I am running umqttsimple.py with Micropython 1.17 on an ESP32 client. Everything was running perfectly and then, by accident, I used the same MQTT client ID on another device. MQTT responded by disconnecting the original device - it is designed to disconnect the "older" client. I did have a dummy callback in place but was not expecting any topic messages as I had not subscribed to any.
I assume that when MQTT disconnected it created a socket error. The code at line 175 says:
"if res == b"": raise OSERROR(-1)"
. This is the error I got and the main program stopped right there. This may be a socket handling error elsewhere but, in order to make the code more robust I changed the logic to"if res is None or res == b"": return None"
This patch works. Even if the code is not going to be patched, I hope that, by raising the issue, others will see what is happening when it happens to them.
Maybe the real problem is with the socket code which should return "none" when disconnected?
The text was updated successfully, but these errors were encountered: