overthesun / simoc-sam

Live backend for SAM at Biosphere 2
2 stars 1 forks source link

Add a script to check for and re-establish network connectivity. #117

Open ezio-melotti opened 1 month ago

ezio-melotti commented 1 month ago

This script checks for network connectivity by pinging Google every few minutes. If the ping is not successful, the script will try to:

  1. restart the network interface, and check again
  2. if it's still not working, it will just reboot the pi

It can be installed by copying network-monitor.service to /etc/systemd/system/ and launched with sudo systemctl start network-monitor.

This script was created to prevent the RPi4 from going offline, which is something that we observed a few times, but we still haven't figured out why it happens and how to fix it properly. The PR doesn't need to be merged if we figure out and fix the root cause.

This script was developed by @fcarbogn.