Pigpio failing on lack of permissions using resin/raspberrypi3-node


#1

I’m having issues getting node package pigpio (which is a wrapper for pigpio in C) (I’m using the package to access GPIO pins) to run in a default Docker container running default resinOS resin/raspberrypi3-node (Pigpio GitHub issue here, Resin.io GitHub issue here).

Dockerfile:

FROM resin/raspberrypi3-node

RUN apt-get update && apt-get install -yq --no-install-recommends pigpio

RUN npm install pigpio

From running docker ( docker run -it name /bin/bash and then sudo pigpiod at shell as root - pigpiod is pigpio daemon):

2018-09-06 19:55:38 initCheckPermitted: 
+---------------------------------------------------------+
|Sorry, you don't have permission to run this program.    |
|Try running as root, e.g. precede the command with sudo. |
+---------------------------------------------------------+


root@1bd67dc5c6e4:/# Can't initialise pigpio library

I’m already running as root, and using sudo. I’ve tried changing docker run permissions ( --privileged and --cap-add=ALL ) and I get the same result. Same error running the daemon as if I try to use the pigpio node package in a script.


#3

Someone else has pigpio working using a different base image, so it might have something to do with resin/raspberry-pi3-node.


#5

Hi,

The docker link you mention mounted sys and mem inside the container.

docker run --privileged -u root -v /sys:/sys -v /dev/mem:/dev/mem ...

That is a security issue…
But perhaps pigpio needs those. Have you tried using a privileged container with those mounted in the right locations?

Regards
ZubairLK