Giter Site home page Giter Site logo

zinen / docker-alpine-pigpiod Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 8.0 114 KB

Base for a tiny docker image containing pigpio. Aims to support all models of raspberry pi.

Home Page: https://hub.docker.com/repository/docker/zinen2/alpine-pigpiod

License: MIT License

Shell 45.34% Dockerfile 54.66%
pigpiod raspberry-pi alpine docker-image pigpio-release

docker-alpine-pigpiod's People

Contributors

2m avatar zinen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-alpine-pigpiod's Issues

RPi4 64-bit

Hi,
thank you for your work, in concept it should be all I need.

To put you on context, I'm using a 64-bit OS (Ubuntu Server 20) on my Raspberry Pi 4, 4Gb and need to control the GPIO remotely. Preferably, using a docker container would be ideal. I have tried a couple of things that I would like to share:

  1. Directly using this instructions on the host OS made it possible to remotely control de GPIO. This tells us that is not a host OS related issue.

  2. Adapting you Dockerfile to use ubuntu as it's base image

# Based on Alpine, a tiny linux distribution
FROM ubuntu as builder
# Install basic package to compile source code
#RUN apk add alpine-sdk
RUN  apt-get update \
  && apt-get install -y wget unzip build-essential
# Follow the install guide from creator of pigpio, http://abyz.me.uk/rpi/pigpio/download.html
RUN wget --output-document=download.zip https://github.com/joan2937/pigpio/archive/master.zip \
# Downloaded content is placed inside specific folder to not be depended of branch naming from repo
    && mkdir download \
    && unzip -d download download.zip \
    && cd /download/* \
# Fix for compiling on Alpine, https://github.com/joan2937/pigpio/issues/107
    #&& sed -i -e 's/ldconfig/echo ldconfig disabled/g' Makefile \
    && make \
    && make install
# Start of new base image
FROM ubuntu
LABEL maintainer="[email protected]"
COPY --from=builder /usr/local /usr/local
# Copy app into image
COPY start.sh /start.sh
# Make sure file has execution permission
RUN chmod +x /start.sh
# Start app
CMD /start.sh

gave the following error (using or not the --privileged flag)

Checking who is listening/bound to port 8888 ...
/start.sh: 4: netstat: not found
...OK, no process is listing/bound to port 8888
Starting daemon pigpiod ...
pigpiod: error while loading shared libraries: libpigpio.so.1: cannot open shared object file: No such file or directory
... daemon stopped unexpectedly.
netstat -tlep | grep 8888
/start.sh: 24: netstat: not found
sleeping for 20 sec - we hope that this releases the bound TCP port 8888
end of sleep
netstat -tlep | grep 8888
/start.sh: 29: netstat: not found
... start.sh terminated

What should we try next?

Raspberry Pi 2 Model B V1.1 issue

Doesn't work on Raspberry Pi 2 Model B V1.1:

localhost:~# docker run -it -p 8888:8888 --device /dev/gpiochip0 zinen2/alpine-pigpiod:latest
Unable to find image 'zinen2/alpine-pigpiod:latest' locally
latest: Pulling from zinen2/alpine-pigpiod
e14425cf8fb9: Pull complete
aa5bf1b6f601: Pull complete
97ec19dce31d: Pull complete
4f4fb700ef54: Pull complete
62689cf4fe6a: Pull complete
Digest: sha256:9a73f9843e499bbf3d6d6fd3ef0ab661761349d650498dd4df2f01b9499ec7af
Status: Downloaded newer image for zinen2/alpine-pigpiod:latest
Checking who is listening/bound to port 8888 ...
...OK, no process is listing/bound to port 8888
Starting daemon pigpiod ...
2023-11-26 15:00:42 initCheckPermitted:
+---------------------------------------------------------+
|Sorry, you don't have permission to run this program.    |
|Try running as root, e.g. precede the command with sudo. |
+---------------------------------------------------------+


Can't initialise pigpio library
... daemon stopped unexpectedly.
netstat -tlep | grep 8888
sleeping for 20 sec - we hope that this releases the bound TCP port 8888
end of sleep
netstat -tlep | grep 8888
... start.sh terminated
localhost:~#

With --privileged

localhost:~# docker run -it -p 8888:8888 --privileged zinen2/alpine-pigpiod
Unable to find image 'zinen2/alpine-pigpiod:latest' locally
latest: Pulling from zinen2/alpine-pigpiod
e14425cf8fb9: Pull complete
aa5bf1b6f601: Pull complete
97ec19dce31d: Pull complete
4f4fb700ef54: Pull complete
62689cf4fe6a: Pull complete
Digest: sha256:9a73f9843e499bbf3d6d6fd3ef0ab661761349d650498dd4df2f01b9499ec7af
Status: Downloaded newer image for zinen2/alpine-pigpiod:latest
Checking who is listening/bound to port 8888 ...
...OK, no process is listing/bound to port 8888
Starting daemon pigpiod ...
2023-11-26 15:05:43 initPeripherals: mmap gpio failed (Invalid argument)
Can't initialise pigpio library
... daemon stopped unexpectedly.
netstat -tlep | grep 8888
sleeping for 20 sec - we hope that this releases the bound TCP port 8888
end of sleep
netstat -tlep | grep 8888
... start.sh terminated
localhost:~#

Add Raspberry Pi 2 to tested platforms

I'm running zinen2/alpine-pigpiod:latest for several weeks succeccfully on a Raspberry Pi 2 Model B.

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
zinen2/alpine-pigpiod                latest              3b373427f9b0        17 months ago       5.05MB
$ dpkg --list|grep pigpiod
ii  pigpiod                         1.71-0~rpt1                         armhf        Client tools for Raspberry Pi GPIO control

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.