X-Git-Url: http://git.rot13.org/?p=air-quality;a=blobdiff_plain;f=iio2mqtt.pl;h=a4690242dcf510cc94b4b33ea817014464300743;hp=855e8ca215660b68075f0e88a17cc2e97d5c8df4;hb=HEAD;hpb=a62e5f83f1b7e8830c258771a7601146e115997f diff --git a/iio2mqtt.pl b/iio2mqtt.pl index 855e8ca..50668f0 100755 --- a/iio2mqtt.pl +++ b/iio2mqtt.pl @@ -6,7 +6,7 @@ use Time::HiRes; # sudo apt install libiio-utils mosquitto-clients -my $influx_url = shift @ARGV || 'http://10.60.0.92:8086/write?consistency=any&db=rot13'; +my $influx_url = shift @ARGV || 'http://192.168.3.40:8086/write?consistency=any&db=rot13'; my $delay = $ENV{DELAY} || 1; @@ -57,7 +57,7 @@ while(1) { system "curl --silent -XPOST '$influx_url' --data-binary '$influx'"; warn "$influx\n"; - my $dt = Time::HiRes::time + $delay - $t - 100; + my $dt = Time::HiRes::time + $delay - $t - 0.01; if ( $dt > 0 ) { sleep $dt; }