-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Snap] Give add-ons access to serial ports #3152
Comments
The same will likely be true for the Z-Wave add-on too, since that also uses a serial connection. In order to access serial ports, a snap needs access to the serial-port interface. We can request this interface in snapcraft.yaml, but it is usually not connected by default so would require a user to manually connect the interface on the command line. We can request an exception in the snap store but it may not be granted. As I understand it on Ubuntu Core it also requires serial device paths to be hard coded in a gadget snap, unless using the experimental hotplug support, which is still marked as experimental and therefore can not be enabled by default. This may be a problem because the gateway supports multiple USB dongles. As I understand it the existing Raspbian image supports hotplug USB devices. |
as long as the zigbee devices are USB dongles (vs. actual sub-d attached serial devices) it should be possible to simply turn on hotplug support of the UbuntuCore image via a gadget.yaml setting (or simply tell the user to turn it on manually when used out of a pre-made image) ... could you try turning on hotplug on your test device and see if the dongle can be found or if we need to dig deeper here ... (perhaps hardware-observe or system-observe interfaces might be needed alongside and probably udevadm as a bundled binary, we'd need more logs here but i think this could be a viable way forward.) |
@ogra1 Thank you for the advice. I enabled hotplug with a Digi XStick (Zigbee dongle) and Aeotec Z-Stick (Z-Wave dongle) plugged in and saw the following:
So that's a good start. Oddly, when I disconnected the Aeotec Z-Wave dongle and plugged a Z-Wave dongle from Sigma Designs in its place, it was detected as aeotecz-stickgen5zw0 - so that's not ideal... But the obvious question is if a Looking at the source code of the Zigbee adapter add-on as a starting point, it appears to use the serialport npm package (and home-grown serial-prober package which builds on serialport to probe a serial port for certain vendor and product IDs). I have no idea what magic serialport uses on the back end, but it seems to support a lot of different architectures. Presumably to get USB dongles to connect dynamically at runtime on Ubuntu Core we would need some additional logic which automatically connects the serial-port plug to sockets as they appear. Is that even possible? FYI I'm already adding a |
May require the serial-port/raw-usb interface.
Currently the Zigbee add-on does not work...
STR:
Expected:
Actual:
Logs from /var/snap/webthings-gateway/current.webthings/log/run-app.log:
The text was updated successfully, but these errors were encountered: