Data is received but not parsed
schmiegelt opened this issue · 4 comments
Hi,
thank you for developing this library! I tried to display my 433 MHz devices within home assistant. Unfortunatly, it seems that the data is received, but not parsed properly. Can you help me with this issue? Do you need more information?
I used the version installed via pip:
# rflink --version
0.0.37`
# rflink -vv --host=192.168.0.15 --port=8124
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:rflink.protocol:connected
DEBUG:rflink.protocol:received data: 20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;01;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;02;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;03;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;04;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;05;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;06;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;07;Baldr;ID=e303;TEMP=00c2;HUM=56;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;08;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;09;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;0A;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;0B;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;0C;Auriol V2;ID=3E01;TEMP=0049;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;0D;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;0E;Baldr;ID=e303;TEMP=00c2;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;19;Baldr;ID=e303;TEMP=00c1;HUM=55;BAT=OK;
DEBUG:rflink.protocol:received data:
DEBUG:rflink.protocol:received data: 20;1A;ElroDB;ID=00000001;SWITCH=1;CMD=ON;CHIME=01;
DEBUG:rflink.protocol:received data:
Best regards,
Philip
Hi,
it seems that for me the linebreak characters(s) are not "\r\n". If I change these (in protocol.py) to only "\n" the data is received correctly, but followed by an invalid packet (with no content displayed). Both the system where the rflink device is attached and where this library is running should be in utf-8 mode. Is there any generic way of handling the linebreak character regardless of the system settings?
Best regards,
Philip
What kind of solution do you use for exposing the Rflink to TCP? Would you be able to create a dump of the TCP communication? On a unix (linux/macos) system you could do this using wireshark or sudo tcpdump -XX -iany port 8124
Here the output of tcpdump:
# tcpdump -XX -iany port 8124
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
21:48:25.280008 IP bananapi.8124 > 192.168.0.10.53186: Flags [P.], seq 1133730898:1133730899, ack > 1637962841, win 227, options [nop,nop,TS val 3532360170 ecr 496841627], length 1
0x0000: 0004 0001 0006 0283 04c3 0bae 0000 0800 ................
0x0010: 4500 0035 6ac9 4000 4006 4e90 c0a8 000f E..5j.@.@.N.....
0x0020: c0a8 000a 1fbc cfc2 4393 5c52 61a1 5459 ........C.\Ra.TY
0x0030: 8018 00e3 f759 0000 0101 080a d28b 89ea .....Y..........
0x0040: 1d9d 339b 0a ..3..
21:48:25.280864 IP 192.168.0.10.53186 > bananapi.8124: Flags [.], ack 1, win 229, options [nop,nop,TS val 496841628 ecr 3532360170], length 0
0x0000: 0000 0001 0006 2405 0faa b38c 0000 0800 ......$.........
0x0010: 4500 0034 4972 4000 4006 6fe8 c0a8 000a E..4Ir@.@.o.....
0x0020: c0a8 000f cfc2 1fbc 61a1 5459 4393 5c53 ........a.TYC.\S
0x0030: 8010 00e5 015f 0000 0101 080a 1d9d 339c ....._........3.
0x0040: d28b 89ea ....
21:48:56.223306 IP bananapi.8124 > 192.168.0.10.53186: Flags [P.], seq 1:46, ack 1, win 227, options >>[nop,nop,TS val 3532363264 ecr 496841628], length 45
0x0000: 0004 0001 0006 0283 04c3 0bae 0000 0800 ................
0x0010: 4500 0061 6aca 4000 4006 4e63 c0a8 000f E..aj.@.@.Nc....
0x0020: c0a8 000a 1fbc cfc2 4393 5c53 61a1 5459 ........C.\Sa.TY
0x0030: 8018 00e3 2c11 0000 0101 080a d28b 9600 ....,...........
0x0040: 1d9d 339c 3230 3b36 303b 4261 6c64 723b ..3.20;60;Baldr;
0x0050: 4944 3d65 3330 333b 5445 4d50 3d30 3064 ID=e303;TEMP=00d
0x0060: 353b 4855 4d3d 3434 3b42 4154 3d4f 4b3b 5;HUM=44;BAT=OK;
0x0070: 0a .
21:48:56.224327 IP 192.168.0.10.53186 > bananapi.8124: Flags [.], ack 46, win 229, options [nop,nop,TS val 496849364 ecr 3532363264], length 0
0x0000: 0000 0001 0006 2405 0faa b38c 0000 0800 ......$.........
0x0010: 4500 0034 4973 4000 4006 6fe7 c0a8 000a E..4Is@.@.o.....
0x0020: c0a8 000f cfc2 1fbc 61a1 5459 4393 5c80 ........a.TYC..
0x0030: 8010 00e5 d6e3 0000 0101 080a 1d9d 51d4 ..............Q.
0x0040: d28b 9600 ....
I am using socat for connecting for relaying the data:
socat -u -ddd -v /dev/ttyACM0,b57600 TCP-LISTEN:8124,reuseaddr,forever