Difference between revisions of "Advanced IP Camera"

From LinuxMCE
Jump to: navigation, search
(Device data for children)
(Updated to current development)
Line 13: Line 13:
 
* Image retrieval
 
* Image retrieval
 
* Motion detection events (for D-Link cameras  - DCS-2121 used when developing)
 
* Motion detection events (for D-Link cameras  - DCS-2121 used when developing)
 +
* Generic Sensor inputs on camera (D-Link)
 +
* Generic Output on camera (D-Link)
  
  
Line 32: Line 34:
 
Other data are optional and depends on what features your camera has.
 
Other data are optional and depends on what features your camera has.
 
Options:
 
Options:
* File Name and Path/Event URL: an URL on the device that returns events
 
 
* AuthUser: Username to authenticate to the camera
 
* AuthUser: Username to authenticate to the camera
 
* AuthPassword: Password to authenticate to the camera
 
* AuthPassword: Password to authenticate to the camera
Line 40: Line 41:
 
* Configuration: specify what method to use to access the cameras events (motion detection, input changes etc.)
 
* Configuration: specify what method to use to access the cameras events (motion detection, input changes etc.)
 
The available options are (this is an example)
 
The available options are (this is an example)
  eventMethod1=[url,httpserver,ftpserver,smtpserver]
+
  eventMethod1=[url,httpserver,ftpserver,smtpserver] (only url currently implemented)
 
  eventURL1=[/cgi/web_event.cgi|localhost:25|localhost:8080]
 
  eventURL1=[/cgi/web_event.cgi|localhost:25|localhost:8080]
controlURL1=[/dev/gpioCtrl.cgi]
 
  
 
If you have several different methods, use eventMethod2, eventURL2 etc...
 
If you have several different methods, use eventMethod2, eventURL2 etc...
Line 56: Line 56:
 
Device data for children can be specified as a list of <PK_DeviceData>|<DataValue>|<PK_DeviceData>|<DataValue>|...etc
 
Device data for children can be specified as a list of <PK_DeviceData>|<DataValue>|<PK_DeviceData>|<DataValue>|...etc
  
 +
The device templates currently working with the Advanced IP Camera is Motion Detector, Generic Sensor and Generic Input Output.
 +
 +
==== Motion detectors ====
 
Motion detectors use the Capabilities data to describe how to look for events. The D-Link camera sends all events on a http connection that stays open, so we can look for a specific string that triggers the events.
 
Motion detectors use the Capabilities data to describe how to look for events. The D-Link camera sends all events on a http connection that stays open, so we can look for a specific string that triggers the events.
 
Example on capabilities configuration:
 
Example on capabilities configuration:
Line 66: Line 69:
  
 
It uses the "pattern" trigger method, which simply checks for the existence of patternOn and patternOff to trigger on/off or sensor tripped changes.
 
It uses the "pattern" trigger method, which simply checks for the existence of patternOn and patternOff to trigger on/off or sensor tripped changes.
 +
 +
====Inputs====
 +
Inputs are specified mostly the same way as motion detectors, using the Capabilities device data.
 +
 +
This is an example configuration (for D-Link cameras):
 +
method=1
 +
triggerMethod=pattern
 +
patternOn=gp_input_1=on
 +
patternOff=gp_input_1=off
 +
 +
These parameters are identical in use to the ones for motion detectors.
 +
 +
====Outputs====
 +
Outputs are configured using the Capabilities device data:
 +
controlMethod=url
 +
on=/dev/gpioCtrl.cgi?out1=1
 +
off=/dev/gpioCtrl.cgi?out1=0
 +
 +
The control method indicates that this output is changed by doing a url access.
 +
The on/off parameters are the urls to be accesses to turn the output on and off.
  
 
=Development notes=
 
=Development notes=
 
I'm looking for information about how other types of cameras implement events and camera controls. To be able to support as many types of camera manufacturers, we need to find out what support we need to implement. So if you want your particular camera supported, either send me a camera to test, or post the required data here.
 
I'm looking for information about how other types of cameras implement events and camera controls. To be able to support as many types of camera manufacturers, we need to find out what support we need to implement. So if you want your particular camera supported, either send me a camera to test, or post the required data here.
 +
 +
==Current Plans==
 +
The short-term plans are to add support for other types of event methods - ways that the camera informs us about changes in state. The first on the list is to implement support for cameras that connect to a http server when motion is detected.
 +
 +
