WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 338 forks source link

[Snap] Give add-ons access to GPIO #3163

Open benfrancis opened 2 months ago

benfrancis commented 2 months ago

Some add-ons (e.g. the GPIO add-on) require access to GPIO ports.

Thus may require the gpio and/or gpio-control interfaces. I understand these interfaces are not usually connected by default.

dilyn-corner commented 1 week ago

One important thing to recognize about the GPIO interfaces is that they require a connection to the slot provider, and the system (snapd, core) are not the slot providers; the gadget snap is.

This means that the gadget snap needs to define the GPIO interfaces for your snap to connect to, see here for an example. This is true of most hardware interfaces (serial, pwm, i2c, etc).

And you are correct in saying these interfaces do not autoconnect by default. Generally, hardware interfaces are also super-privileged.