X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=pms3003.pl;h=e90d1c0d73df6921647b6a4f0f33f94216035544;hb=HEAD;hp=72771f5a45153a9a8626531ef229d71bbd6ee8b4;hpb=d32ab0631841e5d476fc0e5ef8a4cf3876e1baa3;p=air-quality diff --git a/pms3003.pl b/pms3003.pl index 72771f5..e90d1c0 100755 --- a/pms3003.pl +++ b/pms3003.pl @@ -7,7 +7,7 @@ use Time::HiRes; use Data::Dump qw(dump); my $port = shift @ARGV || '/dev/serial/by-path/platform-3f980000.usb-usb-0:1.3:1.0-port0'; -my $influx_url = shift @ARGV || 'http://10.13.37.92:8086/write?consistency=any&db=rot13'; +my $influx_url = shift @ARGV || 'http://192.168.3.40:8086/write?consistency=any&db=rot13'; my $debug = $ENV{DEBUG} || 0; @@ -59,8 +59,8 @@ while (1) { }; $influx =~ s/,$//; $influx .= " $t"; - print "$influx\n"; - system "curl --silent -XPOST '$influx_url' --data-binary '$influx'" + print "$influx\n" if -e '/dev/shm/air-debug'; + system "curl --max-time 2 --silent -XPOST '$influx_url' --data-binary '$influx'" } }