I recently started learning micropython and I apologize in advance for the question I want to ask, as I understand that most likely the answer to it has already been given, but I could not find it
Tell me, what is the maximum value that ticks_ms can return, what happens when it overflows, and what does the term "rollover" mean?
I make a mqtt listener and to maintain a connection with the server I use the ping method so that the server does not disconnect me:
Code: Select all
def _mqtt_keepalive_ping(self):
time_since_last_ping = time.ticks_diff(time.ticks_ms(), self._mqtt_last_ping) // 1000
if time_since_last_ping >= self._mqtt_client.keepalive:
try:
self._mqtt_client.ping()
except OSError:
self._mqtt_connected = False
else:
self._mqtt_last_ping = time.ticks_ms()