Socket server to serial bridge
-
We've actually coded one of these into Mango 2.8 already, as another type of virtual serial port. I believe the release is still at least a month away, though.
-
@phildunlap That's really nice. Is there a module to install or another way to get it working in my current installation? If you have a beta version I would like to test it.
-
I sent you an email with some instructions. It's for Mango 2.7.10
-
Thank you so much!
-
Got no luck with that, when saving I got the message: No contextual field found for key bufferSize.
I believe I'll have to wait until the official release.
Thank you again for your kindness.
-
Be sure to try it after clearing your browser cache and deleting the Mango/work/jsp directory!
-
I did that, I am sure... I stop the instance, cleared cache, deleted work/jsp and restarted Mango.
-
Hmm...
That still sounds like it's a JSP problem, not a problem with the classes. Can you check that Mango/overrides/web/WEB-INF/jsp/systemSettings.jsp is where we placed that file? You may have to overwrite the version located in Mango/web/WEB-INF/jsp/ but be sure to back it up.
-
It is still the same, I've check the file path, it was right. Also I replaced the orginal file, stop, deleted work/jsp diretory, cleared cache and start again with no success.
-
Ah! I found the problem. You need to edit Mango/web/WEB-INF/dwr.xml
Near the bottom are the lines:
<convert converter="bean" match="com.infiniteautomation.mango.io.serial.virtual.VirtualSerialPortConfig"> <param name="include" value="portName,type"/> </convert> <convert converter="bean" match="com.infiniteautomation.mango.io.serial.virtual.SerialSocketBridgeConfig"> </convert>
Add this right after it:
<convert converter="bean" match="com.infiniteautomation.mango.io.serial.virtual.SerialServerSocketBridgeConfig"> </convert>
This will require a restart of Mango to get detected.
-
It works!
But, now I realize I need another feature, I need to bind two 2 TCP ports.
It will be used to connect a PLC with Modbus IP via GSM/GPRS. (it doesn't work with serial connection)
The PLC will connect to a socket server and I need another TCP port to connect the datasource (Modbus IP). Like a gateway,
Do you believe it is possible for next release?
-
I'm not sure what you mean. If you just wish to forward a TCP connection through a server, there are many proxies which exist to serve that need. If you need to do some processing on it i understand passing it through Mango, but if you are just directing one socket to another there are lots of options to perform that proxying.
-
You're right, at this time I am using the software from PLC manufacturer, but sometimes it freezes, so I thought it would be nice to have it on Mango.
Here is my cenario: The PLC connects to its server trough a TCP port and Mango connects to another port and starts the comunication.
I tried to found another solution, maybe I am not looking for the right name.
I will keep trying, thank you so much for your attention and kindness.
-
It sounds to me like you may be able to do some iptables stuff and let the operating system handle everything. Check out this link (but I did not test its contents): https://debian-administration.org/article/595/Need_a_generic_iptables_tcp_proxy
-
Thank you again.
About the serial socket server you sent me, I did some tests with a GSM-RS485 converter, it works for first read, them it stops and trow this error:
com.serotonin.modbus4j.exception.ModbusTransportExceptiono: java.io.IOException: java.io.IOException: Socket connection not established.
I know the device is connected because it shows me its connection status.
-
Hmm.
So, you have the bridge device making a TCP connection to Mango, then Mango doing Modbus out the virtual port connected to that server socket?
Are there any options on the GSM-RS485? Specifically, are you using TCP or TCP with keep-alive? I would recommend going with keep-alive, as I would speculate the bridge is closing the connection, perhaps. Is there more to the stack trace in the log?