Screen, minicom, picocom passthrough

Hi,

I really sorry about this edge case question. I am a home user playing with some fun network gear. I have a new 24 port switch that has a serial port. I have connected the serial port to my ubuntu server but the lag when I ssh to the server then to the tty to the switch is unmanageable. I have connected it to my (15 year old) HP Probook with ubuntu, I can download and install screen and picocom and serial into the switch no lag.

But that machine is really for something else in a fixed location in a different room. I want to use my framework running bluefin.

Since it is a immutable, I can’t install these packages. So instead I use os-tree, but I have ‘error: while applying overrides for pkg screen : Could not find group ‘screen’ in group file’. I thought install would set that up? I did install as sudo, is this immutability?

I tried using toolbox, and DID install successfully!! but I can’t find a way to pass /dev/ttyUSB0 through to the toolbox, like you can with host-networking. I always get “ [screen is terminating] “. I can’t confirm I can access /dev/ttyUSB0 in the toolbox.

Out of toolbox, in the terminal - can’t change groups - is that an immutable thing? what’s the standard practice for doing groups on immutable? I tried adding my user to dialout group, but it failed silently and didn’t stick. not on reboot either.

In the toolbox it is mutable so I can install, but don’t have hardware passthrough, so can’t use screen/picocom. (toolbox is like a 230mb download, so I can run a handful of console programs that are less that a mb? is toolbox like a VM-like thing or mountable image or something? Lot of overhead for small package?)

what am I missing. Sure I am ‘holding it wrong’, how do you serial console in bluefin?

1 Like

I’ve had this problem before too. You have to create a udev rule to allow the USB serial device to be accessed by your regular user. This is so that you can run minicom/picom inside a toolbox or distrobox container. See if the following works for you.

Create a udev rule on the host for usb serial devices. For the OWNER value, put your regular username.

cat << EOF | sudo tee /etc/udev/rules.d/50-usb-serial.rules
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", OWNER="user"
EOF

Reload udev.

sudo udevadm control --reload-rules
sudo udevadm trigger

Check the output of the following command to see if the serial device is owned by your user.

ls -l /dev/ttyUSB0

You should now be able to access the serial device from inside a toolbox or distrobox container. You don’t need to be root.

minicom -D /dev/ttyUSB0
1 Like

I used vim to make that new file. I can’t seem to make the command line write that file that way. I have used that structure before, but seem not to work today.

reload rules and ‘trigger’

I have only /dev/ttyX, but no /dev/ttyUSBX.

I will have a play with it though, see what I can find.

Thanks for coming back to me.

Ok this did work.

Once plugged in then /dev/ttyUSB0 is auto populated. You can now use screen and picocom from the toolbox without ‘passthru’. Exactly as you say.

I don’t know anything about udev, one to go and read up on. Thank you again.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.