Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #32090 > unrolled thread

Remote COM port

Started bypozz <pozzugno@gmail.com>
First post2023-11-27 08:55 +0100
Last post2023-11-28 13:07 +0000
Articles 9 — 6 participants

Back to article view | Back to comp.arch.embedded


Contents

  Remote COM port pozz <pozzugno@gmail.com> - 2023-11-27 08:55 +0100
    Re: Remote COM port Arthur Erhardt <usenet2023@erhardt-net.de> - 2023-11-27 08:37 +0000
      Re: Remote COM port pozz <pozzugno@gmail.com> - 2023-11-28 08:37 +0100
        Re: Remote COM port Arthur Erhardt <usenet2023@erhardt-net.de> - 2023-11-28 09:13 +0000
    Re: Remote COM port David Brown <david.brown@hesbynett.no> - 2023-11-27 09:44 +0100
    Re: Remote COM port Paul Rubin <no.email@nospam.invalid> - 2023-11-27 02:12 -0800
      Re: Remote COM port pozz <pozzugno@gmail.com> - 2023-11-28 08:38 +0100
    Re: Remote COM port Theo <theom+news@chiark.greenend.org.uk> - 2023-11-27 10:58 +0000
    Re: Remote COM port chrisq <devzero@nospam.com> - 2023-11-28 13:07 +0000

#32090 — Remote COM port

Frompozz <pozzugno@gmail.com>
Date2023-11-27 08:55 +0100
SubjectRemote COM port
Message-ID<uk1i0s$3m6un$1@dont-email.me>
I have a proprietary device with a RS232 port controlled by a Windows 
application that opens a standard COM port.

Now I need to move the device in a remote position with Internet 
connection. The user (and the Windows PC) will be in a different position.

I want to develop an embedded Linux box with RS232 port connected to the 
device and Internet.

I know there are many commercial solutions, but before I'd search for an 
open-source solution, if any. Here the big issue is the virtual COM 
driver for Windows.

It's not a one-piece scenario, so it makes sense to develop my embedded 
box that solves this problem. Moreover, I would stay generic regarding 
RS232 baudrates, parity and so on.

[toc] | [next] | [standalone]


#32091

FromArthur Erhardt <usenet2023@erhardt-net.de>
Date2023-11-27 08:37 +0000
Message-ID<ksj2poFqjpqU1@mid.individual.net>
In reply to#32090
pozz <pozzugno@gmail.com> wrote:
> I have a proprietary device with a RS232 port controlled by a Windows 
> application that opens a standard COM port.

> Now I need to move the device in a remote position with Internet 
> connection. The user (and the Windows PC) will be in a different position.

> I want to develop an embedded Linux box with RS232 port connected to the 
> device and Internet.

> I know there are many commercial solutions, but before I'd search for an 
> open-source solution, if any. Here the big issue is the virtual COM 
> driver for Windows.
Two devices would remove the need for any kind of special software on 
windows. For the sake of the argument, make it two raspberry pis with 
USB to RS232 adapters.

<windows pc.com1> <--> <raspberrypi1.ttyUSB0> <--> internet via your
interface of choice <raspberrypi2.ttyUSB0> <--> <proprietary equipment>

The software you want on the linux systems is socat or netcat and 
should be part of any modern distribution, though not installed by 
default. For this to work, your windows software shouldn't do 
anything fancy with the status lines of RS232.

Any raspberry pi is grossly oversized for the task, so feel free to 
search for something smaller and cheaper.

This 
https://stackoverflow.com/questions/484740/converting-serial-port-data-to-tcp-ip-in-a-linux-environment
might give some hints concerning how to use the software.

> It's not a one-piece scenario, so it makes sense to develop my embedded 
> box that solves this problem. Moreover, I would stay generic regarding 
> RS232 baudrates, parity and so on.

-- 
A. Erhardt

[toc] | [prev] | [next] | [standalone]


#32096

Frompozz <pozzugno@gmail.com>
Date2023-11-28 08:37 +0100
Message-ID<uk45av$6esl$1@dont-email.me>
In reply to#32091
Il 27/11/2023 09:37, Arthur Erhardt ha scritto:
> pozz <pozzugno@gmail.com> wrote:
>> I have a proprietary device with a RS232 port controlled by a Windows
>> application that opens a standard COM port.
> 
>> Now I need to move the device in a remote position with Internet
>> connection. The user (and the Windows PC) will be in a different position.
> 
>> I want to develop an embedded Linux box with RS232 port connected to the
>> device and Internet.
> 
>> I know there are many commercial solutions, but before I'd search for an
>> open-source solution, if any. Here the big issue is the virtual COM
>> driver for Windows.
> Two devices would remove the need for any kind of special software on
> windows. For the sake of the argument, make it two raspberry pis with
> USB to RS232 adapters.
> 
> <windows pc.com1> <--> <raspberrypi1.ttyUSB0> <--> internet via your
> interface of choice <raspberrypi2.ttyUSB0> <--> <proprietary equipment>
> 
> The software you want on the linux systems is socat or netcat and
> should be part of any modern distribution, though not installed by
> default. For this to work, your windows software shouldn't do
> anything fancy with the status lines of RS232.
> 
> Any raspberry pi is grossly oversized for the task, so feel free to
> search for something smaller and cheaper.
> 
> This
> https://stackoverflow.com/questions/484740/converting-serial-port-data-to-tcp-ip-in-a-linux-environment
> might give some hints concerning how to use the software.

