How to proceed?
Then you need to setup something listening on a known IP addr/TCP port,
which invokes the "cu" utility to talk to the /dev/ttyXX port.
The Raspberry4 board has 6 native uart
How to proceed?
The Raspberry4 board has 6 native uart
I'm not talking about serial ports via usb but uart on the gpio
connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that, communicating with the control computer via ethernet, would allow the computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry
So it will be necessary to program the Raspberry so that it has a tcp /
ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the Raspberry
How to proceed?
The Raspberry4 board has 6 native uart I'm not talking about serial
ports via usb but uart on the gpio connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that, communicating with the control computer via ethernet, would allow the computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry So it will be necessary to program the Raspberry so
that it has a tcp /
The last Serial USB adapter I bought came from PicAxe, where they're used
to upload PIC binaries to a PICAXE chip and/or to let the program you uploaded to the PICAXE chip talk to a program on your Linux box. They
work just fine if that's a Pi too.
PICAXE http://www.picaxe.com/ sell adaptors for £12.49 (VAT incl) +
postage:
https://picaxe.com/hardware/cables/picaxe-usb-download-cable/
I'm certain they're available elsewhere too, but that's where I bought
the last one I needed.
RobertoA <amorosik@tiscalinet.it> writes:
The Raspberry4 board has 6 native uart
I didn't actually know that but so it is. One or two may be in use by default.
So it will be necessary to program the Raspberry so that it has a tcp
/ ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the
Raspberry
How to proceed?
I can't help with the Windows part and it's really off topic here. On
the RPi side you can use netcat to listen to a tcp port and forward data
to serial and vice versa.
The Raspberry4 board has 6 native uart
So it will be necessary to program the Raspberry so that it has a tcp
/ ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the Raspberry
How to proceed?
So it will be necessary to program the Raspberry so that it has a tcp /
ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the Raspberry
Ignore the gpio lines: Just get a standard a USB-serial adapter. Each >supports a single serial line, so get one for each device with a serial
port that you need to connect to the Pi and either plug them directly
into the Pi or, if you run out of USB ports, via a USN connector block.
On Wed, 30 Dec 2020 18:31:07 -0000 (UTC), Martin Gregorie <martin@mydomain.invalid> declaimed the following:
Ignore the gpio lines: Just get a standard a USB-serial adapter. Each >>supports a single serial line, so get one for each device with a serial >>port that you need to connect to the Pi and either plug them directlyThat doesn't answer the OP's actual request -- they want the ports physically on the R-Pi to be VISIBLE on the host (desktop/laptop)
into the Pi or, if you run out of USB ports, via a USN connector block.
computer that is connecting to the R-Pi.
It answers the first part of his problem: getting signals to and from a
user process to a D-9 or D-25 serial port without having to build
something on a GPIO expansion card.
It answers the first part of his problem: getting signals to and from a
user process to a D-9 or D-25 serial port without having to build
something on a GPIO expansion card.
RobertoA <amorosik@tiscalinet.it> writes:
The Raspberry4 board has 6 native uart
I didn't actually know that but so it is. One or two may be in use by default.
I can't help with the Windows part and it's really off topic here. On
the RPi side you can use netcat to listen to a tcp port and forward data
to serial and vice versa.
On a hardware level you'll need a level shifter to convert the PI's
RX/TX pins from 3.3V TTL to +/- 12V e.g.
Ignore the gpio lines: Just get a standard a USB-serial adapter.
Have a look at Conserver:
https://en.wikipedia.org/wiki/Conserver
That doesn't answer the OP's actual request -- they want the ports physically on the R-Pi to be VISIBLE on the host (desktop/laptop) computer that is connecting to the R-Pi.
Unfortunately, that likely means a commercial $$$ ($260) package
A 5-pack of TTL<>RS232 level shifters is available for only $6 via
Amazon (US).
SparkFun has one that includes the DB-9 connector for $16 https://www.sparkfun.com/products/449 Other than running wires between the R-Pi and the unit there isn't much to "build" (and this one likely can be mounted in a suitable hole in a chassis).
Look at replies by Theo and Jim.
Den 2020-12-30 kl. 16:19, skrev RobertoA:
The Raspberry4 board has 6 native uart
How to proceed?
with virtual ports you need commercial drivers.
I once did a mapping tcp-port <-> serail port in tcl
ran in a _very_ busy warehouse translating stacker crane protcol
(3964rk512)
it ran 12 serial port on an XP at that time (now - new plcs with tcp/ip
are installed)
it basically looked like
proc accept {sock addr port} {
dbg "[gettime] -> start accept from $addr"
if { ! [string equal $addr $::client_ip]} {
dbg "[gettime] -> wrong client, got '$addr' but accepts only from '$::client_ip'"
catch {close $::ss}
catch {close $sock}
set ::done 1 ;# signal to main loop to let go
return
}
set ::my_sock $sock
set ::my_com [open $::tty {RDWR}]
# Read channels w/o buffering and in binary mode
fconfigure $::my_sock -buffering none -translation binary
fconfigure $::my_com -mode $::mode -buffering none -translation binary
# Setup handler for communication on the channels
fileevent $::my_sock readable [list pass_through $::my_sock $::my_com]
fileevent $::my_com readable [list pass_through $::my_com $::my_sock]
# make sure noone else connects while a session in running
catch {close $::ss}
dbg "[gettime] -> stop accept"
}
loop to reopen the listening socket when connection down
while {1} {
dbg "[gettime] -> Start listening"
set ss [socket -server accept $port]
vwait done ; # wait until the connection is closed
# clean up after session
dbg "[gettime] -> Close this session"
catch {close $::my_com}
catch {close $::my_sock}
}
there where som config files and some whitelist involved as well, but
above is the essence of it
its usefull, if you connect the pi with your serial device, and the
conect the PC to the pi via a simple socket.
Andy Burns <usenet@andyburns.uk> wrote:
On a hardware level you'll need a level shifter to convert the PI's
RX/TX pins from 3.3V TTL to +/- 12V e.g.
No. He said uart, never mentioned rs232.
On Wed, 30 Dec 2020 16:19:56 +0100, RobertoA wrote:
The Raspberry4 board has 6 native uart I'm not talking about serialIgnore the gpio lines: Just get a standard a USB-serial adapter. Each supports a single serial line, so get one for each device with a serial
ports via usb but uart on the gpio connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that,
communicating with the control computer via ethernet, would allow the
computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry So it will be necessary to program the Raspberry so
that it has a tcp /
port that you need to connect to the Pi and either plug them directly
into the Pi or, if you run out of USB ports, via a USN connector block.
The ones I've used have all presented a common interface to Linux:
plugging one in on a Pi automatically creates a new serial device, /dev/ ttyUSBnn IIRC, that behaves exactly like one of the predefined serial
ports (/dev/ttynn) that are created at boot time on a PC with builot-in serial ports. This means that any program using the standard Linux serial port library routines can read and write to anything connected to your Pi
via a USBserial adapter. It can also set the baud rate, character size, parity and stop bits.
The last Serial USB adapter I bought came from PicAxe, where they're used
to upload PIC binaries to a PICAXE chip and/or to let the program you uploaded to the PICAXE chip talk to a program on your Linux box. They
work just fine if that's a Pi too.
PICAXE http://www.picaxe.com/ sell adaptors for £12.49 (VAT incl) +
postage:
https://picaxe.com/hardware/cables/picaxe-usb-download-cable/
I'm certain they're available elsewhere too, but that's where I bought
the last one I needed.
RobertoA wrote:
The Raspberry4 board has 6 native uart
I'm not talking about serial ports via usb but uart on the gpio
connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that,
communicating with the control computer via ethernet, would allow the
computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry
So it will be necessary to program the Raspberry so that it has a tcp /
ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the
Raspberry
How to proceed?
I built one Rs323 to RS232 adapter during the first lock down this year. I had this project on my todo list since 3-4years already. I connect it to
the GPIO pins and have a serial console, where I can see exactly
everything. It works great. It helped me debug and setup the TFTP boot. But of course you can also buy a ready to use one. Pay attention on the chipset and manufacturer. There is tons of fake and buggy crap out there. There are also Serial to IPv4 converters, so that you can access your serial port via internet. AFAIR they are RS232 (12V) so perhaps a TTL level shifter
(323-232) and a Serial to IPv4 is what you are looking for.
I am not aware of any additional software (besides setting up the serial
port on the RPI4)
On Wed, 30 Dec 2020 18:31:07 -0000 (UTC), Martin Gregorie <martin@mydomain.invalid> declaimed the following:
Ignore the gpio lines: Just get a standard a USB-serial adapter. Each
supports a single serial line, so get one for each device with a serial
port that you need to connect to the Pi and either plug them directly
into the Pi or, if you run out of USB ports, via a USN connector block.
That doesn't answer the OP's actual request -- they want the ports physically on the R-Pi to be VISIBLE on the host (desktop/laptop) computer that is connecting to the R-Pi.
Unfortunately, that likely means a commercial $$$ ($260) package (which may not be available for ARM architecture). https://www.eltima.com/products/com-port-redirector/ {STRIKE my parenthetical: "Linux version for ARM-based devices is available. Now you
can share serial ports on ARM devices or connect to remote devices. Note:
you need D-Bus to be installed on your device to use this version."}
Hmmm... https://wiki.eltima.com/software-licenses/trial-version-eula.html
On 2020-12-30, Anssi Saari <as@sci.fi> wrote:
RobertoA <amorosik@tiscalinet.it> writes:
The Raspberry4 board has 6 native uart
I didn't actually know that but so it is. One or two may be in use by
default.
So it will be necessary to program the Raspberry so that it has a tcp
/ ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the
Raspberry
How to proceed?
I can't help with the Windows part and it's really off topic here. On
the RPi side you can use netcat to listen to a tcp port and forward data
to serial and vice versa.
Serial to tcp servers for linux already exist. Try looking at the
package ser2net - I'm sure there others.
Il 31/12/2020 03:02, A. Dumas ha scritto:serial-server-uart-ethernet.125040/
Andy Burns <usenet@andyburns.uk> wrote:Rs232 electric level in not necessary Conversion ttl-rs232 is not
On a hardware level you'll need a level shifter to convert the PI's
RX/TX pins from 3.3V TTL to +/- 12V e.g.
No. He said uart, never mentioned rs232.
necessary Gpio port of Rasperry is connected directly with other 3v3 electronic boards The part for me obscure, is how to use Raspberry uart
port for communication via tcp ethernet line The second big question is
how to use for a 'virtual com port' on Windows side, that mus
communicate with Raspberry board Please see the following link
https://www.b4x.com/android/forum/threads/raspberry-how-to-realize-a-
Il 31/12/2020 11:29, Andy Burns ha scritto:
A. Dumas wrote:
Look at replies by Theo and Jim.
Does conserver provide a Windows COMx: driver? I didn't see one ...
What do you mean when you refer to 'conserver'?
A. Dumas wrote:
Look at replies by Theo and Jim.
Does conserver provide a Windows COMx: driver? I didn't see one ...
Rs232 electric level in not necessary
Conversion ttl-rs232 is not necessary
Gpio port of Rasperry is connected directly with other 3v3 electronic
boards
The part for me obscure, is how to use Raspberry uart port for
communication via tcp ethernet line
The second big question is how to use for a 'virtual com port' on
Windows side
Il 30/12/2020 19:31, Martin Gregorie ha scritto:
On Wed, 30 Dec 2020 16:19:56 +0100, RobertoA wrote:Why ignore the uarts provided on the gpio connector?
The Raspberry4 board has 6 native uart I'm not talking about serialIgnore the gpio lines: Just get a standard a USB-serial adapter. Each
ports via usb but uart on the gpio connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that,
communicating with the control computer via ethernet, would allow the
computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry So it will be necessary to program the Raspberry so
that it has a tcp /
supports a single serial line, so get one for each device with a serial
port that you need to connect to the Pi and either plug them directly
into the Pi or, if you run out of USB ports, via a USN connector block.
The ones I've used have all presented a common interface to Linux:
plugging one in on a Pi automatically creates a new serial device,
/dev/ ttyUSBnn IIRC, that behaves exactly like one of the predefined
serial ports (/dev/ttynn) that are created at boot time on a PC with
builot-in serial ports. This means that any program using the standard
Linux serial port library routines can read and write to anything
connected to your Pi via a USBserial adapter. It can also set the baud
rate, character size, parity and stop bits.
The last Serial USB adapter I bought came from PicAxe, where they're
used to upload PIC binaries to a PICAXE chip and/or to let the program
you uploaded to the PICAXE chip talk to a program on your Linux box.
They work just fine if that's a Pi too.
PICAXE http://www.picaxe.com/ sell adaptors for £12.49 (VAT incl) +
postage:
https://picaxe.com/hardware/cables/picaxe-usb-download-cable/
I'm certain they're available elsewhere too, but that's where I bought
the last one I needed.
A. Dumas wrote:
Look at replies by Theo and Jim.
Does conserver provide a Windows COMx: driver? I didn't see one ...
Martin Gregorie <martin@mydomain.invalid> wrote:
It answers the first part of his problem: getting signals to and from a
user process to a D-9 or D-25 serial port without having to build
something on a GPIO expansion card.
He. Never. Mentioned. D9, D25 or RS232. Stop living in 1975.
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that, communicating with the control computer via ethernet, would allow the computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry
So it will be necessary to program the Raspberry so that it has a tcp /
ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the Raspberry
How to proceed?
I cannot fully understand how to use the example code described, but it
seems to me very useful to realize what I would like to achieve
How to use this code on Raspberry board?
The description seems to be what I need
How do you get it?
Ok thanks, now I'm looking for ser2net
Ok thanks, now I'm looking for ser2net
It's in the RaspberryPi OS package system
RobertoA wrote:
The description seems to be what I need
How do you get it?
For example this here (UART TTL to Ethernet)
or read here https://www.virtual-serial-port.org/article/best-serial-over-ethernet-tools/
RobertoA wrote:
Rs232 electric level in not necessary
Conversion ttl-rs232 is not necessary
Gpio port of Rasperry is connected directly with other 3v3 electronic
boards
ok
The part for me obscure, is how to use Raspberry uart port for
communication via tcp ethernet line
That's the fairly easy part, as several people have linked different ways
The second big question is how to use for a 'virtual com port' on
Windows side
There are several bit of software that do half of what you want, but not
all of it e.g. look at com0com, maybe com2tcp does actually do what you need?
<http://com0com.sourceforge.net/com2tcp/ReadMe.txt>
On 12/30/20 8:19 AM, RobertoA wrote:
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that,
communicating with the control computer via ethernet, would allow the
computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry
Do you /need/ (raw) Ethernet specifically? Or are you simply wanting
the ability to use a physical serial port on one computer from another computer across a network (be it Ethernet, WiFi, PPP, etc.)?
So it will be necessary to program the Raspberry so that it has a tcp
/ ip server inside, which will pass the information to the uart ports
On the computer side it will be necessary to install programs to
'virtualize' the com port and connect it to the tcp / ip server on the
Raspberry
There is a standard that has been used in the past: RFC 2217 - Telnet
Com Port Control Option. It is an extension to the telnet protocol to
allow controlling various aspects about the serial port across the
network from the client.
How to proceed?
It's been about 15 years since I've used this. But the last time I did
so, I installed one of the handful of programs that supported RFC 2217
on a Linux machine, and a separate / independent client program on a
Windows VM that also supported RFC 2217. The client made a virtual COM
port on Windows that any program could use just like a physical COM
port. The only caveat was some programs didn't know how to deal with
COM ports numbered higher than 4.
Den 2020-12-31 kl. 21:38, skrev RobertoA:
I cannot fully understand how to use the example code described, but
it seems to me very useful to realize what I would like to achieve
How to use this code on Raspberry board?
Hmm, if you don't see that, then it is not for you.
Basically you adapt the code for your purposes.
You assign values to variables
port
client_ip if you want a white list - otherwise remove that if-section
tty
then add a dbg proc like (or remove calls to dbg)
proc dbg {what } {
puts $what
}
then you run it via tclsh (I think it is installed in raspbian else
sudo apt install tcl)
The filevent does the rest
But as others have pointed out - nc/netcat does the job as well
If you are not a programmer - then that is a better route.
If you needs are more special - then use something you can adapt
yourself - like above
On Thu, 31 Dec 2020 21:41:51 +0100, RobertoA wrote:
Il 30/12/2020 19:31, Martin Gregorie ha scritto:
On Wed, 30 Dec 2020 16:19:56 +0100, RobertoA wrote:Why ignore the uarts provided on the gpio connector?
The Raspberry4 board has 6 native uart I'm not talking about serialIgnore the gpio lines: Just get a standard a USB-serial adapter. Each
ports via usb but uart on the gpio connector of the Raspberry board
Having to control devices via uart (for example gps receivers,
electronic scales, etc.) it would be useful to create a device that,
communicating with the control computer via ethernet, would allow the
computer to 'see' the virtual com ports, corresponding to the uart of
the card Raspberry So it will be necessary to program the Raspberry so >>>> that it has a tcp /
supports a single serial line, so get one for each device with a serial
port that you need to connect to the Pi and either plug them directly
into the Pi or, if you run out of USB ports, via a USN connector block.
The ones I've used have all presented a common interface to Linux:
plugging one in on a Pi automatically creates a new serial device,
/dev/ ttyUSBnn IIRC, that behaves exactly like one of the predefined
serial ports (/dev/ttynn) that are created at boot time on a PC with
builot-in serial ports. This means that any program using the standard
Linux serial port library routines can read and write to anything
connected to your Pi via a USBserial adapter. It can also set the baud
rate, character size, parity and stop bits.
The last Serial USB adapter I bought came from PicAxe, where they're
used to upload PIC binaries to a PICAXE chip and/or to let the program
you uploaded to the PICAXE chip talk to a program on your Linux box.
They work just fine if that's a Pi too.
PICAXE http://www.picaxe.com/ sell adaptors for £12.49 (VAT incl) +
postage:
https://picaxe.com/hardware/cables/picaxe-usb-download-cable/
I'm certain they're available elsewhere too, but that's where I bought
the last one I needed.
Because a USB serial adapter is ready to run off the shelf and uses
standard RS-232 levels, character encoding, parity and stop bits on its serial side, which is compatible with most items with serial connections, e.g. puck-type GPS receivers.
The ones sold by PICAXE have the USP blug on the body with a serial cable terminated by a 3.5mm 3-wire jackplug. Most other converters seem to come with a D9 socket (male or female - you choose) on the converter body and
the USB plug on a short flying lead. Amazon has loads of them in the £7 - £15 price range.
Jim Jackson wrote:
Ok thanks, now I'm looking for ser2net
It's in the RaspberryPi OS package system
But I think he really wants com2tcp for windows instead of ser2net ?
Il 01/01/2021 22:28, Andy Burns ha scritto:
Jim Jackson wrote:
Ok thanks, now I'm looking for ser2net
It's in the RaspberryPi OS package system
But I think he really wants com2tcp for windows instead of ser2net ?
That's right, se2net on the Raspberry side and then on the Windows side
what do I put in it?
Il 01/01/2021 15:30, Björn Lundin ha scritto:
Den 2020-12-31 kl. 21:38, skrev RobertoA:
I understand the substance of the written code, what I can't do at the
moment is how to use it on Raspberry
What documents / tutorials to follow to understand how to use the sent
code?
When you talk about 'client program' exactly what are you referring to?
No particular protocol is required, the final goal is to be able to use
a Hyperterminal / Realterm type program on a Windows PC to read/write
on any of the 6 Raspberry4 uart boards
Since you imply plain text I/O, the simplest route would probably be to
SSH into the R-Pi, and then use a command line terminal program on the
R-Pi to connect to the specific UART(s) -- rather than try to create
a terminal server on the R-Pi exporting virtual com ports on Windows..
On 1/2/21 12:48 PM, Dennis Lee Bieber wrote:
Since you imply plain text I/O, the simplest route would probably be to
SSH into the R-Pi, and then use a command line terminal program on the
R-Pi to connect to the specific UART(s) -- rather than try to create
a terminal server on the R-Pi exporting virtual com ports on Windows..
This may be a simpler solution. But it often falls quite short of other >solutions. Particularly when software is running in a VM that needs to
serialport" operations.Note: GUI applications need not apply (though a custom application
But the OP explicitly stated the use of a simple terminal program (though HyperTerm is ancient and $$$, since the light version is no longer available on Windows... TeraTerm and PuTTY in serial connection mode might do).
How would the OP handle the 6 serial ports from this configuration?
Open 6 shell windows/xterm and run minicom/cu in each (I presume they
expect to receive some status back from the end devices in response to
any commands sent, otherwise a simple "echo command > serialport" would
maybe suffice and only use one shell window/xterm). Too messy? Open
one shell window/xterm with 6 tabs, each tab running minicom/cu.
Create a custom application (Python with wxPython/Python
GTK/Tkinter...) with input and response widgets, and [send] button?
* Don't have keyboard/mouse/monitor on the R-Pi?
Configure the R-Pi VNC server. Install VNC client on the Windows box.
Connect to R-Pi using VNC client.
One now has a window on the Windows box that looks just like the
monitor did in the previous option, and the same serial port handling
is available (minicom/cu in shell window/tab) or custom application.
Note: GUI applications need not apply (though a custom application
using text-only curses that handles all 6 serial ports at once is
feasible)
Run a web-server on the R-Pi (nginx?). Create a web-app (flask/django,
PHP?) which presents a form with 6 sections (one for each serial port,
each section has a command input field, and a response output field).
Creating VCPs seems fraught with difficulties.
Which leads us back to something like https://www.eltima.com/products/com-port-redirector/
(which, strangely, appears to be the same as https://www.eltima.com/products/serial-over-ethernet/ with a different
name). One runs server side on the R-Pi (suspect one has to build
from source, they likely don't have an ARMHF build), and client side
on Windows to create the VCPs.
Run a web-server on the R-Pi (nginx?). Create a web-app (flask/django,
PHP?) which presents a form with 6 sections (one for each serial port, each >section has a command input field, and a response output field).
The most basic form would require a submit button, probably using
"GET" and the web-app would extract the sent command(s), deliver them to
the corresponding ports, collect return status (timeout?), then >refresh/resend the form with now empty input fields but populated response >fields.
Better might be to have the form use AJAX to dynamically send
commands as entered, and receive responses for each port as they become >available, instead of undergoing full page refreshes.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 371 |
Nodes: | 16 (2 / 14) |
Uptime: | 36:57:45 |
Calls: | 7,932 |
Calls today: | 2 |
Files: | 12,998 |
Messages: | 5,805,537 |