Skip to content

Networking ‐ USB Direct w CDC (NCM)

virmaior edited this page Nov 9, 2025 · 1 revision

General Concepts

There's three major areas where it's easy to screw this up:

  1. USB Direct is not enabled in default builds of Thingino.

  2. The cables that come with many cameras are power only. For instance both the WyzeV3 and Atom V2 ship with micro usb to usb A that are power only and don't have the data wires necessary.

  3. Your computer probably does not want to poewr that many cameras through its usb port.

  4. what happens when you make an NCM connection is a ethernet over usb network between just the host computer and the camera. This is probably not what you want.

Solutions:

  1. Compile thingino with two flags set in the compile environment:
  BR2_PACKAGE_USBNET: y
  BR2_PACKAGE_USBNET_USB_DIRECT_NCM: y 
  1. use a usb-cable that has data.

  2. Get a powered USB-hub.

  3. Make a bridge on the host computer, manage the IP addresses and enable forwarding.

Implementation in "Buster" (Debian 10) (/etc/network/)

  1. Load the module for cdc_ncm:

sudo modprobe cdc_ncm

make it permanent with: echo 'cdc_ncm' | sudo tee /etc/modules-load.d/ncm.conf

  1. Setup the bridge network. In /etc/network/interfaces.d

add a conf-file 10-bridge.conf

iface br0 inet static
        address 192.168.9.1
        netmask 255.255.255.0
        bridge_ports usb0 usb1 usb2 usb3 usb4 usb5 usb6

allow-hotplug usb0
allow-hotplug usb1
allow-hotplug usb2
allow-hotplug usb3
allow-hotplug usb4
allow-hotplug usb5
allow-hotplug usb6

auto usb0
iface usb0 inet manual
	address 192.168.9.10
	netmask 255.255.255.0
	up ifconfig usb0 up
	up brctl addif br0 usb0

auto usb1
iface usb1 inet manual
        address 192.168.9.11
        netmask 255.255.255.0
        up ifconfig usb1 up
        up brctl addif br0 usb1

auto usb2
iface usb2 inet manual
        address 192.168.9.12
        netmask 255.255.255.0
	up ifconfig usb2 up
        up brctl addif br0 usb2

auto usb3
iface usb3 inet manual
        address 192.168.9.13
        netmask 255.255.255.0
        up ifconfig usb3 up
        up brctl addif br0 usb3

auto usb4
iface usb4 inet manual
        address 192.168.9.14
        netmask 255.255.255.0
        up ifconfig usb4 up
        up brctl addif br0 usb4


allow-hotplug usb5
iface usb5 inet manual
        address 192.168.9.15
        netmask 255.255.255.0
        up ifconfig usb5 up
        up brctl addif br0 usb5

allow-hotplug usb6
iface usb6 inet manual
        address 192.168.9.16
        netmask 255.255.255.0
        up ifconfig usb6 up
        up brctl addif br0 usb6



This will create a bridge that covers seven cameras

  1. In addition, you need something like dnsmasq to configure and give them ip addresses.

in the dnsmasq.conf, you need to

  1. tell it to listen to the br0 interface:
interface=br0
  1. have it assign IP addreseses. I default to DHCP but have it statically assign within the IP range:
dhcp-range=br0,192.168.9.2,192.168.9.255,255.255.255.0,24h
dhcp-host=br0,02:b3:cc:b3:8c:a6,02:FF:FF:FF:FF:01,192.168.9.101
dhcp-host=br0,02:FF:FF:FF:FF:02,02:14:82:3b:bd:e2,192.168.9.102
dhcp-host=br0,02:FF:FF:FF:FF:03,02:73:55:08:b9:ba,192.168.9.103
dhcp-host=br0,02:FF:FF:FF:FF:04,02:2d:86:29:5a:58,192.168.9.104
dhcp-host=br0,02:FF:FF:FF:FF:05,192.168.9.105
dhcp-host=br0,02:FF:FF:FF:FF:07,192.168.9.107
dhcp-host=br0,02:bb:71:df:c8:b0,192.168.9.108

on a dhcp-host line, you need the interface and then can give it multiple MAC addresses to match up to an IP address.

  1. You also need to tell the device to route IP4 traffic:
sudo sysctl -w net.ipv4.ip_forward=1

and then to make it permanent: add net.ipv4.ip_forward=1 to /etc/sysctl.conf and run sysctl -p

  1. setup the route sudo ip route add 192.168.9.0/24 dev br0 src <ip of your device>

On Trixie

Trixie does not use /etc/network but rather NetworkManager to manage its network so some of the steps are different.

