projects
/
vaillant-thermostat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ba95c22
)
changed serial port path and send mqtt DHT22 errors
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 15 May 2018 15:25:39 +0000
(17:25 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 15 May 2018 15:25:39 +0000
(17:25 +0200)
serial.pl
patch
|
blob
|
history
diff --git
a/serial.pl
b/serial.pl
index
12a2cbf
..
c08a73e
100755
(executable)
--- a/
serial.pl
+++ b/
serial.pl
@@
-7,7
+7,7
@@
use Time::HiRes qw(time);
my $read_len = 255;
my $read_len = 255;
-my $path = shift @ARGV || '/dev/serial/by-path/platform-20980000.usb-usb-0:1.
3.1
:1.0-port0';
+my $path = shift @ARGV || '/dev/serial/by-path/platform-20980000.usb-usb-0:1.
2
:1.0-port0';
$|=1;
$|=1;
@@
-68,8
+68,9
@@
while (1) {
_mqtt_pub "stat/boiler/" . chr(ord('a') + $_) => $d[$_] foreach 0 .. $#d;
}
_mqtt_pub "stat/boiler/" . chr(ord('a') + $_) => $d[$_] foreach 0 .. $#d;
}
- my @v = split(/\s+/, $temp, 3);
- my @n = qw( DS18B20/temperature DHT22/temperature DHT22/humidity );
+ my @v = split(/\s+/, $temp, 4);
+ my @n = qw( DS18B20/temperature DHT22/temperature DHT22/humidity DHT22/errors );
+ @n = qw( DS18B20/temperature DHT22/temperature DHT22/humidity DHT22/errors ) if $#v == 1; # no DS18B20
foreach (@v) {
_mqtt_pub "stat/boiler/" . shift(@n) => $_;
}
foreach (@v) {
_mqtt_pub "stat/boiler/" . shift(@n) => $_;
}