I've been trying to get the CEC-Client working inside docker, when not in the docker image I get this result:
No device type given. Using 'recording device'
CEC Parser created - libCEC version 4.0.7
no serial port given. trying autodetect:
path: Raspberry Pi
com port: RPI
opening a connection to the CEC adapter...
However inside the docker container I get this:
No device type given. Using 'recording device'
CEC Parser created - libCEC version 4.0.4
no serial port given. trying autodetect: FAILED
Below is a snip-it of my Dockerfile:
FROM arm32v7/python:3.10-buster
RUN apt-get update && apt-get upgrade
RUN apt-get install sudo fbi libcec-dev cec-utils -y
RUN apt-get update && apt-get install -y --no-install-recommends \
libcec-dev cec-utils make git build-essential pkg-config
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
Most of a docker file has to do with the python script I run, but I know all of that works. The only problem is with getting CEC to work, which I know is possible because it work in this old image https://hub.docker.com/r/blakeblackshear/rpi-hdmi-cec-rest/tags. However that dockerfile is very outdated so I can't replicate it, I also run the container with privileged and with the host flag.
In case anyone else runs into this specific problem, I managed to solve it by using a Docker base image of Debian BUSTER and using libCEC 4.x.x. I do not know which of these two was key but it now works.