Code: Select all
pi@raspberrypi ~ $ sudo cat /sys/class/gpio/gpio17/value
0
i obtain the status of GPIO 17
Code: Select all
} elseif ($argv[1] == 'stato_pompa') { //stato on/off pompa riscaldamento
$outstr = exec('cat /sys/class/gpio/gpio17/value');
$outstr = "pompa($outstr*X)";
Code: Select all
pi@raspberrypi ~ $ reqsdm stato_pompa
pompa(0*X)
now on meterN i create a log metern like that:
name= pompa
meterID= pompa
type = sensor
command = reqsdm stato_pompa
and in dashboard live pooling
meterID = pompa
mode= state
live command= reqsdm stato_pompa
but if i run the command test i receve (in both cases: command and command live)
is not valid, the correct format is pompa(1234.5*)
how i can monitorize the status of ON/OFF of GPIO ?
thanks so mutch