Menu

#3 Reading out sensor while radio connexion is faulty results in invalid values

1.0
open
nobody
None
2017-02-04
2017-02-04
No

Hello,

Not sure what we should do there, knowing the radio is lost (cn is not 0 or 15, but it's not 3 in fact)
cn connection type ............... 0x54d:1 cable=0,lost=3,wireless=15,unknown-X

reading out sensors in these conditions lead to get invalid BCD nibbles, which are converted blindly leading to invalid reports.

I admit user may filter out results if cn returns anything different from 0 or 15, but should the BCD conversion fail and return NaN (or equivalent) when any nibble is invalid (0xA) ?

pi@PIHOME:~/ws2300/ws2300-code$ python /home/pi/ws2300/ws2300-code/ws2300.py /dev/ttyUSB1 ot
out temp = -20.00 (0,0,10,10)
99.88 rb start
99.88 re C 06:c0-- C 06:02--
0.73 rd 82:00 9a:16 b2:2c 8a:31??
0.79 re C 06:02--
0.85 rd 82:00 9a:16 b2:2c 8a:32 ca:32, :909121
1.00 rb end
1.00 rb start
1.00 re C 06:02--
1.07 rd 82:00 8e:13 9e:23??
1.11 re C 06:02--
1.17 rd 82:00 8e:13 9e:27 8e:33 ca:32, :00aaaa
1.28 rb end

pi@PIHOME:~/ws2300/ws2300-code$ python /home/pi/ws2300/ws2300-code/ws2300.py /dev/ttyUSB1 cn
connection type = unknown-11 (11,)
19.02 rb start
19.02 re C 06:80-- C 06:-- C 06:02--
20.14 rd 82:00 9a:16 b2:2c 8a:32 ca:32, :909121
20.26 rb end
20.26 rb start
20.26 re C 06:02--
20.32 rd 82:00 96:15 92:24 b6:3d c6:31, :4b4b
20.46 rb end

Discussion


Log in to post a comment.

MongoDB Logo MongoDB