I've used the answer to this question to enable control of my Raspberry Pi GPIO pins from within a Docker container, which runs Alpine.
$ docker run --device /dev/gpiomem whatever
This works with the Python RPi.GPIO module, but not with wiringPi.
Python and its dependencies takes up about the same space as Alpine itself, so I'd like to use wiringPi to save on install time and SD card space, and to keep things simple.
Running wiringPi v2.46 in Raspbian directly (installed using apt-get install wiringpi
) works fine, and I can successfully configure and trigger digital output pins.
Running wiringPi v2.26 in the Alpine container (installed using apk add wiringpi
) fails when trying to configure a pin:
$ gpio -g mode 26 out
Unable to determine hardware version. I see: Hardware : BCM2835,
- expecting BCM2708 or BCM2709. Please report this to projects@drogon.net
Is there anything I can do to expose the SOC to the container, so that wiringPi recognises it correctly? What else might be required to get this working?