Page MenuHomeVyOS Platform

Add serial (rs232) to ssh bridge service
Open, Requires assessmentPublicFEATURE REQUEST

Description

The ser2net daemon allows telnet and tcp sessions to be established with a unit's serial ports.

how could we call this service?

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

c-po claimed this task.Thu, May 21, 5:28 PM
c-po created this task.
c-po moved this task from Need Triage to Backlog on the VyOS 1.3 Equuleus board.
c-po renamed this task from Add ser2net service to Add serial (rs232) to ssh bridge service.Fri, May 22, 6:56 PM
c-po updated the task description. (Show Details)
Dmitry added a subscriber: Dmitry.Fri, May 22, 7:03 PM

Maybe set service serial-bridge?

c-po added a comment.Fri, May 22, 7:24 PM

A friend also thought about set service nettty for network tty (which it is infact)

pasik added a subscriber: pasik.Sat, May 23, 8:55 AM
c-po added a comment.Wed, May 27, 8:21 PM

During testing I've found that there is a well known problem (we had for ethernet interfaces) also in the serial ports. They can be enumerated and mapped to /dev/ttyUSBxxx differently from boot to boot. This is especially painful on my development APU4 board which also has a Sierra Wireless MC7710 LTE module installed which operates via ttyUSB2 (when no serial console cable is attached) - on subsequent boots this can become ttyUSB3 or depending on the number of FT232 dongles I attach.

I've found that there is a udev rule (/usr/lib/udev/rules.d/60-serial.rules) which partly solves this by enumerating the devices into /dev/serial/by-id folder with their name and serial number - it's a very good idea but I've found that not all of the FT232 dongles have a serial number programmed, this leads to the situation that when you plug in two cables with both having serial number 0 - only one device symlink will appear.

Proposed solution:
Derive /usr/lib/udev/rules.d/60-serial.rules and create a /dev/serial/by-bus directory and group devices by attached USB root port. The original /dev/serial/by-path directoy is not too user firendly, and a nice "abbreviation" must be found.

Also serial ports should no longer be supported by their ttyUSBxxx name (should be fixed by a migration script` and in general be referred to by the USB port they are connected to in the real world as this will only change if the user reseat the connector

vyos@vyos:~$ ls -al /dev/serial/by-path/
total 0
drwxr-xr-x 2 root root 260 May 27 22:14 .
drwxr-xr-x 4 root root  80 May 27 22:14 ..
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:1.4:1.0-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:1.4:1.1-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:1.4:1.2-port0 -> ../../ttyUSB2
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:1.4:1.3-port0 -> ../../ttyUSB3
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:2.4:1.0-port0 -> ../../ttyUSB4
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:2.4:1.1-port0 -> ../../ttyUSB5
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:2.4:1.2-port0 -> ../../ttyUSB6
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:10.0-usb-0:2.4:1.3-port0 -> ../../ttyUSB7
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:13.0-usb-0:1.3:1.0-port0 -> ../../ttyUSB8
lrwxrwxrwx 1 root root  13 May 27 22:14 pci-0000:00:13.0-usb-0:1.3:1.2-port0 -> ../../ttyUSB9
lrwxrwxrwx 1 root root  14 May 27 22:14 pci-0000:00:13.0-usb-0:1.3:1.3-port0 -> ../../ttyUSB10
c-po added a comment.Fri, May 29, 8:22 PM
vyos@vyos:~$ find /dev/serial/by-bus/ -name usb* -exec basename {} \; | sort
usb0b1.3p1.0
usb0b1.3p1.2
usb0b1.3p1.3
usb0b2.4p1.0
usb0b2.4p1.1
usb0b2.4p1.2
usb0b2.4p1.3

So we have usb root 0 with bus1.3 and port 1.0. The enumeration is constant accross reboots and only changes if you physically unplug devices

c-po added a comment.Fri, May 29, 8:36 PM

Completion helper:

vyos@vyos# set service ser2net device
Possible completions:
 > ttySxxx      Regular serial interface
 > usbxbxpx     USB based serial interface
 > ttyS0
 > ttyS1
 > ttyS2
 > ttyS3
 > usb0b1.3p1.0
 > usb0b1.3p1.2
 > usb0b1.3p1.3
 > usb0b2.4p1.0
 > usb0b2.4p1.1
 > usb0b2.4p1.2
 > usb0b2.4p1.3
c-po added a comment.Sat, May 30, 8:30 AM

In addition a show opmode command should be added to list all the USB serial stuff in a human friendly way