Modbus RTU over TCP ( serial com redirector )?

I really need some help with my communication setup. I trying to use openhab and modbus binding, to talk to my systemair ventilation system. I’ve got a TCP USR-232/485-950 gateway with no RTU passthrough over TCP, so I’ll need to set up a virtual COM to TCP redirection. I’ve tried several examples from the internet, both socat and ser2net, but openhab wouldn’t connect. Any help on setting up the communication would truly be Appreciated.

Thanks
Chris

Link? Can’t find that thing.

But the problem I’m having isn’t regarding the TCP gateway. With 3rd party software I’m able to read/write to my modbus slave, with the modbus rtu over tcp option. Since Openhab modbus binding doesn’t support rtu over tcp, I will have to use rtu protocol through a virtual com, then redirect that to tcp (my gateway-ip:port). It’s that part I’m struggling with :frowning:
I’m running openhab 2.1 on a raspberry2 (openhabian).

Look at this thread…

Thanks, but can’t see that this topic involves serial com to tcp forwarding :S
This is a outtake from openhab modbus binding example page:

"Modbus RTU over TCP

Some devices uses modbus RTU over TCP. This is usually Modbus RTU encapsulation in an ethernet packet. So, those devices does not work with Modbus TCP binding since it is Modbus with a special header. Also Modbus RTU over TCP is not supported by Openhab Modbus Binding. But there is a workaround: you can use a Virtual Serial Port Server, to emulate a COM Port and Bind it with OpenHab unsing Modbus Serial."

I’m looking for a tutorial on this matter, to be able to use the workaround mentioned above.

Best regards
Christian

Why aren’t you simply talking Modbus-TCP to this gateway? It handles TCP<>RTU by itself. “Work mode: … MODBUS TCP”

You do have to set up the NNZN for this mode, I recall it as a bit fiddly. I think I had to use an older setup software from Windows.

I have tried every work mode present in the gateway interface. The only protocol that is actually connecting to my modbus device, is modbus rtu over tcp. I’m using piigab modbus test tool, which I try to connect with tcp (ip.address to GW) which returns no response/time out. If I choose rtu over tcp, everything works like a charm. So I would think that these cheap gateways lack what other pricier GW’s have, the rtu passthough option?
I have given up on this option now, and ordered a sixnet gateway with rtu passthrough built in :slight_smile:

@rossko57

By the way, do you know if the modbus binding will ever have support for rtu over tcp?

BR
Chris

The end serial device knows nothing about Modbus-TCP nor RTU-over-TCP.
If the gateway knows nothing about Modbus i.e. is set for serial pass-through mode, it seems possible that sending RTU-over-TCP to it might just work i.e. the RTU part gets on the serial line?

NNZN works quite happily for me as TCP-over-ethernet to RTU-over-serial gateway.
I suspect you have not truly set Modbus TCP mode in the NNZN device - as I said, I recall this was fiddly to do in some way. Let me have a rummage …

EDIT - right. I have NNZN setup (for windows) version 4.5, with text in Chinese. I also have setup version 4.2 with text in English. I set up the gateway with 4.2 as far as I could, but the Modbus mode does not ‘stick’ as I remember this. Switching then to setup tool 4.5 allows setting mode MOD-SERVER-RTU that stays set.

You are sure you have the NNZN device? (having mentioned USR in first post - competing brands)

I doubt that effort will ever be made for binding 1.x
New binding 2 is well along it seems, and you could/should make an enhancement request if you want it to support this.