4e5ac9d4e7fb08d4f8deacacd4cd3dc743adf866
tools/sense-power.sh
| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | -#!/bin/sh |
|
| 2 | - |
|
| 3 | -while true; do |
|
| 4 | - SENSORS=(`python ~/ina226.py`) |
|
| 5 | - |
|
| 6 | - CURRENT=${SENSORS[0]} |
|
| 7 | - VOLTAGE=${SENSORS[1]} |
|
| 8 | - POWER=${SENSORS[2]} |
|
| 9 | - BATTERY=${SENSORS[3]} |
|
| 10 | - |
|
| 11 | - WEATHERS=(`python ~/weather.py`) |
|
| 12 | - TEMPERATURE=${WEATHERS[0]} |
|
| 13 | - FORECAST=${WEATHERS[1]} |
|
| 14 | - LATITUDE=${WEATHERS[2]} |
|
| 15 | - LONGITUDE=${WEATHERS[3]} |
|
| 16 | - |
|
| 17 | - #VOLTAGE=`seq 13 0.1 14 | shuf | head -n1`; |
|
| 18 | - #BATTERY=`seq 70 1 90 | shuf | head -n1`; |
|
| 19 | - #POWER=`seq 1 .1 1.5 | shuf | head -n1`; |
|
| 20 | - |
|
| 21 | - echo -e "{\"voltage\": $VOLTAGE, \"battery\": $BATTERY, \"powerConsumption\": $POWER, \"current\": $CURRENT, \"forecast\": \"$FORECAST\", \"temperature\": $TEMPERATURE, \"date\": \"$(date)\", \"uptime\": \"$(uptime -p)\", \"latitude\": $LATITUDE, \"longitude\": $LONGITUDE }" > /tmp/index.html; sleep 1; done |
tools/server-status.sh
| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | #while true; do echo -e "Battery: 13.2v 86% \n Power Consumption: 1.2W \n Date: $(date) \n Uptime: $(uptime)\n\n"> /tmp/index.html; sleep 1; done |
| 2 | 2 | |
| 3 | 3 | while true; do |
| 4 | - SENSORS=(`python ~/ina226.py`) |
|
| 4 | + SENSORS=(`python2 ~/ina226.py`) |
|
| 5 | 5 | |
| 6 | 6 | CURRENT=${SENSORS[0]} |
| 7 | 7 | VOLTAGE=${SENSORS[1]} |
| 8 | 8 | POWER=${SENSORS[2]} |
| 9 | 9 | BATTERY=${SENSORS[3]} |
| 10 | 10 | |
| 11 | - WEATHERS=(`python ~/weather.py`) |
|
| 11 | + WEATHERS=(`python2 ~/weather.py`) |
|
| 12 | 12 | TEMPERATURE=${WEATHERS[0]} |
| 13 | 13 | FORECAST=${WEATHERS[1]} |
| 14 | 14 | LATITUDE=${WEATHERS[2]} |