What's the same:

  1. No longer need to load the driver for NCM
  2. Still need to enable IPv4 traffic forwarding (same as above)
  3. Still need to run a dhcp server to give IP addresses (same as above
  4. Still need to setup a bridge network (but done differently)
  5. Still need to setup a route

For three, the following script should do the trick:



# 1. Create bridge
nmcli con add type bridge con-name br0 ifname br0 stp no
nmcli con mod br0 ipv4.method manual ipv4.addresses "192.168.9.1/24"
nmcli con mod br0 ipv4.route1 "192.168.9.0/24 10.0.0.1"

# 2. Add each USB as slave
for i in {0..6}; do
  nmcli con add type ethernet con-name br0-slave-usb$i ifname usb$i master br0
done

# 3. Bring up
nmcli con up br0
for i in {0..6}; do nmcli con up br0-slave-usb$i; done

So the main thing is to setup the bridge and then tell NetworkManager that the USB connections are its slaves.

  1. Wiki Home
  2. About the Project
    1. Contributions
    2. Features
    3. Project Philosophy
    4. Releases
  3. Getting Started
    1. FAQ
    2. Glossary
    3. Hardware Identification
    4. Image Builder
    5. USB Boot Mode
    6. Ingenic USB Cloner
      1. OTG Booting
    7. PPSTRONG
    8. Installation: General
    9. Installation: No Tools Methods
    10. Resources and Links
    11. Support Community
    12. Troubleshooting
    13. UART Connection
    14. Updating Firmware
    15. Unbricking
    16. Web UI
  4. Supported Cameras
    1. Cameras
    2. 360 AP1PA3
    3. AliExpress LTIA‐37FJZ (Vanhua Z55 module)
    4. AOQEE C1
    5. Aosu C5L
    6. Cinnado
      1. Cinnado D1 2K
      2. Cinnado D1 3K
    7. Dekco DC5L
    8. Eufy
      1. Eufy E210 Outdoor Cam
      2. Eufy E220
    9. Galayou/Wansview
      1. Galayou G2
      2. Galayou G7
      3. Wansview W6
      4. Wansview W7/Galayou Y4
    10. Hualai (Wyze/Atom/Neos/Personal)
      1. Dafang Upgrading for Wyze v2
      2. NEOS conversion
      3. Personal Cam Pan and Cam 2
      4. Wyze Cam Pan V1
      5. Wyze Doorbell (V1)
        1. Chime Reverse Engineering
        2. Flashing VDB1 over UART (YMODEM)
        3. MQTT Control and Monitoring
      6. Wyze v2/Neos SmartCam/ATOM Cam 1
      7. Wyze v3
      8. Wyze Accessories
    11. iFlytek XFP301‐M
    12. Jienuo JN-107-AR-E-WIFI
    13. Jooan A6M
    14. LaView L2
    15. LongPlus X07
    16. LSC 3215672
    17. Sannce I21AG
    18. Sonoff Cam‐S2 and B1P
    19. TP-Link Tapo C100/C110/C111
    20. Wuuk Y0510
    21. Xiaomi
      1. Xiaomi Mijia1080p (SXJ02ZM)
      2. Xiaomi MJSXJ03HL
      3. Xiaomi Outdoor Camera AW200 (MJSXJ05HL)
  5. Configuration
    1. Administration
    2. Automation
      1. Configuring camera using runonce.sh script
    3. Cron jobs
    4. General
    5. LED Indicators
    6. Lighting
    7. Media Streaming Endpoints
    8. Network Storage
    9. Networking
      1. DHCP: Timezone
      2. Wireless Networking
      3. USB Direct w CDC (NCM)
      4. USB Ethernet Networking
      5. Remote Access
      6. VPN
        1. Tailscale
        2. Wireguard
        3. Zerotier
      7. Wi-Fi
        1. Self Hosted AP
        2. Tips and Tricks
      8. WWAN (Cellular)
    10. Night Mode
    11. ONVIF
    12. OSD (On-screen Display)
    13. Plugins
      1. Motion Guard
      2. Yandex Disk
    14. SSH Access Keys
    15. Wi-Fi Access
    16. Provisioning
    17. Streamer Bitrate Control
    18. Video Rotation
  6. Integration
    1. Home Assistant
    2. Frigate
    3. Ingenic A1/$15 NVR
    4. LightNVR
    5. Mobile Apps
    6. MQTT Integration
    7. Telegram Bot Integration
    8. Virtual Webcam on Linux
    9. Mainsail (Klipper)
  7. Development
    1. Booting
      1. Boot: MMC SD
      2. Boot: NFS
    2. CH341A Programmer
    3. RTSP Players
    4. Flash Chips
    5. go2rtc
    6. Porting Guide
    7. Ingenic Platform Capability Matrix
    8. Ingenic Image Processor
    9. ISP Reserved Memory (RMEM)
    10. Debugging
    11. Software
      1. Building From Sources
      2. Buildroot
      3. Toolchain
      4. Choice of JSON library
    12. SSL and TLS Web UI in thingino
    13. Tech Info
      1. Hardware
      2. PWM Info
      3. Supported Hardware
      4. T23 GPIOs
      5. T31 GPIOs
    14. U-Boot Cheatsheet
    15. Zeratul/Atlas/Tassadar
    16. Resources

Clone this wiki locally