A
A
Aryeh Leonid R.2014-02-25 13:00:59
linux
Aryeh Leonid R., 2014-02-25 13:00:59

How to organize UDP over RS485 under Linux?

It is necessary to organize UDP (TCP IP) ower RS-485 under Linux. The RS-485 protocol is similar to MODBUS.
Those. I want to open a socket in the program and work with UDP, not paying attention to the fact that the only available board interface is RS485. In addition, when the system boots and during its operation, I want to safely use DNS, DHCP, etc. etc. It is clear that the speed will be limited. It is clear that a driver is needed and it is clear that there is no ready-made one (the protocol is proprietary). It is clear that at the second end of the RS-485 (Linux or Win7) it will be necessary to provide a bridge to the IP network.
Where to dig? Maybe there is a similar project that we can modify?
Preferably Open source with a license that does not require that the code used be completely open source. Those. we can post the modified driver later, but not the entire product where it is used.
Thanks in advance to all those who respond.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergei Borisov, 2014-02-25
@risik

> UDP (TCP IP)
so all the same TCP/IP or TCP/UDP?
> RS-485 protocol is similar to MODBUS
RS-485 is not a protocol. And the interface standard. But Modbus is a protocol.
That is, as I understood your task. you have a piece of iron that has RS-485 to another piece of iron that already has ethernet and internet access. You want to get access to the Internet from the first piece of iron.
Then your task is formulated: TCP/UDP over RS-485. That is, instead of Ethernet, you will use RS-485. Then, something, for example, in this direction: www.rsdn.ru/forum/winapi/661573.hot or social.microsoft.com/Forums/en-US/95128f22-7447-47...
In this case, Windows differs from Linux in a fundamental way. Yes, RS-485 does not differ from RS-232 in terms of programming.

M
Mak1012, 2014-02-27
@Mak1012

If you have one master and 32 slaves in your network, then the slave cannot send anything on its own initiative. The slave can only respond to requests. That is, the master must poll all the slaves in turn. In this case, it is hardly possible to speak of a normal Ethernet network.
Maybe this option will work?
The master polls all devices in turn.
In response to the request, the slave sends a data packet, which the master sends to the network as a UDP packet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question