I was thinking about this solution, I see two drawbacks:

* The user PC, that is already connected to Internet, must be equipped 
with an additional box that must be connected to Internet

* Linux doesn't know anything about the serial port settings (baudrate, 
parity, and so on). The user should know the settings used by the 
third-party application and set them in the Linux box.


>> It's not a one-piece scenario, so it makes sense to develop my embedded
>> box that solves this problem. Moreover, I would stay generic regarding
>> RS232 baudrates, parity and so on.
> 

[toc] | [prev] | [next] | [standalone]


#32098

FromArthur Erhardt <usenet2023@erhardt-net.de>
Date2023-11-28 09:13 +0000
Message-ID<kslp9oFj4asU1@mid.individual.net>
In reply to#32096
pozz <pozzugno@gmail.com> wrote:
> Il 27/11/2023 09:37, Arthur Erhardt ha scritto:
> > pozz <pozzugno@gmail.com> wrote:
> >> I have a proprietary device with a RS232 port controlled by a Windows
> >> application that opens a standard COM port.
> > 
> >> Now I need to move the device in a remote position with Internet
> >> connection. The user (and the Windows PC) will be in a different position.
> > 
> >> I want to develop an embedded Linux box with RS232 port connected to the
> >> device and Internet.
> > 
> >> I know there are many commercial solutions, but before I'd search for an
> >> open-source solution, if any. Here the big issue is the virtual COM
> >> driver for Windows.
> > Two devices would remove the need for any kind of special software on
> > windows. For the sake of the argument, make it two raspberry pis with
> > USB to RS232 adapters.
> > 
> > <windows pc.com1> <--> <raspberrypi1.ttyUSB0> <--> internet via your
> > interface of choice <raspberrypi2.ttyUSB0> <--> <proprietary equipment>
> > 
> > The software you want on the linux systems is socat or netcat and
> > should be part of any modern distribution, though not installed by
> > default. For this to work, your windows software shouldn't do
> > anything fancy with the status lines of RS232.
> > 
> > Any raspberry pi is grossly oversized for the task, so feel free to
> > search for something smaller and cheaper.
> > 
> > This
> > https://stackoverflow.com/questions/484740/converting-serial-port-data-to-tcp-ip-in-a-linux-environment
> > might give some hints concerning how to use the software.

> I was thinking about this solution, I see two drawbacks:

> * The user PC, that is already connected to Internet, must be equipped 
> with an additional box that must be connected to Internet

> * Linux doesn't know anything about the serial port settings (baudrate, 
> parity, and so on). The user should know the settings used by the 
> third-party application and set them in the Linux box.
Very well observed. To overcome these drawbacks, you will need two
pieces of software, one on each end, that communicate the RS232 port 
status in addition to RX and TX. I can't help with that, since I 
never used or needed a virtual com port driver of that kind.

-- 
A. Erhardt

[toc] | [prev] | [next] | [standalone]


#32092

FromDavid Brown <david.brown@hesbynett.no>
Date2023-11-27 09:44 +0100
Message-ID<uk1kuc$3mohs$1@dont-email.me>
In reply to#32090
On 27/11/2023 08:55, pozz wrote:
> I have a proprietary device with a RS232 port controlled by a Windows 
> application that opens a standard COM port.
> 
> Now I need to move the device in a remote position with Internet 
> connection. The user (and the Windows PC) will be in a different position.
> 
> I want to develop an embedded Linux box with RS232 port connected to the 
> device and Internet.
> 
> I know there are many commercial solutions, but before I'd search for an 
> open-source solution, if any. Here the big issue is the virtual COM 
> driver for Windows.
> 
> It's not a one-piece scenario, so it makes sense to develop my embedded 
> box that solves this problem. Moreover, I would stay generic regarding 
> RS232 baudrates, parity and so on.

If you need to be able to set baud rates from the PC app as though it 
were a normal COMs port, then you need to start by finding a virtual COM 
driver solution and work from there.  On the Linux side, connecting a 
tcp/ip port to a serial port should be simple - depending on your needs 
it can be anything from a netcat with stdio and stdout redirections, to 
a small server program that can handle multiple connections, multiple 
ports, etc.

