I'm using the mqtt_as library with an esp8266. when uC starts up and the router is off, the program ends giving an error. I have added the following in the code for restarting, is OK?
Code: Select all
try:
loop.run_until_complete(main(client))
finally:
client.close() # Prevent LmacRxBlk:1 errors
print('++++++++Error connecting first time. Reseting...+++++++++++')
time.sleep(10)
machine.reset()