reset Funhouse if no internet connection

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
tundra242
 
Posts: 7
Joined: Wed Dec 02, 2020 3:54 pm

reset Funhouse if no internet connection

Post by tundra242 »

I have 3 funhouses writing environmental data to Adafruit IO. If they loose the network connection they will error out. To get around that I used smart sockets and triggered a power cycle every hour in case they loose connection, it will reset at least hourly. I was using tuya and ifttt, but apparently they are having a spat, so I cant add devices to that flow.

The better thing would to just have the funhouse reset if there was no connection found or wait for a period of time and try connecting again. Is there a clean way in circuitpython to do that?

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: reset Funhouse if no internet connection

Post by danhalbert »

If they are throwing an exception, you can catch the exception inside a try-catch block, and then decide what to do. You could even reset the board if you wanted to.

User avatar
tundra242
 
Posts: 7
Joined: Wed Dec 02, 2020 3:54 pm

Re: reset Funhouse if no internet connection

Post by tundra242 »

thanks, I was getting a lot of errors until I read everything has to be indented after the try:. Working so far.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”