Manage D-Link DCS-960L motion detection using a RaspberryPi

Installing and configuring a surveillance camera is becoming an operation very easy and very common, strong technical skills are not required anymore.
The question is: can we control a “home camera”  with our RaspberryPi ? The short answer is: YES !

I’ll show how to use the RaspberryPi to control, using jus the linux shell, a D-Link DCS-960L .

Required hardware

  • RaspberryPi
  • D-Link DCS-960L
  • a smartphone (only required to initially setup the camera)
  • a wifi router already configured
  • an internet connection

Initial setup

  • Make sure your internet connection is functioning
  • Configure your wifi network using WPA2 encryption and make sure your network name (SSID) is not hidden
  • Assemble and cofigure your RaspberryPi and check that:
    • curl is installed
    • ssh service  is enabled
    • wifi connection to the router is functioning
  • Connect your smarphone to the local WiFi network you have setup up
  • Configure your camera using your smartphone (following the instructions)
  • Configure you WiFi router and/or DHCP server to always give the same IP address to che camera

Data to collect

  • IP address given to the camera
  • camera’s admin username
  • camera’s admin password

Now it’s time to create our control script.

Login, via SSH, to your RaspberryPi and create file cam.sh in a directory you want, putting inside this new file the following text:

Before saving the file replace the following placeholders :

  • YOUR_ADMIN_USERNAME : camera’s admin username
  • YOUR_ADMIN_PASSWORD : camera’s admin password
  • YOUR_CAMERA_IP_ADDRESS : camera’s ip address

After saving the file make it executable ( chmod +x cam.sh ).

Now, if everything went well and there are no other issues (network, firewall, …), you should be able to manage your camera’s motion detection status using the linux shell:

  • cam.sh info : get motion detection status (enabled disabled)
  • cam.sh enable : enable motion detection
  • cam.sh disable : disable motion detection
  • cam.sh toggle :enable motion detection if it’s disabled or disable motion detection if it’s enabled

 

Leave a comment