mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.7k stars 176 forks source link

Pi Zero W #294

Open socalcal opened 2 years ago

socalcal commented 2 years ago

Does this work on a Pi Zero W? I'm running a Homebridge image on a Pi Zero W and get this when trying to start the docker:

WARNING: The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/arm/v6) and no specific platform was requested
docker: Error response from daemon: driver failed programming external connectivity on endpoint priceless_heisenberg (b26b8e69144bd3d7fbb983d24e58deaddbcc27a8a2f1597cfa5f900d207298af): Error starting userland proxy: listen tcp6 [::]:8888: bind: address already in use.

So first issue is leading me to believe that v6 is not supported? Second issue is port 8888 is already being used by something else. I'm a follow-directions-and-install kind of guy so no idea what can be causing this issue. Not sure if it's the Homebridge image itself or another plug-in that I'm running. Any and all help appreciated. Thanks!

mrlt8 commented 2 years ago

I don't have an armv6 device to test on, but I added a dockerfile that should be able to build an image using the arm library (not sure if it will run on the v6 though).

You'll need to git clone or download the repo and create a docker-compose.yml file with something like this:

version: '2.4'
services:
    wyze-bridge:
        container_name: wyze-bridge
        build:
            context: ./app
            dockerfile: Dockerfile.armv6
        ports:
            - 1935:1935
            - 8554:8554
            - 8080:8888 # This will expose 8080 instead of 8888 for the HLS streams
        environment:
            - WYZE_EMAIL=${WYZE_EMAIL} # Replace with wyze email 
            - WYZE_PASSWORD=${WYZE_PASSWORD} # Replace with wyze password

you should then be able to run docker-compose up to build the container from the source.

You can also replace the - 8080:8888 line with whatever port you want or remove it if you don't need the HLS stream.

socalcal commented 2 years ago

So I found the Dockerfile.armv6 file, created the yml and when trying to build the container, I get:

Step 1/15 : FROM arm32v6/python:3.10-slim-buster as base
manifest for arm32v6/python:3.10-slim-buster not found: manifest unknown: manifest unknown
ERROR: Service 'wyze-bridge' failed to build : Build failed
mrlt8 commented 2 years ago

Unfortunately, it looks like there aren't any Debian-based python images available for armv6.

I'll still have another look to see if we might be able to do something else.

socalcal commented 2 years ago

Thanks. I appreciate it!

drone540 commented 2 years ago

I have attempted to Edit the Dockerfile to run on arm32v6 devices.

I have switched it to Alpine Linux.

DockerFile:

FROM arm32v6/python:3.10-alpine as base

FROM base as builder
ENV PYTHONUNBUFFERED=1
ARG LIB_ARCH=arm
ARG RTSP_ARCH=armv6
# ARG FFMPEG_ARCH=${ARM:+armv7l}
RUN apk add --no-cache \
    tar unzip curl jq g++

RUN pip3 install --disable-pip-version-check --prefix=/build/usr/local mintotp paho-mqtt requests pydantic xxtea
COPY *.lib /tmp/lib/
RUN mkdir -p /build/app /build/tokens /build/img \
    && curl -L https://github.com/homebridge/ffmpeg-for-homebridge/releases/latest/download/ffmpeg-alpine-armv6l.tar.gz \
    | tar xzf - -C /build \
    && RTSP_TAG=$(curl -s https://api.github.com/repos/aler9/rtsp-simple-server/releases/latest | jq -r .tag_name) \
    && echo -n $RTSP_TAG > /build/RTSP_TAG \
    && curl -L https://github.com/aler9/rtsp-simple-server/releases/download/${RTSP_TAG}/rtsp-simple-server_${RTSP_TAG}_linux_${RTSP_ARCH:-amd64}.tar.gz \
    | tar xzf - -C /build/app \
    && cp /tmp/lib/${LIB_ARCH:-amd}.lib /build/usr/local/lib/libIOTCAPIs_ALL.so\
    && rm -rf /tmp/*
COPY *.py /build/app/
COPY wyzecam/ /build/app/wyzecam

FROM base
RUN apk add --no-cache libstdc++ gcompat

ENV PYTHONUNBUFFERED=1 RTSP_PROTOCOLS=tcp RTSP_READTIMEOUT=30s RTSP_READBUFFERCOUNT=2048 RTSP_LOGLEVEL=warn SDK_KEY=AQAAAIZ44fijz5pURQiNw4xpEfV9ZysFH8LYBPDxiONQlbLKaDeb7n26TSOPSGHftbRVo25k3uz5of06iGNB4pSfmvsCvm/tTlmML6HKS0vVxZnzEuK95TPGEGt+aE15m6fjtRXQKnUav59VSRHwRj9Z1Kjm1ClfkSPUF5NfUvsb3IAbai0WlzZE1yYCtks7NFRMbTXUMq3bFtNhEERD/7oc504b
COPY --from=builder /build /
CMD [ "python3", "/app/wyze_bridge.py" ]

After it's all done. It results in an error still.

wyze-bridge  | 2022/03/07 07:58:56 [Front Window Cam] Error relocating /usr/local/lib/libIOTCAPIs_ALL.so: __isinf: symbol not found

I thought maybe it was related to glibc, but even attempting to install that also results in the same error and gcompat or libc6-compat should technically work and is the official alpine method for glibc compatibility. So i'm not sure about what to do for the __isinf symbol not found error.

mrlt8 commented 2 years ago

Yup, I get a similar error when I tried to build the alpine images:

Error relocating /usr/local/lib/libIOTCAPIs_ALL.so: __strdup: symbol not found