FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
334 views 1 comments
by anonymous

I'm using a TRB145 to read Modbus meters remotely.  The meters connect to the RS485 port on the TRB145.  When using the open source NModbus library I frequently see the following errors:

System.IO.IOException: Read resulted in 0 bytes returned

System.IO.IOException: Unexpected byte count. Expected 112, received 20

FormatException, 3 retries remaining - System.FormatException: Message frame does not contain enough bytes

Has anyone else experienced similar errors when using the TRB145?

by anonymous
I don't have any experience with this library specifically, but maybe see if you can get a debug output that actually shows you what's being returned? E.g. what were the 20 bytes that were received? Also check for a baud rate mismatch?

1 Answer

0 votes
by anonymous
Hi,

Can you read the values using WebUI or CLI commands that we provide? It's just to make sure its device fault, not the open source library that you're using.

https://wiki.teltonika-networks.com/view/TRB145_Modbus#RS485

Is the firmware version of your TRB145 the latest one?

EB.