Accessing GPIO from Ubuntu Server 16.04 w/snap

I am trying to create a snap that I can install that accesses gpio. I have tried all combinations of things and I cannot seem to make it work.

In devmode confinement it works but obviously logs a lot because the gpio is for controlling LEDs and they are being cycled often.

I am using core18 as a base. I have gpio and gpio-control listed as interfaces. When I connect the gpio-control (sudo snap connect snapname:gpio-control) it executes without issue but I still cannot access the gpio.

The only resources I can find online are basically references (more or less) to the Raspberry Pi with Ubuntu Core. That is our eventual goal but at the moment we don’t have that luxury and are instead trying to migrate a little bit at a time.

Can anyone provide assistance or references to help with this?

Thanks.

you would need a classic image with gadget snap pre-installed, GPIO interface slots are currently only provided by gadgets …

this is a very complex task, i’d rather recommend to simply start with the pi if that is your taget anyway …

Sorry, pi is not target. A custom Ubuntu Core with our kernel/gadget snaps on our hardware is the goal. But that is an effort that is just starting and we needed this today-ish.

1 Like

Did you get around that ? We are using snapd on yocto (Hardware: CM4 and Nvidia Jetson). And need to access the GPIO pins as well. I wonder if a new interface, that allows blanket access to all GPIO pins would be the way to go ?