Offline control mechanism for OpenAPS
Android "HTTP widget" allows you to show text inside the widget, perfect for OpenAPS monitoring without using Nightscout (in case no internet access is available).
-
install "HTTP widget" on your Android mobil https://play.google.com/store/apps/details?id=net.rosoftlab.httpwidget1&hl=en
-
install jq
sudo apt-get install jq
- add the following cron line to your crontab (where
myopenpasis your openaps init directory)
@reboot cd /root/myopenaps/enact && python -m SimpleHTTPServer 1337
- add the following openaps alias to your
openaps.ini
http-widget = ! bash -c "(cat ~/myopenaps/enact/enacted.json | jq .timestamp && cat ~/myopenaps/enact/enacted.json | jq .reason && cat ~/myopenaps/enact/enacted.json | grep rate && cat ~/myopenaps/monitor/edison-battery.json) > ~/myopenaps/enact/index.html"
- modify the
openaps pump-loopcron line to (openaps http-widgetneeds to be run each minute)
* * * * * cd /root/myopenaps && ( ps aux | grep -v grep | grep -q 'openaps pump-loop' || openaps pump-loop ) 2>&1 | tee -a /var/log/openaps/pump-loop.log && openaps http-widget > /dev/null 2>&1
`
- On your Android phone add a HTTP widget as you know how to add widgets normally and set the the http with your rig IP address using port 1337
`