jperkin / node-rpio

Raspberry Pi GPIO library for node.js
858 stars 124 forks source link

Usable for docker container? #79

Closed jaqua closed 5 years ago

jaqua commented 5 years ago

I'm running some applications on my RPI via docker container. Is it possible to use node-rpio inside a docker container? Do I have to make some directories accessable or something like this?

jaqua commented 5 years ago

You have to add the device parameter: docker run -d --device /dev/gpiomem <image>

chriskinsman commented 4 years ago

@jaqua What base image are you using? I am hitting issues with missing /sys/device-tree on alpine

bdsoha commented 2 years ago

I am having an issue trying to run this on K8S.

In order to control the GPIO pins, I mapped the following host directories:

There is no issue running the following from within the container:

$ echo 21 >/sys/class/gpio/export
$ echo out >/sys/class/gpio/gpio21/direction
$ echo 1 >/sys/class/gpio/gpio21/value
$ echo 0 >/sys/class/gpio/gpio21/value

The package does not successfully detect the board and is always using a mock.