X-Git-Url: http://git.rot13.org/?p=air-quality;a=blobdiff_plain;f=mh-z19b.pl;h=c2f8ffe302d16299fc7f41fb5292719af320a764;hp=0c3fbd10a90a2e7a7db6d94d58427eff96bba3ee;hb=632fc9b95bf751f33b6d71238adc6bb94f2e5ae6;hpb=d60ec903ff3334d644377bff1f682ede2941a28a diff --git a/mh-z19b.pl b/mh-z19b.pl index 0c3fbd1..c2f8ffe 100755 --- a/mh-z19b.pl +++ b/mh-z19b.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/pci-0000:00:1a.7-usb-0:5.3.4:1.2'; 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 +16,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 +30,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;