Connecting Xport to a remote server - Page 1
Forum section: electronics / projects

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: September 03, 2020, 02:29:03 pm
content: I have an embedded project where my PSoC6 processor talks to a Lantronix Xport over a 115,200 baud serial link - the PSoC6 code is quite far along with code that responds to 2-letter commands such as 'di' that gives a directory listing of the files my system has stored - this is all self-developed in C using Cypress Creator 4.2 and GCC C, no RTOS, no DOS, just Cypress-provided C drivers for stuff like the Quad SPI flash memory IC I'm using.I have been successfully developing on this for a while simulating the UI by connecting to it from a remote PC using TeraTerm; when the initial TeraTerm connection window pops up, I chose the TCP/IP option, enter the IP address of the Xport, change the TCP port# to 10001 (default for the Xport), choose the 'other' radio button and set the Protocol: to IPv4. TeraTerm then connects immediately and stays connected all day. So far so good.Now I need to make the Xport connect to a remote server which I don't have control over and the Server guy has no experience with Xport. I have discovered (around p52/53 of the Xport UG) that I can configure the Xport so that it can be commanded to establish an Ethernet link by sending a command over the serial port something like C10.0.0.12/10001 and that is supposed to connect to the device at the other end and, if I configure it to respond, I can get a 1-letter response like Y or N to indicate success.Sorry it's taken quite a while to get there but here is my question. What needs to be set up at the Server end so that the incoming connection instigated by the Xport is successful? Lantronix Tech Support tell me that they are assuming a second Xport at the other end but (disappointingly IMHO) they can't (or won't) provide information on a driver or setup of what the remote server would need to have configured to accept the incoming connection. I think the server is Windows - I'll check. Can anyone give me any help or advice on this?

author: 2N3055
author_rank: Super Contributor
timestamp: September 03, 2020, 03:49:53 pm
content: Quote from: Gandalf_Sr on September 03, 2020, 02:29:03 pmIf other side is windows you can map remote xport to a virtual serial port and just use that.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: September 03, 2020, 04:59:59 pm
content: Quote from: 2N3055 on September 03, 2020, 03:49:53 pmHow do I do that?

author: 2N3055
author_rank: Super Contributor
timestamp: September 03, 2020, 06:04:18 pm
content: There is a windows driver that creates virtual serial port that is tunneled to an IP adress of X-port on the other side.It completely encapsulates serial port on windows trough TCP/IP to serial port on X-port. If you put MAX232 on X-port on the other side you get virtual RS232 cable...So you map X-port to serial port on windows, and when you open COM port on windows, you create tunnel to serial interface on X-port. Your UART data goes there and back.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: September 03, 2020, 06:48:57 pm
content: Quote from: 2N3055 on September 03, 2020, 06:04:18 pmThanks. But doesn't one end of the link have to establish a connection with the other before data can be passed?

author: 2N3055
author_rank: Super Contributor
timestamp: September 03, 2020, 09:02:28 pm
content: Quote from: Gandalf_Sr on September 03, 2020, 06:48:57 pmIt does but it is transparent to the user..

author: voltsandjolts
author_rank: Unknown
timestamp: September 04, 2020, 02:26:53 pm
content: If you mean 'remote' as-in across the internet, then you are likely to run into firewall problems.I have never used X-port before, but if it is initiating a connection to a windows server, you have to get through the firewall first.The X-port would need to use the 'public' IP address of the receiving network, at a specified port.The firewall would need a rule to say incoming connections on that port are forwarded to the server (at its different IP address) and specified port (probably different port).Internet search for 'port forwarding' to get more info.However, it might be more complicated than that in a commercial setting.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: September 04, 2020, 05:14:04 pm
content: Quote from: voltsandjolts on September 04, 2020, 02:26:53 pmThanks. I know about port forwarding and would likely have to forward port 10001 in my router to the LAN side IP address that the Xport is connected to (to make it work through NAT). I now understand that the remote end is going to be Linux Ubuntu about which I know very little - I'm also not responsible for the setup or maintenance of the remote end. Lantronix support have come back to me and said this...1. 'Modem mode' (a feature of the Xport) is propriety to Lantronix with AT-style modem commands - I think they mean the AT style commands which, when sent down the serial line, cause the Ethernet side to try to connect to a specific remote IP address.2. When establishing the connecting using the modem emulator, the Xport connects to a TCP server with a specific IP/PORT. It is not mandatory to be Xport at the other side.