But google first for the virtual comms port or redirector on the Windows 
side - that's the hard part.  I'd expect the documentation for such 
virtual comms ports to come with suggestions for the Linux side.

[toc] | [prev] | [next] | [standalone]


#32093

FromPaul Rubin <no.email@nospam.invalid>
Date2023-11-27 02:12 -0800
Message-ID<87zfyz5wu9.fsf@nightsong.com>
In reply to#32090
pozz <pozzugno@gmail.com> writes:
> It's not a one-piece scenario, so it makes sense to develop my
> embedded box that solves this problem. Moreover, I would stay generic
> regarding RS232 baudrates, parity and so on.

Do you have a question?  Why is a box needed?  I've used PySerial in
Python programs on Linux for stuff like that.  It communicates ok with
some pretty weird RS232 hardware.  The details escape me but I remember
I did have to patch the library for some reason.  The patch was pretty
simple and I believe the author merged it.

[toc] | [prev] | [next] | [standalone]


#32097

Frompozz <pozzugno@gmail.com>
Date2023-11-28 08:38 +0100
Message-ID<uk45ec$6esl$2@dont-email.me>
In reply to#32093
Il 27/11/2023 11:12, Paul Rubin ha scritto:
> pozz <pozzugno@gmail.com> writes:
>> It's not a one-piece scenario, so it makes sense to develop my
>> embedded box that solves this problem. Moreover, I would stay generic
>> regarding RS232 baudrates, parity and so on.
> 
> Do you have a question?  Why is a box needed?  I've used PySerial in
> Python programs on Linux for stuff like that.  It communicates ok with
> some pretty weird RS232 hardware.  The details escape me but I remember
> I did have to patch the library for some reason.  The patch was pretty
> simple and I believe the author merged it.

The application that opens the serial port runs on Windows and can't be 
changed.

[toc] | [prev] | [next] | [standalone]


#32094

FromTheo <theom+news@chiark.greenend.org.uk>
Date2023-11-27 10:58 +0000
Message-ID<Vsx*r2rwz@news.chiark.greenend.org.uk>
In reply to#32090
pozz <pozzugno@gmail.com> wrote:
> I know there are many commercial solutions, but before I'd search for an 
> open-source solution, if any. Here the big issue is the virtual COM 
> driver for Windows.
> 
> It's not a one-piece scenario, so it makes sense to develop my embedded 
> box that solves this problem. Moreover, I would stay generic regarding 
> RS232 baudrates, parity and so on.

So the main problem is not provision of the internet link (which can be done
a dozen ways) but conveyance of the serial port settings?

In other words, it's easy to make a transparent link that sends a fixed
115200 8N1 all day long, but what you want is to pick up that the
application set it to 31250 7E2, send that message to the other end, which
configures its UART to match?

In the latter case you either have to hook into the COM driver to get that
information, or do some detection to try to deduce the settings of the
bitstream the PC is sending you, which is potentially error prone (not sure
how to tell between 7E2 and 8N2, for example).

I note that are open source virtual COM drivers like:
https://com0com.sourceforge.net/
and that has 'com2tcp' which sounds a bit like what you want.  The project
is ancient though, so not sure of status on modern Windows.

(once in TCP, I'd tunnel it over SSH port forwarding so you can restrict
access to those with appropriate keys)

Theo

[toc] | [prev] | [next] | [standalone]


#32101

Fromchrisq <devzero@nospam.com>
Date2023-11-28 13:07 +0000
Message-ID<uk4omq$9hfe$1@dont-email.me>
In reply to#32090
On 11/27/23 07:55, pozz wrote:
> I have a proprietary device with a RS232 port controlled by a Windows 
> application that opens a standard COM port.
> 
> Now I need to move the device in a remote position with Internet 
> connection. The user (and the Windows PC) will be in a different position.
> 
> I want to develop an embedded Linux box with RS232 port connected to the 
> device and Internet.
> 
> I know there are many commercial solutions, but before I'd search for an 
> open-source solution, if any. Here the big issue is the virtual COM 
> driver for Windows.
> 
> It's not a one-piece scenario, so it makes sense to develop my embedded 
> box that solves this problem. Moreover, I would stay generic regarding 
> RS232 baudrates, parity and so on.

Why not use a single port terminal server, rs232 <-> lan ?. Used a lot
here in the lab to get serial port kit onto the network. Typical type
is the Patton 2120, though that model has probably been replaced now.
Startech and Moxa build those as well, various types and capabilities,
including windows port compatability

Don't need a complete system to do that, gross overkill...

Chris

[toc] | [prev] | [standalone]


Back to top | Article view | comp.arch.embedded


csiph-web