DIGOO DG-M1X WORKING a sub $30 camera

This is the story about how a copy paste programmer got this cheap Chinese camera working with HA.

I bought it from banggood for $29.70 AUD, not a bad little camera, but its kinda locked down with their crappy software but it does have rtsp and onvif support. However there are some nasty port and a telnet service open on the camera.

DIGOO DG-M1X

I have it working via FFmpeg on my HASS install, the guides aren’t the best so I will show how I got it to work

Setup your camera and have it working via the app

Install FFmpeg I had issues here per the install guide, this is how i got it done.

cd /etc/apt/
sudo nano sources.list
copy "deb http://ftp.debian.org/debian jessie-backports main" to the list and save
sudo apt-get update
sudo apt-get -t jessie-backports install ffmpeg

That should get FFmpeg installed

Check your camera is working via VLC, open a network stream

The address for the DIGOO camera is

rtsp://admin:password@IP_ADDRESS/onvif1
(admin will always be the user name)

Add FFmpeg to your configuration.yaml

ffmpeg:
  ffmpeg_bin: /usr/bin/ffmpeg

add your FFmpeg camera

- platform: ffmpeg
  name: Garage ffmpeg
  input: rtsp://admin:password@IP_ADDRESS/onvif1

(Above is taken direct from my config minus the password and ip address)

Then promptly ban internet access in your router for your device, and also fix its IP address as well.

This should get it working, I’m writing this post for a bit of a one stop, haven’t seen anyone do it yet, and I spent a lot of time trying to get it to work over many web pages and posts.

Thanks HASS community! And I hope this helps someone.

4 Likes

Interesting can you share some sample images from the camera? Day and night would be great.

Nice, would like to see some sample video too. Do you know if there’s and PTZ commands available for it? Would love to know if I can get this working in Blue Iris

No idea on the PTZ stuff sorry.

google the camera, there is a heap of YouTube stuff, but ill move it into its place and get some pics from home assistant for you.

Here is an img from my garage, all doors closed 2x 1m led batten lights turned on. (daytime pic)

since HASSIO is not working with ffmpeg, any other way?

Can you turn off all the p2p stuff like on Foscam?

HASSIO, Not that I know of. This is one of the reasons why I have yet to migrate to HASSIO

p2p, No idea, the controls in the Digoo app are rather basic, But with in my router I have banned them from accessing the router, so they don’t have any access to the internet, just able to communicate on the LAN

hassio works fine with ffmpeg in my experience with a xiaofang camera.
I think that its hassio with ffmpeg on a RPi that is the problem most people have… transcoding rstp stream to mjepg is not possible with Rpi and/or the hassop build of ffmpeg is not optimised/configured for the Rpi GPU.

but my settings was working fine on a pi3 with HASSPIAN, once I moved to HASSIO (same setting same pi3) it stopped working

My guess is that hassio has a non-optimised version of ffmpeg.

Here is my xiaofang working in hassio: (on ubuntu x86)

GOT IT WORKING
I was struggling getting my Digoo DG-M1Z 1080P SHARK 2.8mm 5.0MP to work with hassio 1.1 and HA 0.57.3.
I use RPi 3

https://www.banggood.com/Digoo-DG-M1Z-1080P-SHARK-2_8mm-5_0MP-Lens-Wired-Wireless-Security-Wifi-IP-Camera-Smart-Home-Mornitor-p-1165986.html?rmmds=myorder&cur_warehouse=CN

The camera is perfect on the phone with good image even in the dark, it has a latency of about 3 seconds, and that is ok for the price.

EDIT: I got a image in hass.io. But the frame rate is extremely slow. It is more like still images every 10 seconds.

My configuration.yaml has the code:

camera:
  - platform: ffmpeg
    input: rtsp://admin:[email protected]/onvif1
    name: DigooM1Z nr 1
3 Likes

hassio on the ubuntu x86?

Yes hassio on ubuntu.
You can install per these instructions:

I have a Digoo BB-M2 camera that I want to connect to Home Assistant, I’m definitely going to try your solution this weekend to see if it works for my camera too (I’m running Hass.io too).

I came across the following website the other night for some Pan-Tilt-Zoom functionality for the BB-M2. Perhaps these commands also work for your version?

It would be cool if we could put together a generic Digoo camera component for these cameras with (for example) the following basic functionality:

  • Pan / Tilt
  • Zoom in / zoom out
  • Enable / Disable night mode

pan and tilt yes. Zoom, is only digital (the image)

Hi.
I’ve analyzed the problem of PTZ and I’ve managed to make it work! My DG-M1X camera rotates!

What has to be done:

  1. create a file move_cam.js and paste there:

     const onvif = require('node-onvif');
    
     // Create an OnvifDevice object
     let device = new onvif.OnvifDevice({
       xaddr: 'http://' + process.argv[2] + ':5000/onvif1/device_service',
       user : 'admin',
       pass : 'pass'
     });
    
     // Initialize the OnvifDevice object
     device.init().then(() => {
       // Move the camera
       return device.ptzMove({
         'speed': {
           x: parseFloat(process.argv[3]), // Speed of pan (in the range of -1.0 to 1.0)
           y: parseFloat(process.argv[4]), // Speed of tilt (in the range of -1.0 to 1.0)
           z: 0.0 // Speed of zoom (in the range of -1.0 to 1.0)
         },
         'timeout': 1 // seconds
       });
     }).then(() => {
       console.log('Done!');
     }).catch((error) => {
       console.error(error);
     });
    
  2. It will need a node installed to work properly, so install it.

  3. Install module ‘node-onvif’

  4. Launch the move_cam.js script like here:
    node move_cam.js IP X Y
    where IP is ip address of your camera
    X is -1 for rotate left, 1 for rotate right, 0 for no horizontal rotation
    Y is -1 for rotate down, 1 for rotate up, 0 for no vertical rotation

I hope it will work for you as well as for me :wink:

EDIT:
There’s even better way to do it:

thx @karlkar for the plugin. I’ve also setup a repo with some general info about the cam and hacks I did some days ago https://github.com/felixsteghofer/digoo-m1x_hacks. Maybe someone is interested.

Hi!

Has anybody tried the BB-M1?
The banggood website states it supports onvif, but I’ve read somewhere it doesn’t.

They’re really cheap on banggood, I was wondering if they would be worth it.
Thank you.

Hi I’m trying to get a similar camera Digoo DG-M1Q working on Hassio on a Pi3.

I’m having a few problems:-

  • I can’t work out what port to block in order to prevent the camera to access the internet. My routers UPNP port table doesn’t seem to detect it. I’ve tried blocking port 5000 & 445.
  • I can access the video feed through VNC but I can’t get it to work in Hassio. I’m not sure if the ffmpeg component of hassio is working properly.

ffmpeg:
ffmpeg_bin: /usr/bin/ffmpeg

camera:

  • platform: ffmpeg
    name: Test Camera
    input: rtsp://username@cameraPI/onvif1

Any ideas??