question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Data length when reading

See original GitHub issue

Hello

I am working on the battery Modbus we talked about in issue and found my problem was I am using port RS232 instead of 485 (Battery has both ports).

So now I moved forward and I am getting a reply from the battery but it is not showing up in node-red

I am getting error Data length error, expected 9 got 1, but when sniffy the serial port I see the below, 9 bytes with correct values have been returned.

Is it possible because I am using USB to RS485?

  0x26 (&)
  0x04
  0x10
  0x00
  0x00
  0x02
  0x73 (s)
  0xfc
  0x26 (&)
  0x04
  0x04
  0x14
  0x8e
  0x27 (')
  0x10
  0xd3
  0x61 (a)

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shahbourcommented, Mar 5, 2018

Worked perfectly, now I am able to read the data. I noticed sometimes it is showing timeout but still i get the data in the debug.

Thanks for your help

2reactions
yaacovcommented, Mar 3, 2018

I thinks that the RTUBufferedPort should solve this, but AFAIK it is the one used by node-red, @biancode ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Data Length Error while reading data - SAS Communities
I am trying to read data from a zipped file using a macro, and then labelling the data. I am using SAS Studio...
Read more >
ResMonApp program terminates with error "Unexpected data ...
The error "Unexpected data length read from Resource Tracker Socket" is often an indication that the port used by ResMonApp (default port ...
Read more >
Modbus RTU problem reading address - Node-RED Forum
The problem comes when I try to read the registers. The error I get is: "Error: Data length error, expected 7 got 1"....
Read more >
Cannot read properties of undefined (reading 'length') - TrackJS
One of the most common errors we record, “Cannot read properties of undefined (reading 'length')”, turned up in our own logs recently while ......
Read more >
15.00 - 3944 Data length is invalid for the data type.
The error occurs when the data length is not valid for its data type (for example, ... 2525 Fatal read error encountered during...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found