The medium/long-term plans are to look into video and audio support. Many cameras have a microphone and a speaker. It will be interesting to see if this can be used in LinuxMCE.

Revision as of 22:49, 18 July 2012

Introduction

The Advanced IP Camera is a generic device template which aims to utilize more features of modern IP cameras than GSD templates can.

This device template is current under development and what is described here may not be accurate!


Currently working:

  • Image retrieval
  • Motion detection events (for D-Link cameras - DCS-2121 used when developing)
  • Generic Sensor inputs on camera (D-Link)
  • Generic Output on camera (D-Link)


This device template is not meant to be used directly, even though it can. The idea is that this template describes the available options that the Advanced_IP_Camera binary supports, and a device template for a specific make and model should specify the correct options for that device. See the D-Link DCS-2121 template as example (to be made).

Creating a device template based on Advanced IP Camera

Create a new device template, check "Implements DCE", enter "Advanced_IP_Camera" as Command Line. Add "Core" as controlled by category, and add a dependency on the "LinuxMCE Advanced IP Camera" software package.

This should make a template that uses the Advanced_IP_Camera binary, and is started automatically on the core.

You now need to enter the specific data for your device. I hope you have already set the manufacturer and model number when creating the template... A DHCP MAC range needs to be added if you want your device to be automatically detected.

Device data for the template

The device data describe options that might be special for your device. You need to add the device datas you need to customize for your device template. Look at the Advanced IP Camera template to see what data is available. Some data are required, like Path.

Other data are optional and depends on what features your camera has. Options:

  • AuthUser: Username to authenticate to the camera
  • AuthPassword: Password to authenticate to the camera
  • Video support: Check if this camera supports video
  • Video Settings: URL where video can be retrieved from the camera
  • Control path: URL to control the camera
  • Configuration: specify what method to use to access the cameras events (motion detection, input changes etc.)

The available options are (this is an example)

eventMethod1=[url,httpserver,ftpserver,smtpserver] (only url currently implemented)
eventURL1=[/cgi/web_event.cgi|localhost:25|localhost:8080]

If you have several different methods, use eventMethod2, eventURL2 etc...

Commands and events

You should select the commands and events that your device is capable of handling. They are not used in any way in the Advanced_IP_Camera binary at the moment, but that might change. Setting these are just the right thing to do.

Related device templates

This allows you to specify any children that should be created anutomatically, if any. For instance, if your camera supports motion detection, a motion detector device should be a children of your camera device. Sometimes cameras also have general input and outputs that can be read and controlled. This requires a generic input and output device to be added under your camera device.

Device data for children

Device data for children can be specified as a list of <PK_DeviceData>|<DataValue>|<PK_DeviceData>|<DataValue>|...etc

The device templates currently working with the Advanced IP Camera is Motion Detector, Generic Sensor and Generic Input Output.

Motion detectors

Motion detectors use the Capabilities data to describe how to look for events. The D-Link camera sends all events on a http connection that stays open, so we can look for a specific string that triggers the events. Example on capabilities configuration:

method=1
triggerMethod=pattern
patternOn=motiondetected=1
patternOff=motiondetected=0

This says that this device is using the eventMethod 1 defined in the camera device.

It uses the "pattern" trigger method, which simply checks for the existence of patternOn and patternOff to trigger on/off or sensor tripped changes.

Inputs

Inputs are specified mostly the same way as motion detectors, using the Capabilities device data.

This is an example configuration (for D-Link cameras):

method=1
triggerMethod=pattern
patternOn=gp_input_1=on
patternOff=gp_input_1=off

These parameters are identical in use to the ones for motion detectors.

Outputs

Outputs are configured using the Capabilities device data:

controlMethod=url
on=/dev/gpioCtrl.cgi?out1=1
off=/dev/gpioCtrl.cgi?out1=0

The control method indicates that this output is changed by doing a url access. The on/off parameters are the urls to be accesses to turn the output on and off.

Development notes

I'm looking for information about how other types of cameras implement events and camera controls. To be able to support as many types of camera manufacturers, we need to find out what support we need to implement. So if you want your particular camera supported, either send me a camera to test, or post the required data here.

Current Plans

The short-term plans are to add support for other types of event methods - ways that the camera informs us about changes in state. The first on the list is to implement support for cameras that connect to a http server when motion is detected.

The medium/long-term plans are to look into video and audio support. Many cameras have a microphone and a speaker. It will be interesting to see if this can be used in LinuxMCE.