Skip to content

Misyuk-T/xiaomi-dual-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Setup Guide - Step by Step

This guide walks you through setting up the Xiaomi Dual outdoor camera viewer from scratch.

Supported cameras: CW500 Dual, CW300 Dual, BW300 Dual, and similar dual-lens outdoor models.


Prerequisites

Before you begin, make sure you have:

  • PC
  • Xiaomi Dual camera
  • Camera is set up and working in Mi Home app
  • Camera and PC are on the same local network
  • You know your Xiaomi account email and region

Step 1: Download go2rtc

  1. Go to go2rtc releases page
  2. Download the latest go2rtc_win64.zip (or go2rtc_windows_amd64.zip) (example for win)
  3. Extract the archive
  4. Copy go2rtc.exe to the go2rtc_win64 folder in this project

Expected result: You should have go2rtc_win64\go2rtc.exe in your project folder.


Step 2: Set Static IP for Your Camera

Why? If the camera's IP changes after reboot, you'll need to update the config every time. Static IP prevents this.

How to set static IP in your router:

  1. Log into your router admin panel (usually http://192.168.1.1 or http://192.168.0.1)
  2. Find DHCP Settings or Address Reservation
  3. Find your Xiaomi camera in the list of connected devices
  4. Set a static/reserved IP (e.g., 192.168.1.100)
  5. Save settings
  6. Reboot the camera (power cycle or reboot in Mi Home)
  7. Verify the camera got the new IP in Mi Home app

Tip: Choose an IP outside your router's DHCP range to avoid conflicts (e.g., if DHCP is 192.168.1.100-200, use 192.168.1.50).


Step 3: Find Your Camera Device IDs (DIDs)

The CW500 Dual has two Device IDs - one for each lens. You need both.

Method 1: Using go2rtc Web UI (Easiest)

  1. Copy the example config:

    Copy-Item go2rtc_win64\go2rtc.yaml.example go2rtc_win64\go2rtc.yaml
  2. Start go2rtc (it will run even with placeholder config):

    cd go2rtc_win64
    .\go2rtc.exe
  3. Open http://localhost:1984/add.html in your browser

  4. Fill in the form:

    • Username: Your Xiaomi account email or phone
    • Password: Your Xiaomi account password
    • Region: Select your region (China, Europe, USA, etc.)
  5. Click Load Devices

  6. You'll see your camera listed twice with different DIDs:

    camera 1179461482: work thread started
    camera 1177209822: work thread started
    
  7. Write down both DIDs - you'll need them in the next step

Which DID is which?

  • Usually, the higher DID is the PTZ (360°) camera
  • The lower DID is the fixed camera
  • You can test by configuring one at a time

Step 4: Configure go2rtc.yaml

  1. Open go2rtc_win64\go2rtc.yaml in a text editor

  2. Replace the following placeholders:

    Placeholder Replace with Example
    YOUR_XIAOMI_EMAIL Your Xiaomi account email user@gmail.com
    YOUR_REGION Your account region de (Europe), cn (China), us (USA)
    CAMERA_1_IP Camera 1 static IP 192.168.1.100
    CAMERA_2_IP Camera 2 static IP (or same as camera 1) 192.168.1.101
    YOUR_CAMERA_1_DID Device ID for camera 1 1179461482
    YOUR_CAMERA_2_DID Device ID for camera 2 1177209822
  3. Example of filled config:

    streams:
      camera1_360:
        - xiaomi://user@gmail.com:de@192.168.1.100?did=1179461482&model=isa.camera.cw501d&subtype=auto
      
      camera1_fixed:
        - xiaomi://user@gmail.com:de@192.168.1.100?did=1177209822&model=isa.camera.cw501d&subtype=auto&channel=2
  4. Save the file (Ctrl+S)

Note about channels:

  • The PTZ camera uses the default channel (no parameter needed)
  • The fixed camera uses channel=2
  • Both lenses are on the same physical device, so they share the same IP

Step 5: Authenticate with Xiaomi Cloud

On first run, go2rtc needs to get encryption keys from Xiaomi:

  1. Make sure go2rtc.yaml is configured (Step 4)

  2. Run go2rtc:

    cd go2rtc_win64
    .\go2rtc.exe
  3. Open http://localhost:1984/add.html

  4. Enter your Xiaomi credentials and click Load Devices

  5. After successful authentication, an encryption key will be automatically added to your go2rtc.yaml:

    xiaomi:
      "YOUR_ID": "V1:long_encryption_key_here..."
  6. You only need to do this once. The key is saved and reused.


Step 6: Test the Streams

  1. Make sure go2rtc is running (from Step 5)

  2. Open http://localhost:1984 in your browser

  3. You should see your configured streams:

    • camera1_360
    • camera1_fixed
    • camera2_360 (if configured)
    • camera2_fixed (if configured)
  4. Click on each stream to test it

If a stream doesn't work:

  • Check the PowerShell console for error messages
  • Verify the DID is correct
  • Try alternative model names (see Troubleshooting below)

Step 7: Open the Grid Viewer

  1. Navigate to the go2rtc_win64 folder

  2. Double-click grid-viewer.html

  3. It will open in your default browser

  4. You should see all 4 camera views in a grid layout

Grid Viewer features:

  • Layout switcher: Toggle between 2 columns, 2 rows, or 4 grid
  • Reload button (↻): Refresh individual stream
  • Fullscreen (⛶): Open stream in new window
  • API selector: Add multiple go2rtc servers (for remote access)

Troubleshooting

Camera won't connect

Check the basics:

# Test camera connectivity
ping 192.168.1.100

# Check if go2rtc is running
curl http://localhost:1984/api/streams

Common issues:

  • IP address changed (use static IP!)
  • Wrong Xiaomi credentials
  • Wrong region selected
  • Camera is offline in Mi Home

To restart go2rtc:

# Press Ctrl+C in PowerShell to stop
# Then run again:
cd go2rtc_win64
.\go2rtc.exe

Wrong Device IDs

If you mixed up which DID is PTZ and which is fixed:

  1. Test each DID individually in the web UI
  2. The PTZ camera should show a wider view and respond to movement
  3. Swap the DIDs in go2rtc.yaml if needed

Alternative Camera Models

If isa.camera.cw501d doesn't work, try these in order:

model=isa.camera.hlmax    # Try this first
model=isa.camera.cw500d   # Then this
model=isa.camera.hlc7     # Last resort

Change in go2rtc.yaml, save, stop go2rtc (Ctrl+C), and run .\go2rtc.exe again.

Video Quality Issues

For better quality:

&subtype=0  # Force HD (2.5K)

For lower bandwidth:

&subtype=1  # Force SD (720p)

For less lag:

  • Use MSE mode: http://localhost:1984/stream.html?src=camera1_360&mode=mse
  • Improve Wi-Fi signal (use 5GHz, move router closer)
  • Use Ethernet cable for camera if possible

About

View both lenses of Xiaomi Dual outdoor cameras (CW500/CW300/BW300) at once. go2rtc config + web grid viewer + RTSP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors