I have installed the ubuntu core on a Raspberry3 and made a snap app about operating the rasp’s gpio pins.
But there will be an error ("RuntimeError: No access to /dev/mem. Try running as root!
" ) when I try to run the snap app.
The python file contains a very simple function, which is to turn the gpio pins on and off.
I try to solve it by the following command lines
" sudo adduser myusername gpio
sudo chown myusername /dev/gpiomem
sudo chmod g+rw /dev/gpiomem
emmmm… it made no sense.
So how can I solve the problem??? And what’i more ,why it happened???