Auto connect openHAB interfaces

Requests to auto connect interfaces for openHAB snap
snap listing: https://snapcraft.io/openhab
snap source: https://github.com/openhab/openhab-snap

Interfaces to consider for auto connection and rationel for it:

  • home
    • openHAB supports exporting and importing of configurations, those would usually stored in user’s home dir
  • mount-observe
    • openHAB service java runtime service ask as system information
  • system-observe
    • openHAB service java runtime, to adjust used resources based on system info
  • raw-usb
    • openHAB supports multiple zigbee, zwave USB dongles, those are typically access over serial interface.

+1 for mount-observe and system-observe.

home is auto-connected on classic but not on Ubuntu Core. Ubuntu Core will often not have login users, so can you describe typical use cases for why home needs to be auto-connected on core?

You said that raw-usb is needed for talking over the serial interface. Would an auto-connection for serial-port with greedy plugs be enough? If not, can you describe why?

Thanks for reply @jdstrand
We can skip home auto connect, as I realised we need to update it to all users anyway, so it form it is now it won’t work for purpose of backup/restore functionality anyway

raw-usb is a bit more tricky. Greedy plus could work, but we do not have hot plug enabled on public images, it’s still behind feature flag. And since we want to use this for appliance images, we will be using gadget snaps published by Canonical, and those do not have any slots for USB serial devices defined.
So unless there is clear plan when to remove hotplug experimental flag, I’m not sure how this could work.

@pstolowski - can you comment? It does seem like hotplug has been behind experimental for a while…

That said, it will be experimental for 2.45 and considering the use case of a Canonical gadget, there is no other path forward. It sounds like you’d prefer to use hotplug with greedy plugs if it were available, so raw-usb would be temporary until it is.

+1 for raw-usb. I already voted +1 for mount-observe and system-observe. The request for home was rescinded. @reviewers - can others please vote on raw-usb, mount-observe and system-observe?

+1 from me for auto-connect of raw-usb until greedy plugs are available, and +1 for mount-observe and system-observe for openhab. +2 votes for, 0 votes against, raw-usb, mount-observe and system-observe - this is now live.

Indeed. Truth be told we have received very little feedback regarding hotplug so far (partly because it’s behind the flag I suppose, and partly because serial-port interface is the only interface that supports it at the moment, so audience is limited). We have a couple of bugs reported so far and they need to be addressed before enabling hotplug by default, plus I think it would be nice to have more interfaces. There are also some usability aspects such as inspecting “remembered” devices and their association with hotplug slots (with snap cli) to address. I think we need to discuss priorities and allocate some time to work on it if we want it out of experimental phase.

I wonder if uio and iio would be good candidates. I believe Field could provide the necessary feedback. @ondra - it sounds like the snapd team needs people to comment on how well it is working and I know that your team wanted the feature; are there people on your team that can comment/file bugs/etc?