X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=dsm501.pl;h=33277e5d19a152bc35491b6c0adc331bc46bff2b;hb=a1a1be98b3279adce682f3508bcba6a0dddea715;hp=a821aaf920f1a17655dfd849dd4f00bb413c1536;hpb=a95b761d2bf5479a45d6e6c64c019a1a82d944d6;p=air-quality diff --git a/dsm501.pl b/dsm501.pl index a821aaf..33277e5 100755 --- a/dsm501.pl +++ b/dsm501.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://10.60.0.92:8086/write?consistency=any&db=rot13'; my $measurement = $ENV{MEASUREMENT} || 'dsm501'; my $s = new Device::SerialPort( $port ) || die $!; @@ -31,7 +31,7 @@ while (1) { $string =~ s/[\r\n]+$//; $string =~ s/\s/,/g; my $influx = "$measurement,dc=trnjanska $string $t"; - print "$influx\n"; + print "$influx\n" if -e '/dev/shm/air-debug'; system "curl --silent -XPOST '$influx_url' --data-binary '$influx'" } else { warn "SKIP: $string\n";