projects
/
vaillant-thermostat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6498a8
)
connect again on serial error
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 20 Mar 2017 09:23:54 +0000
(10:23 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 20 Mar 2017 09:23:54 +0000
(10:23 +0100)
serial.pl
patch
|
blob
|
history
diff --git
a/serial.pl
b/serial.pl
index
5dc5bda
..
06a1d15
100755
(executable)
--- a/
serial.pl
+++ b/
serial.pl
@@
-11,6
+11,8
@@
my $path = shift @ARGV || '/dev/serial/by-path/platform-20980000.usb-usb-0:1.3.1
$|=1;
+connect_again:
+
my $s = new Device::SerialPort( $path ) || die $!;
$s->baudrate(2400);
$s->databits(8); # 7
@@
-36,6
+38,7
@@
sub _mqtt_pub {
while (1) {
my ($len, $string) = $s->read($read_len);
+ goto connect_again if ! defined $len;
my $ts = time();
if ( $len > 0 ) {