X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=mh-z19b.pl;h=94abb05e5327fc41e15b4acff72619db8140a6dd;hb=452f7e0d2461923ab031789c222268779b6f80d9;hp=0c3fbd10a90a2e7a7db6d94d58427eff96bba3ee;hpb=600961033ca0ef7e42ebd2f93c894edcea3c3206;p=air-quality diff --git a/mh-z19b.pl b/mh-z19b.pl index 0c3fbd1..94abb05 100755 --- a/mh-z19b.pl +++ b/mh-z19b.pl @@ -7,6 +7,7 @@ use Time::HiRes; use Data::Dump qw(dump); my $port = shift @ARGV || '/dev/ttyUSB0'; +$port = '/dev/ttyUSB5'; my $influx_url = shift @ARGV || 'http://10.13.37.229:8186/write?db=telegraf'; $influx_url = 'http://10.13.37.92:8086/write?db=rot13'; @@ -16,7 +17,7 @@ $s->databits(8); $s->parity('none'); $s->stopbits(1); $s->handshake('none'); -$s->read_char_time(0); +$s->read_char_time(1); $s->read_const_time(10); $s->debug(1); @@ -30,8 +31,7 @@ while (1) { if ( $len > 0 ) { my @v = unpack('C*', $string); if ( $#v < 8 ) { - warn "# $len ",dump($string), dump( @v ), $/; - next; + die "# $len ",dump($string), dump( @v ), $/; } my $sum = 0;