diff --git a/include/sysinfo.php b/include/sysinfo.php index c09724a..8006cc0 100644 --- a/include/sysinfo.php +++ b/include/sysinfo.php @@ -94,7 +94,8 @@ $output = shell_exec('cat /proc/uptime'); $uptime = format_time(substr($output,0,strpos($output," "))); $idletime = format_time((substr($output,strpos($output," ")))/$cpucores); - + $pinStatus = trim(shell_exec("gpio -g read ".POWERONLINEPIN)); // Pin 18 + //returns 0 = low; 1 = high ?>
@@ -104,6 +105,13 @@ + + + @@ -124,6 +132,13 @@ + + + diff --git a/setup.php b/setup.php index 91f81dc..66e7a8b 100644 --- a/setup.php +++ b/setup.php @@ -149,6 +149,18 @@ include "include/tools.php"; Halt system command:" name="HALTSYS" class="form-control" placeholder="sudo halt" aria-describedby="HALTSYS"> +
+ Show Powerstate (online or battery, wiringpi needed) +
>
+
+
+ GPIO pin to monitor: + " name="POWERONLINEPIN" class="form-control" placeholder="18" aria-describedby="POWERONLINEPIN"> +
+
+ State that signalizes online-state: + " name="POWERONLINESTATE" class="form-control" placeholder="1" aria-describedby="POWERONLINESTATE"> +
Power Idle