Here is a M5Stack UIFlow to monitor your Helium miner and automatically reboot it if it goes off line.
This script is designed to control a M5Stack ATOM Socket Kit (HLW8023) (you will also need to purchase a "computer power cord"). The script will monitor a Helium miner using the Helium API and will turn the gateway off and back on automaticlly (rebooting it) if it shows as being "offline" on the API call.
You can toggle the power to the miner by pushing the button on the M5Atom. Green means the power is on, red means the power is off. Once an hour, the Atom will check the API to see if the miner is online. If it's not, it will cycle the poewer. It will also cycle power once ever 24 hours for a daily reboot.
Here are the steps needed to program the Atom:
The M5Stack Atom Lite has 4 modes - Online Programming (Green), Offline Programming (Blue), WiFi Setup (Yellow) and App (Purple). You can set the default mode with the M5Burner or by holding down the center button on the Atom as you apply power - release the button while it's displaying the color of the mode you would like.
To get the unit to automaitcally start the application on power up, select the "App" (purple) mode and it should automatically kick off the the program named "main" (this is why I renamed the modules).