[fpc-pascal] Serial to TCP gateway in FPC?

Bo Berglund bo.berglund at gmail.com
Sun Jun 18 09:04:49 CEST 2017


I need to implement a serial to TCP gateway in order to communicate
between a Windows based control software and a system controller box.
The software and the controller only talk serial to each other and the
protocol is proprietary and binary.
Now I have a situation where the controller is on a remote location
many thousands of km away from here.
I have managed to get some help on the remote site to hook up the
controller serial port to a serial to USB cable plugged into a
Raspberry Pi, which I can reach via VPN from here. So I installed
serial2net on the RPi, making it publish the serial port as a TCP port
(#2091). This part works OK, so whatever is sent on the TCP socket
connection gets transferred to the RS232 serial line and vice versa.

So far so good, but now I also need some kind of serial port to TCP
converter on the Windows 7 PC I use in my end, which is handling the
VPN connection.

So I wonder if there are any FPC examples around for conversion serial
to TCP (where the TCP part is a client rather than a server), which
can compile on Windows. I cannot use any RPi in this end because I
cannot get the RPi to connect by VPN to the remote location...

Ready made example or suggestions on how to go about writing a
converter in FPC are welcome!


-- 
Bo Berglund
Developer in Sweden




More information about the fpc-pascal mailing list