signalk-server
signalk-server copied to clipboard
[DOCKER][BUG] SeaTalk GPIO integration not working
Hello,
I was integrating a SeaTalk module to my docker signalk server, and I faced with this issue.
The python script is executed using the python -u -c '${cmd}' ${options.gpio} ${options.gpioInvert}
, but python is only aliased by python3, so it can't be loaded.
https://github.com/SignalK/signalk-server/blob/master/packages/streams/pigpio-seatalk.js
I fixed this using a custom Docker image:
FROM cr.signalk.io/signalk/signalk-server
USER root
RUN apt-get update
RUN apt-get install -y python3-pigpio
RUN apt-get install -y python-is-python3
USER node
python-is-python3 package does the trick.
Isn't this easiest to fix in pigpio-seatalk.js itself? To add test which python is installed and then use it.
Yes... this was a workaround/temporal solution.
I'm going to check if other modules use python
call too and prepare a PR.
@KEGustafsson after checking it further, pigpio
package isn't installed in the docker image... throwing ModuleNotFoundError: No module named 'pigpio'
Docker base image should be updated, maybe keeping python-is-python3
package is safer allowing to use both commands python | python3
You could add check which version of python is installed and if required packages are installed too and if not then install ones with pip. Once checked which python in use, then modify excutive part accordingly. To my understanding all changes can be done application level, no need to touch image.