Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?
On Fri, 03 Nov 2023 19:47:01 +0100, Bo Berglund via fpc-pascal wrote: >I have now found that there is a Linux utility named socat, which apparently is >able to map a serial port to a network socket server: > >https://www.acmesystems.it/socat > >Here they actually use ser2net as the remote server point and socat to connect >to it > >Seems like a possible path to go down. > UPDATE: I solved the problem using ser2net on the remote site's RPi3 to publish a connection to the RPi serial0 device, which is hardwired to the measuring equipment. This implements a server on port 2001 (my choice) to the serial connection. Back at home I have this other RPi4 device on which I have an exposed connector to the serial0 port, to which I can connect a serial/usb cable from my Windows10 development machine. After installing socat on the RPi4 I can start it with the remote RPi3 address:2001 as connection parameter for the port and destination. And this RPi4 has already a VPN connection to the remote network. So after I opened the VPN connection and started socat I could run the control program on my Win10 laptop against the equipment across the ocean! Worked amazingly well! And no development required on my part. Just get socat and ser2net via apt on the RPi devices... -- Bo Berglund Developer in Sweden ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?
On Fri, 03 Nov 2023 17:34:09 +0100, Bo Berglund via fpc-pascal wrote: >So ser2net seems like a logical use given that the RPi3 is already there >connected by wire to the serial line and is available via VPN on the network. I >have just checked (using PuTTY via VPN) that the RPi3 does not yet have a >ser2net installed but there is a candidate 3.5-2 available via apt. > >So if I shut down the existing control software then the serial port becomes >free to use with ser2net, I guess. I have now found that there is a Linux utility named socat, which apparently is able to map a serial port to a network socket server: https://www.acmesystems.it/socat Here they actually use ser2net as the remote server point and socat to connect to it Seems like a possible path to go down. -- Bo Berglund Developer in Sweden ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?
On Fri, 3 Nov 2023 06:47:30 -0700, Wayne Sherman via fpc-pascal wrote: >Yes, there is software that bridges a serial connection over a >network. On Windows it is often called a "virtual com port" or >"virtual serial port" or "com port redirector". > >Open Source Linux: >ser2net >https://github.com/cminyard/ser2net >(ser2net is available in many distro package managers) Thanks a lot for your pointers!!! I have looked up your links on ser2net and gogled a bit, but I see many references to using the system with *Telnet* apparently to log in to a console command window or such. That is not my application, all transfers are binary in nature with data as big as 1 Mbytes but sent as packets with checksums. Question: - Does ser2net interfere with the data transfer by assuming "control chars" or the like? If so it cannot be used for my application even though it looked promising when I started to read about it. OTOH: If these mentions of Telnet are only examples and ser2net actually does not assume anything at all about the data being sent/received, then this seems like what I need. In fact the device hooked to the measure system is an RPi3B using the serial port on the RPi and it works fine using the custom automation software. But now I need to troubleshoot the Windows general user interface to the system from afar and I need the link via the network. So ser2net seems like a logical use given that the RPi3 is already there connected by wire to the serial line and is available via VPN on the network. I have just checked (using PuTTY via VPN) that the RPi3 does not yet have a ser2net installed but there is a candidate 3.5-2 available via apt. So if I shut down the existing control software then the serial port becomes free to use with ser2net, I guess. So then I need to do the Windows side as well to complete the system. I assume ser2net is a server only software so one cannot connect two ser2net to each other and then use the serial ports in both ends to complete the connection? I.e. on my location using another RPi3 to expose its serial port as an entry point towards the other end would not be possible, right? Or can ser2net in fact run as a client too and connect to another instance running as a server? If so all I need is an RPi here that can VPN over to the remote LAN (it can, I use that for subversion commits) and on which I install ser2net too but as a client and I now have a serial port to hook my Windows system into... -- Bo Berglund Developer in Sweden ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?
There is also some good info here: https://gist.github.com/DraTeots/e0c669608466470baa6c ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Serial connection via TCP/IP sockets on RPi?
On Fri, Nov 3, 2023 at 12:56 AM Bo Berglund wrote: > I am wondering if there is already available what I am needing? Yes, there is software that bridges a serial connection over a network. On Windows it is often called a "virtual com port" or "virtual serial port" or "com port redirector". Open Source Linux: ser2net https://github.com/cminyard/ser2net (ser2net is available in many distro package managers) Open Source Windows hub0hub and com0com https://sourceforge.net/projects/com0com/ Freeware (Windows): https://www.hw-group.com/software/hw-vsp3-virtual-serial-port Commercial Software (Windows and Linux): https://www.eltima.com/products/serial-over-ethernet/ Commercial Software (Windows): https://www.fabulatech.com/serial-port-redirector.html https://www.taltech.com/tcp-com/ See also: https://forums.raspberrypi.com/viewtopic.php?t=192755 https://novamostra.com/2020/04/16/serial-over-ip/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal