Apollon77 / node-mbus

Nodejs mbus module
MIT License
21 stars 15 forks source link

Error: Failed to receive M-Bus response frame[1]. #17

Closed robertsLando closed 6 years ago

robertsLando commented 6 years ago

I'm getting this error when using the method getData(addr, cb) . Here is the output:

0|node-red | mbus_serial_send_frame: Dumping M-Bus frame [5 bytes]: 10 40 FD 3D 16 
0|node-red | mbus_serial_recv_frame: Attempt to read 1 bytes [len = 0]
0|node-red | mbus_serial_recv_frame: Got 0 byte [remaining 1, len 0]
0|node-red | mbus_serial_send_frame: Dumping M-Bus frame [5 bytes]: 10 40 FD 3D 16 
0|node-red | mbus_serial_recv_frame: Attempt to read 1 bytes [len = 0]
0|node-red | mbus_serial_recv_frame: Got 0 byte [remaining 1, len 0]
0|node-red | mbus_serial_send_frame: Dumping M-Bus frame [5 bytes]: 10 5B 01 5C 16 
0|node-red | mbus_serial_recv_frame: Attempt to read 1 bytes [len = 0]
0|node-red | mbus_serial_recv_frame: Got 1 byte [remaining 1, len 0]
0|node-red | 68 
0|node-red | mbus_serial_recv_frame: Attempt to read 2 bytes [len = 1]
0|node-red | mbus_serial_recv_frame: Got 2 byte [remaining 2, len 1]
0|node-red | 71 70

Using method getData with address 1

(If you want we can speak about this in node-mbus channel on slack)

I have also tried to do a scan and after long time (15 minutes I got 0 devices found). Here part of the log of the scan:

scan_log.txt

Apollon77 commented 6 years ago

Ääähm where exactly the error occurs? Or is it not in the logs but in the callback?!

Apollon77 commented 6 years ago

Aahhh now I see ... In this case the error is ok because response is wrong!!

according to mbus standard the message start need to have the length indicator TWICE!

So 68 71 71 or 68 70 70

would be correct, but in the scan it was 68 71 70 and in your getData 68 70 71 ...

So the mbus device returns crap here and so ... error :-)

Apollon77 commented 6 years ago

What is it for a device?

Apollon77 commented 6 years ago

was a HW issue