Vladimir Kotal
Vladimir Kotal
Tested on QtPy running `Adafruit CircuitPython 8.2.6 on 2023-09-12; Adafruit QT Py ESP32-S3 no psram with ESP32S3` with the code from the issue adapted for CP: ```python #!/usr/bin/env python3 import...
Checking the code after this change for the remaining `keep_alive` occurrences, they are only in places related to the CONNECT message marshalling and inside the `loop()` in order to ping...
The change in `ping()` probably deserves some comment. The MQTT 3.1.1 spec in section 2.2 says: > If a client does not receive a [PINGRESP](https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#pingresp) message within a Keep Alive...
> @vladak this now has merge conflicts. rebased
> 2. in any case, why aren't ping timeout exceptions handled and rather than return an exception > thatis, return an error code that can be handled as to whether...
> My belief was that the ping timeout was colliding with the "normal" timeout. There is also a timeout between the first element received and the second element received. I...
> I did not instrument/diagnose the path that generated the timeout but when I disabled ping the unwanted timeouts went away. > > My assumption is that time passed so...
> I have it working/hacked good enough to get by until the next circuitypython official release. > > I found for the rp204, that minimum timeouts less than 2 seconds...
> FYI, in get_monotonic_time(), monotonic_ns()/1000000000 doesn't seem to maintain precision (at least for the RP2040 which I tested on) any better than straight up monotonic, so short timeout values (10-100ms)...
I assume that line 788 that leads to the exception is one of the `self._sock.send()` calls inside `publish()`. The error can be handled like this: ```python try: mqtt_client.publish(...) except OSError...