• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Socket server to serial bridge

    Wishlist
    2
    17
    5.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      Tomi
      last edited by Tomi

      It would be amazing if we can set a socket server, just to bind a connection with the existing virtual serial ports.
      I just need a socket server waiting for a connection and the hability to bind this tcp port with an existing virtual serial port, in a transparent communication.

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        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.

        T 1 Reply Last reply Reply Quote 0
        • T
          Tomi @phildunlap
          last edited by Tomi

          @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.

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            I sent you an email with some instructions. It's for Mango 2.7.10

            1 Reply Last reply Reply Quote 0
            • T
              Tomi
              last edited by

              Thank you so much!

              1 Reply Last reply Reply Quote 0
              • T
                Tomi
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  Be sure to try it after clearing your browser cache and deleting the Mango/work/jsp directory!

                  1 Reply Last reply Reply Quote 0
                  • T
                    Tomi
                    last edited by

                    I did that, I am sure... I stop the instance, cleared cache, deleted work/jsp and restarted Mango.

                    1 Reply Last reply Reply Quote 0
                    • phildunlapP
                      phildunlap
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • T
                        Tomi
                        last edited by

                        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.

                        0_1467133777163_server.jpg

                        1 Reply Last reply Reply Quote 0
                        • phildunlapP
                          phildunlap
                          last edited by phildunlap

                          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.

                          1 Reply Last reply Reply Quote 0
                          • T
                            Tomi
                            last edited by

                            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?

                            1 Reply Last reply Reply Quote 0
                            • phildunlapP
                              phildunlap
                              last edited by phildunlap

                              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.

                              1 Reply Last reply Reply Quote 0
                              • T
                                Tomi
                                last edited by

                                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.

                                1 Reply Last reply Reply Quote 0
                                • phildunlapP
                                  phildunlap
                                  last edited by

                                  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

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    Tomi
                                    last edited by Tomi

                                    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.

                                    1 Reply Last reply Reply Quote 0
                                    • phildunlapP
                                      phildunlap
                                      last edited by

                                      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?

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post