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
987 views 1 comments
by

Hi

Trying to configure MODBUS serial master with RS485, and so far not a much success ;-(

We are working with a device (Solar regulator) that we are very familiar with and have been monitoring it via python/modbus on raspberry pi's for some time.

So far unable to get Serial Master with data sender to work.  Unfortunately there is little in the way of tools for diagnosis.  I can't work out how to user modbus_serial_master form the command line to see if / what sort of errors we are getting.

Also just so I know I have it wired correctly through the RS485 interface , I have tried reading it via python (we have custom python modbus code TCP running on the RUT955) however even after turning off all Serial/MODBUS services I am unable to open the /dev/rs485 device as I get serial.serialutil.SerialException: Port is already open.  I have used lsof to establish that the port is not open.

So a little stumped on how to move forward.  (I did check the SDK but the modbus_serial_master code wasn't there, to work out how I might use it to diagnose).

This is a the last piece in my puzzle of replace our standard modem and a raspberry pi for most of our fleet.

Thanks


Tim

by anonymous
Ok moved forward a bit.

I can get python talking to the serial port.  I didn't realize the serial module was quite old compared to what the modbus library (modbus_tk) I was using expected in terms of serial module version and it couldn't determine that the port was opened when the serial instance was created, so it was opening it again and failing (of course). Made a serial wrapper to reflect the expected api.

Still can't work out why Modbus Serial master/ Modbus data to the server for the same modbus reads isn't working.

I unable to work out when in the chain this is failing.  I can confirm the service is running, but without logs, being able to see modbus response etc... its hard to diagnose the issue.

2 Answers

0 votes
by anonymous
Hello Tim,

As I understand you want to collect data from Solar regulator modbus slave and send data to remote server?

Have you tried first to collect data from solar regulator with modbus gateway (PC <--- ModBus TCP---> RUT955 <---ModBus RTU---> Solar regulator), just to check if data can be collect in this way?
0 votes
by anonymous

Hi,

Were you able to create modbus?

I found all the information about Modbus : https://www.virtual-serial-port.org/articles/modbus-vs-rs485/ , but what about this moment??