The ser2net daemon allows telnet and tcp sessions to be established with a unit's serial ports.
how could we call this service?
The ser2net daemon allows telnet and tcp sessions to be established with a unit's serial ports.
how could we call this service?
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | FEATURE REQUEST | c-po | T2490 Add serial (rs232) to ssh bridge service | ||
Resolved | FEATURE REQUEST | c-po | T2529 WWAN: migrate from ttyUSB device to new device in /dev/serial/by-bus | ||
Resolved | FEATURE REQUEST | c-po | T2624 Serial Console: fix migration script for configured powersave and no console | ||
Resolved | FEATURE REQUEST | c-po | T2560 New op-mode command to display information about USB interfaces |
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
[email protected]:~$ 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
[email protected]:~$ 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
Completion helper:
[email protected]# 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
In addition a show opmode command should be added to list all the USB serial stuff in a human friendly way