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
674 views 4 comments
by anonymous
We are porting an existing application over to be used with the TRB145.

This application is using libmodbus to access devices on the RS485 bus. Our devices are all half-duplex.

For the moment we are unable to have a stable communication with our device using our own tools accessing directly /dev/rs485 .

What do we have to do to configure the system to allow to use libmodbus (and only libmodbus) with the RS485-port?

Which system-setup-calls have to be done to pre-configure the port? Do we need to issue special ioctls before each modbus-access?

1 Answer

0 votes
by anonymous

Hello, 

Regarding the questions asked, if you want to configure the TRB145 device RS485 you can configure it via Web UI by navigating to Services > RS485. You can refer to this link for more information for the RS485 options and configurations available: TRB145 RS485 - Teltonika Networks Wiki (teltonika-networks.com)

For the related scripts and about the Modbus feature on our device you can try executing this command via CLI: find / -name "*modbus"* 
The said command will display all the scripts and files that is involved in the Modbus Protocol. 

I hope it helps

Regards,
Mellow

 

by anonymous
Thanks for your reply.

I did read the documentation, but using the RS485 of LuCi launches (mode "console") at least a getty on /dev/rs485 which comes in conflict with my application.

I'm really interested in the low-level configuration (or code examples) of how to set up the /dev/rs485 to work.

Is there anything special to be done?
by anonymous

Hi, 

I believe you need to enable the RS485 port without enabling the other services. Some of our client usually implement this kind of thing by scripting and some firmware customizations. Regarding how to do it we don't have any information for they implemented it on their own. 

For the SDK of our devices you can find it here: Software Development Kit - Teltonika Networks Wiki (teltonika-networks.com)

If you need help with this custom development/integration it would be best to contact your sales account manager.

Regards,
Mellow

by anonymous
Yeah, thanks.

We already have a customized firmware and we already removed and added things.

What would have been a great help is a source-code example C of how you setup and use the /dev/rs485-device in your binary applications?

Currently my libmodbus program (same C source) works on a Multitech-Conduit and on a PC but does not on the TRB145. Hence my question.
by anonymous

Hello, 

Sorry for the late reply checked it with our HQ here is their reply:

You can disable RS485 in WebUI altogether if you are going to connect to the interface directly via CLI. You can use something like this (while RS485 is disabled in WebUI) to connect to your serial device (set your baud rate accordingly):

microcom -s 115200 /dev/rs485

Unfortunately, our binary applications are closed source and we cannot divulge such information.

I hope this clarifies things on your side. 


Regards,
Mellow