Skip to content
PaRkThEcAr edited this page Feb 16, 2022 · 19 revisions

This guide documents how to set up Wyze Cameras with the Dafang-Hack mod to enable motion alerts and RTSP streams.

MQTT

  1. Install the Scrypted MQTT Plugin and enable the MQTT Broker.

Dafang-Hacks

Flashing Dafang-Hacks

It should be noted that as of Some of the more recent Wyze Cam firmware releases, you will not be able to flash the firmware without a bit of trickery BEYOND the recommended procedure. I would recommend heading to the Dafang-Hacks repo and pulling a FULL copy from the page. In there, you will find older firmware under /firmware_original/ directory for your camera. The older the better in this case. You can also use the Way Back machine to go to Wyze's support pages and pull an old firmware. This can be mixed though and sub optimal.

How to flash. Original source here

  1. Take the micro SD card you wish to use and format it to FAT32 SPECIFICALLY. Other formats won't work, so its suggested you use this. If your SD card is large (larger than 4gb) I would suggest either finding a smaller one, or you COULD partition a small bit of it. This latter method may not work though. You can also just leave it as is but formatted to FAT32. I do this, and it seems to work just fine.
  2. Head over to their GitHub and clone the full repository. You can do it as a .zip file as we will need the whole thing. Be sure to extract it.
  3. Next, I would head to the install guide page and reference Step 1. They will have a CFW binary for YOUR camera. Grab it and extract it. Then name it to demo.bin.
  4. Place the demo.bin file to the root of the SD card. This SD card CANNOT have any file (including the hidden macOS ones). Make sure they are deleted outright, and trash emptied.
  5. Remove the cable from your camera and insert the card.
  6. IMPORTANT: while HOLDING the setup button, insert the USB cable and continue to hold that button for 10 seconds.
  7. Wait 3-5 minutes. Wyze Cam Pan models will move when done, but for static cameras, you will need to wait the full length. At the end of the wait unplug the camera and remove the card.
  8. Next, we need to copy everything from inside the firmware_mod folder on our cloned repo to the root of the SD card. Then we need to make a few duplicate file's and rename them.
  9. On the SD card, duplicate config/wpa_supplicant.conf.dist and rename the NEW file wpa_supplicant.conf
  10. (For those not using reserved IP addressed on their router) Take the file at config/staticip.conf.dist, duplicate it, and rename it to staticip.conf
  11. Open wpa_supplicant.conf and give the proper SSID and password for your network. Make sure they are in quotes and spelled EXACTLY. For key_mgmt, ONLY change it if you need too. For everyone else, WPA-PSK (WPA2) is totally fine.
  12. Open the staticip.conf file and make sure you put in the DESIRED IP address and subnet mask. You dont have to make this change if you set the reserved IP on your router. (MAC address is on the camera body). The format is 192.168.x.x net mask 255.255.255.0 as an example
  13. Remove the card, insert it into the camera and power it on. Then, head to your browser and enter the IP address of the camera. The default username is root and password ismart13. It is suggested you change these as anyone can look these up.

Additional issues with flashing can be troubleshooted on their GitHub or looked up on their issues tab.

MQTT

  1. In the Dafang-Hacks web ui of your camera, go to the gear icon located in the top navigation bar then network services.
  2. Enter the ip address of Scrypted. The default server port is 1883. If you didn't set up a user id and password in your MQTT plugin, you can leave those fields blank. Set your Location and Device to whatever you'd like. I used "Home" for location on all my cameras and whatever room the camera is in as the device name, i.e. "Garage".
  • Ensure that MQTT notifications and Motion Detection are enabled, they may not be by default.

Camera Settings

  1. Go to gear icon, camera, video, format. The settings I use which give me reliable streaming are: H264, 1280x720, 299kbps, FixedQp, 15FPS. This should allow you to stream through Scrypted without transcoding (copy).
  • Community reports also indicate H264, 1280x720, 2000kbps, VBR, 15FPS works well.
  1. Go to Audio, change the audio format to MP3. This will further prevent any streaming issues.
  2. Go to the wrench/screwdriver icon, services. Ensure that "MQTT Live Status Updates" control is set to start and autostart is set to on. I believe these are already activated by default.

Passwords

  1. Go to gear icon, system, properties. Set your http root password. (ID should be "root" by default.) This is supposed to set your password protection for dafang's web ui, but I can't remember if I ever have been asked to enter my password. This will be used for the snapshot url later in Scrypted.
  2. Go to gear icon, camera, video, network/security. Set your user id and password. These will be used for your rtsp stream later in Scrypted.

Scrypted

Plugins

  1. In the Scrypted web ui, go to the plugins page and click "Install Plugin". Install the following plugins: mqtt (should already have this), rtsp, rebrebroadcast, and homekit.

MQTT

  1. From the plugins page, open the mqtt plugin, and type the name of the device into the "Add MQTT Custom Handler" field inside the "Settings" panel. Then click the green paper airplane icon to add it. Click on your new device which should now be showing in the "Providing Things" panel.
  2. In the "MQTT Handler" panel, I replaced all of the default code with:
createMotionSensor({
    topic: 'motion',
    when: ({text}) => text === 'ON',
    delay: 10
})
  1. Set your device type to "Sensor".
  2. Within the "Settings" panel, for the "Subscription URL" field enter your mqtt url: mqtt://ip.address.of.pi/Home/Garage/
  3. Within the "Integrations and Extensions" panel, make sure the "Homekit" checkbox is NOT checked. The motion sensor will be integrated with the camera later.

Adding cameras

  1. From the plugins page, open the RTSP Camera Controller plugin and add a new camera. In the "Settings" panel type the name of your camera and click the green paper airplane icon to add it. The new camera should be in the "Provider Things" panel.
  2. In the "Integrations and Extensions" panel, ensure the rebroadcast plugin and homekit checkboxes are checked.
  3. In the "Settings" panel under "General", enter the username and password you used in step 8. Make sure you click the green paper airplane icon after each field is filled to save that particular field.
  4. For snapshot url use: http://root:password_from_step7@ip.address.of.camera/cgi-bin/currentpic.cgi
  5. For RTSP Stream URL use: rtsp://ip.address.of.camera:8554/unicast This field won't display a green paper airplane icon for saving. Instead click the "Save RTSP Stream URL" button.
  6. Under "Rebroadcasting: Stream 1", "Audio Codec Transcoding", select "MP2/MP3 Audio".
  7. Under "Homekit", "Linked Motion Sensor", select the mqtt motion sensor you created in step 10.
  8. The remaining settings I left as default.
  9. You might need to restart scrypted (in settings) to ensure everything is working.

Homekit

  1. From the plugins page, open the Homekit plugin. In the settings panel, you can see the pairing info needed to add Scrypted to homekit.
  2. In the "Homekit" panel, click console button to view the homekit QR code.