Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usable for docker container? #79

Closed
jaqua opened this issue Oct 6, 2018 · 3 comments
Closed

Usable for docker container? #79

jaqua opened this issue Oct 6, 2018 · 3 comments

Comments

@jaqua
Copy link

jaqua commented Oct 6, 2018

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
Copy link
Author

jaqua commented Oct 7, 2018

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

@chriskinsman
Copy link
Contributor

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

@bdsoha
Copy link

bdsoha commented Sep 16, 2021

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

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

  • /sys/class/gpio
  • /sys/devices/platform/soc
  • /dev/gpiomem
  • /proc/device-tree
  • /sys/firmware/devicetree/base

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants