Wyze Cameras and Octoprint - No custom firmware needed! [March 2023]

Cross-posting from my reddit post, but as the only thread I was seeing here brought up and shared was this. I wanted to share a new way to connect your Wyze Cam and OctoPrint while keeping all of Wyze's features.

Looking through the several posts here, discord, and octoprint's forums, it's apparent there is no good guide to setting up OctoPrint with Wyze.

Note, you will NOT need to flash any special firmware, nor have Cam Plus.

Hardware Required:

  • Supported Wyze Camera (Wyze v2/V3 supported)
  • Docker/compose Server (Or something like Portainer) (You can run this one Windows, or Linux/Pi)

Steps:

1) Spin up Docker/Docker-Compose

2) Spin up docker-wyze-bridge

Setting up docker-wyze-bridge:

Docker

docker run \
  -e WYZE_EMAIL=you@email.com \
  -e WYZE_PASSWORD=yourpassw0rd \
  -p 1935:1935 -p 8554:8554 -p 8888:8888 -p 5000:5000 \
  mrlt8/wyze-bridge:latest

Docker-compose

version: '2.4'
services:
    wyze-bridge:
        container_name: wyze-bridge
        restart: unless-stopped
        image: mrlt8/wyze-bridge:latest
        ports:
            - 1935:1935 # RTMP
            - 8554:8554 # RTSP
            - 8888:8888 # HLS
            - 5000:5000 # WEB-UI
        environment:
            - WYZE_EMAIL=${WYZE_EMAIL} # Replace with wyze email 
            - WYZE_PASSWORD=${WYZE_PASSWORD} # Replace with wyze password

As always, you can change the ports if there are any conflicts. External:Internal - Only change external.

For example, my 5000 port is already used by another container. So I use 5001:5000 to access the GUI on port 5001.

3) Get your HLS URL via the dashboard

Dashboard: http://IP:5000

HLS URL: http://IP:8888//

Clicking this button will bring up your URLs:


You'll want your HLS URL here:

4) Enter this URL in the 'Webcam & Timelapse' 'Stream URL' value with stream.m3u8 appended to the end.

Example: http://wyze.local:8888/random-cam/stream.m3u8

Example:

5) Get your Snapshot URL via the wyze dashboard and enter that in your 'Snapshot URL' field.

Special Note: For some reason, I couldn't get this field to resolve my hostname, so you may need to use your server's IP address.

For example:
http://192.168.0.15:5000/snapshot/random-cam.jpg

6) You are ready for cool time lapses and viewing!

Notes:

  • Your URL will likely not be pretty like 'wyze.local', if you are interested in that, look into reverse-proxies.
  • HLS has a bit of latency by default, this will be pretty obvious if you are live-viewing. But for time lapses/making sure it's running, it's fine.
  • You may need to enable cache-buster under Webcam > Advanced Options

  • As this isn't running any special firmware on your camera, all functionality of the cameras will still work (nightvision, in-app viewing, etc)

Results:

Test-Stream:

Test-Snapshot:

image

OctoApp:

NOTE:

DOES NOT WORK WITH PRINT-JOB HISTORY:

6 Likes

This is pretty awesome. I just found this after hours of messing with OpenMiko.

I have this all working via Docker/Portainer except the Streaming part within Octoprint. I can watch the stream locally within a browser just fine, and stream with VLC also. The links work. Also, snapshots are working in Octoprint.

But when I enter my 'http://..*.**:8888/camera-name/stream.m3u8' link into Stream URL within Octoprint I get nothing in the feed.

Any ideas? The stream is definitely online and working.

Some things to check is opening your F12 Panel in your browser and going to the network panel and seeing if any console errors or network errors show up when pushing test.

Example:
image
image

Also Wyze has been somewhat broken the past week or so; and I can barely get the cameras to work in-app. (The wyze subreddit has some complaints about this too)
image

Another is make sure cache is on:

Those should be the main things I would check.

One other thing I did to reduce lag/congestion was reduce that specific wyze-bridge to ONLY my printer cam in the compose file.

image

Is your snapshot URL not working either?

Some things to also note is depending on your network setup, that IP might not be the same.
For ref, since both my octoprint & wyze-bridge are on the same linux box, I call localhost (127.0.0.1) and can connect via that. However, if trying to connect remotely or via a different computer, you'll need to make sure it can communicate with it using it's local IP.

While you may be able to see the stream via your computer, octoprint might not be setup on your computer, and really you'll want to debug the connection between octoprint's network and the wyze-bridge container's host network.

1 Like

I have been struggling with this all day. First I couldn't get bridge to install with the right credentials. Then I figured out it was a bash syntax error due to the password needing a special character. Added single quotes around the password and it worked.
Now I can see the webcam when I log into the wyze bridge webui. But it seems to stutter and lose connection. Even so I copied the hls url to octoprint and added /stream.m3u8. For the snapshot it just says " snapshot/printercam.jpg "
When I hit save it does not seem to work and when I go back to webcam settings the url has changed to "/octoeverywhere-service/localaddress/?address=aHR0cDovL21rc3BpOjg4ODgvcHlcmNhbS9zdGVhbS5tM3U4&r=0"

Any advice?

Are you accessing OctoPrint through OctoEverywhere when you see that? It will likely change the URL to send the stream through the OE service there, which likely wouldn't happen when accessing locally.

You nailed it. Logged in directly and the url is correct. But I still am not getting a stream when I hit test.

Did you enable MJPG Streamer in the octoprint config?

    environment:
      - ENABLE_MJPG_STREAMER=true

Also not running print-job-history plugin?

not running print job history plugin. Excuse my ignorance, how do I enable mjpeg streamer in the config?

So I had some time to look more into this. I have octoprint installed directly to my Pi device and the bridge is on my unraid server as a docker. I added environment:
- ENABLE_MJPG_STREAMER=true to the variables for Wyze bridge in the docker... but I can't do that for octoprint since it is installed directly onto the pi.
I still can't seem to get the stream to work.

I don't think that ENABLE_MJPG_STREAMER is relevant at all to this guide, and that it might be included by mistake.

That variable controls the built in streaming in the docker container, which can be used when you have a USB camera connected to the Pi. Here you are using a Wyze camera, over the network, and so there should be no need for the configuration here. It is also only relevant to those who installed the OctoPrint docker container, whereas this guide should work regardless of how you have OctoPrint installed.

Correct, originally I was debugging why it suddenly stopped working, but found out it was a plugin.
I added that because for some reason it caused the octoprint to enter safe mode which disabled said plugin causing me to think it was the reason it worked.

Further analysis revealed that it was actually printHistory.

Edited it to remove it.

Also clarified with jneilliii that you should be able to just post the HLS link and Octoprint should figure out what to do with it now.

1 Like

I have the opposite problem of everyone else. My video stream is working, however the snapshot url doesn't work, even if I try using the IP address of the wyze camera directly.

The local host snapshot url seems to be unreachable from my raspberry pi.