Purpose
Automates IP link availablity - reboots the PiloT if the IP link fails. By testing wwan0 network connection provided by the PiloT board using ICMP ping
Restarts the wwan0 network connection on ping failure
The current version is experimental - seems to work but is very basic - maybe view this
as a starting point to develop a better solution
Quick start
pip install python-crontab
This assumes the PiloT project was installed in the pi@raspberrypi: home folder - the code currently has hardcoded paths
Add the cron custom job
python cronJobAdd.py
After this [checkIp.py] should execute every minute
Notes
- consumes data due to ICMP transactions
- targets only wwan0
- runs even when another interface has priority
- hardcode paths
- sends ping via wwan0 every minute
- hardcoded ping server address
- hardcoded tested interface
- hardcoded ping rate
Source
https://stackabuse.com/scheduling-jobs-with-python-crontab/
Further stuff
list all the jobs from the command line
crontab -l
Remove all cron jobs
python cronJobRemove.py