projects
/
air-quality
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added --max-time to curl so we fail quickly without network
[air-quality]
/
zph02.pl
diff --git
a/zph02.pl
b/zph02.pl
index
44d35ef
..
8b7018a
100755
(executable)
--- a/
zph02.pl
+++ b/
zph02.pl
@@
-46,7
+46,7
@@
while (1) {
if ( $v[0] == 0xff && $sum == $checksum ) {
my $influx = "zph02,dc=trnjanska pm25_pcnt=$pcnt $t";
print "$influx\n";
if ( $v[0] == 0xff && $sum == $checksum ) {
my $influx = "zph02,dc=trnjanska pm25_pcnt=$pcnt $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'";
system "mosquitto_pub -h rpi2 -t 'air/zph02/pm25' -m $pcnt";
}
}
system "mosquitto_pub -h rpi2 -t 'air/zph02/pm25' -m $pcnt";
}
}