Using serialport inside strict snap confinement on Ubuntu #2981
Unanswered
benfrancis
asked this question in
Q&A
Replies: 1 comment
-
Ooh, I think I may have figured it out. I think it requires the Now the problem is that the user has to manually connect the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
tl;dr: Does anyone have experience of using the node-serialport library inside strict snap confinement on Ubuntu? If so, how did you get it to work?
I'm afraid this is a bit of a niche question but I'm working on packaging WebThings Gateway (an IoT gateway application) as a snap for use on Ubuntu Core. The gateway has installable add-ons for using different protocols, some of which use USB dongles. One of those add-ons is the Zigbee adapter add-on, which uses node-serialport (via serial-prober-node) to detect Zigbee USB dongles like the XStick.
By default strict snap confinement restricts access to serial ports, but this can be granted via the serial-port snap interface. I have tried manually connecting a serial-port plug of the gateway application to a slot for an XStick USB dongle which was automatically created by hotplug, but the Zigbee add-on fails to detect the dongle.
If I run the snap in devmode (disabling snap confinement) it can use the USB dongle without any problems, which suggests that the problem is due to snap confinement.
If I use snappy-debug to detect AppArmor denials whilst starting the gateway snap I see hundreds of AppArmor denials for files in /run/udev/data/ e.g.
If I filter those out I'm left with:
Does any of this look familiar to serialport developers? I'm looking for clues as to why I can't access the USB dongle from inside snap confinement.
See also: WebThingsIO/gateway#3152
Many thanks
Ben
Beta Was this translation helpful? Give feedback.
All reactions