X-Git-Url: http://git.rot13.org/?p=air-quality;a=blobdiff_plain;f=mh-z19b.pl;h=927951b53c709917b65e4afb88915274a7a90eea;hp=90764149c4b8e0d0731cdf7c771fa867ac407480;hb=59b28a41e509a3d933d3dac493ad78e60561e1d9;hpb=9c27794df65d335b028e0feb2d7783f7ec8a6014 diff --git a/mh-z19b.pl b/mh-z19b.pl index 9076414..927951b 100755 --- a/mh-z19b.pl +++ b/mh-z19b.pl @@ -43,7 +43,7 @@ while (1) { my $co2 = $v[2] * 255 + $v[3]; if ( $v[0] == 0xff && $sum == $checksum ) { my $influx = "mh-z19b,dc=trnjanska co2=$co2 $t"; - print "$influx\n"; + print "$influx\n" if -e '/dev/shm/air-debug'; system "curl --max-time 2 --silent -XPOST '$influx_url' --data-binary '$influx'"; system "mosquitto_pub -h rpi2 -t 'air/mh-z19b/co2' -m $co2"; } else {