[quote=“micasaverde, post:11, topic:164599”]Assuming the device in question is not UPnP, like the IP cameras we’re using, there’s no ‘official’ way to find them on the network. So, what we’ve done with Vera is add a low-level LAN monitor that listens for all IP requests (ie DHCP) whether or not Vera is the DHCP server. When this monitor determines a new IP device is on the network, it calls /usr/bin/cmh_PnP. This is a simple ‘brute force’ script that does wget’s on the IP address to match against known patters for devices. You’ll see right now we have pattern matching for the Panasonic cameras, the GC100, and the D-Link. If you want to add a device and make it plug and play, send us the ‘if’ statement we should add to the check portion, like this:
if curl -o /tmp/$IP.temp.gc100 -k -s -S --fail --connect-timeout 1 --max-time 1 "http://$IP/index.html" --stderr $err_file && grep GC-100 /tmp/$IP.temp.gc100 ;then
log "It's a gc-100"
IsGC100=1
break;
else
log "It isnt a gc100"
fi
and the device creation line, like this:
curl -o /tmp/$IP.temp "http://127.0.0.1:49451/data_request?id=lu_action&$SERVACT&deviceType=urn:schemas-upnp-org:device:DigitalSecurityCamera:1&
UpnpDevFilename=D_DigitalSecurityCamera1.xml&UpnpImplFilename=I_PanasonicPTZ.xml&IpAddress=$IP&MacAddress=$MAC&StateVariables=
urn:micasaverde-com:serviceId:Camera1,Username=dceadmin%0Aurn:micasaverde-com:serviceId:Camera1,Password=dcepass&output_format=xml"
We’ll add this to the cmh_Pnp script for the next release.[/quote]
This is great, but as it is now it can’t be deployed (or removed) as part of a plugin.
Could you guys consider making this script pluggable - something that can be deployed as part of plugin installation? For example put new additions of the script into sequentially numbered files cmh_Pnp001, cmh_Pnp002, etc - and concatenate them on restart?
There are many devices that will benefit from LAN auto discovery. For example my lovely EtherRain sprinkler controller has dedicated auto-discovery service:
[quote=“www.quicksmart.com”]If the device was configured to receive a dynamic address using the DHCP protocol, the
address will generally not be known so the address can be found by using EtherRain’s
built-in discovery function.
EtherRain listens on port 8089 for UDP broadcasts containing the keycode string:
eviro_id_request1
When this keycode is detected EtherRain returns a confirming UDP packet to the sender. [/quote]