Accessing serial ports via a snap on Ubuntu classic?

Hi all,

Over the weekend I started making a snap of a really old Java application for programming a universal IR remote. While I have been able to snap the application I can’t use it the snap because, as far as I can tell, I have no means to access serial ports from a snap installed on a classic system.

As it happens I don’t have any hardware with a physical RS-232 port so I’m using a USB to serial port adapter requiring access to /dev/ttyUSB[0-9] and the raw-usb interface isn’t suitable for that either.

While my ancient application is probably only of value to a handful of people these issues also effect the Node-RED snap, which has been in the beta channel for some months and the Node-RED team are reluctant to promote to candidate or stable because the snap is missing many essential capabilities that are provided by peripherals exposed via USB and serial ports.

Is supporting these use cases on the roadmap? If so, what is the anticipated delivery time frame?

1 Like

ATM you will have to build your own gadget to achieve this … iirc one of @kyrofa’s blog howtos covers this specific case …

EDIT: whoops, missed the “classic” in the subject … afaik on classic there is no way at all currently and on core, creating a custom gadget is the workaround … and AFAIK “hotplug” in interfaces is the solution (i am told)

Indeed, to the length of my knowledge it’s impossible to access serial ports under confinement while on classic Ubuntu. You need to use devmode, and then as @ogra says you need a custom gadget on Ubuntu Core. Since gadgets aren’t a thing on classic, you’re stuck waiting for the hotplug interface, which is currently planned but, as I understand it, unscheduled.

2 Likes