X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=zph02.pl;h=00d8c2d5a95830f0036125a298e74486b9099c91;hb=921f4897fcc86708684b85328496a74b2dc6349f;hp=0a01d36a245941277181107fb89fb5a323b767d6;hpb=9c27794df65d335b028e0feb2d7783f7ec8a6014;p=air-quality diff --git a/zph02.pl b/zph02.pl index 0a01d36..00d8c2d 100755 --- a/zph02.pl +++ b/zph02.pl @@ -45,7 +45,7 @@ while (1) { my $pcnt = $v[3] + ( $v[4] / 100 ); if ( $v[0] == 0xff && $sum == $checksum ) { my $influx = "zph02,dc=trnjanska pm25_pcnt=$pcnt $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/zph02/pm25' -m $pcnt"; }