jackw01 / led-control

Advanced WS2812/SK6812 RGB/RGBW LED controller with on-the-fly Python animation programming, web code editor/control interface, 1D, 2D, and 3D display support, and E1.31 sACN support
https://jackw01.github.io/led-control/
MIT License
162 stars 35 forks source link

Add python 3.8 devcontainer #24

Closed ohthehugemanatee closed 2 years ago

ohthehugemanatee commented 2 years ago

Add a dev container definition, so visual studio code users automatically get an isolated environment in which to work.

I would go ahead and address #8 at the same time, but I'm not sure what system capabilities or devices we need to access to use the GPIO pins.

Macleykun commented 2 years ago

Add a dev container definition, so visual studio code users automatically get an isolated environment in which to work.

I would go ahead and address #8 at the same time, but I'm not sure what system capabilities or devices we need to access to use the GPIO pins.

Given this article: https://blog.hypriot.com/post/drive-neopixels-in-docker/ I believe this argument into run should make it work: docker run --privileged -d node-neopixel

ohthehugemanatee commented 2 years ago

yes, it would work, but that's giving the container root privileges. Usual practice is to use --device, --cap-add, and --cap-drop flags to grant specific linux capabilities or devices. See docker documentation for the list of capabilities included by default and which ones you need to add manually. I just don't know the underlying python module well enough to know what capabilities/devices it needs to communicate with GPIO.

Macleykun commented 2 years ago

Perhaps --device /dev/gpiomem? https://misterderpie.com/posts/rasperry-pi-four-dht-docker/#:~:text=the%20container%20with-,/dev/gpiomem,-as%20a%20device https://forums.raspberrypi.com/viewtopic.php?t=243166#:~:text=fd%20%3D%20open%20(%22-,/dev/gpiomem,-%22%2C%20O_RDWR%20%7C%20O_SYNC%20%7C%20O_CLOEXEC)%20)%3B%0A%0A//%20Set