X-Git-Url: http://git.rot13.org/?p=air-quality;a=blobdiff_plain;f=pms3003.pl;h=f1d458ab6914a10597fa61f883785e965495059a;hp=0f73e96c095819a20e8f6b70e7ce98a720b42aba;hb=c2240722beacb995b93da993a446348f8571f23d;hpb=42b7874fd94e776acce9f6fcbea694474d848368 diff --git a/pms3003.pl b/pms3003.pl index 0f73e96..f1d458a 100755 --- a/pms3003.pl +++ b/pms3003.pl @@ -6,7 +6,7 @@ use Device::SerialPort; use Time::HiRes; use Data::Dump qw(dump); -my $port = shift @ARGV || '/dev/ttyUSB0'; +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 $debug = $ENV{DEBUG} || 0; @@ -60,7 +60,7 @@ while (1) { $influx =~ s/,$//; $influx .= " $t"; print "$influx\n"; - system "curl --silent -XPOST '$influx_url' --data-binary '$influx'" + system "curl --max-time 2 --silent -XPOST '$influx_url' --data-binary '$influx'" } }