Difference between revisions of "WelcomeSwitch"

From i3Detroit
Jump to: navigation, search
Line 1: Line 1:
 
Wiring
 
Wiring
  
On the camera:
+
On the camera, there's a hacked-up PoE cable that does the following:
 
<pre>
 
<pre>
 
1 wht/org ethernet
 
1 wht/org ethernet
Line 13: Line 13:
 
</pre>
 
</pre>
  
In the box:
+
In the box above the door:
Ethernet pins pass through to Ethernet input
+
Ethernet pins pass through to Ethernet input (into which is plugged the feed from the back of the space.)
 
GND from power input goes to GND from camera, also to LED cathode and SSR negative.
 
GND from power input goes to GND from camera, also to LED cathode and SSR negative.
 
+12 from power input goes to +12 from camera, also to switch contact.
 
+12 from power input goes to +12 from camera, also to switch contact.
 
Relay Output from camera goes to LED anode and SSR positive.
 
Relay Output from camera goes to LED anode and SSR positive.
Digtal Input + from camera goes to switch contact.
+
Digtal Input + from camera goes to switch contact. SSR isn't currently connected; signals are on orange wires, shrinkwrapped to prevent shorts in the time being.
 +
 
 +
(To accommodate a future local OPEN sign, provision has been made for connecting the big solid-state relay, which can switch anything we could throw at it.)
  
 
Software
 
Software
Line 29: Line 31:
 
echo %errorlevel%
 
echo %errorlevel%
 
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=l --output-document=NUL
 
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=l --output-document=NUL
 +
rem This turns the LED off when the switch is down.
 
find "DI=L" <getdi.cgi
 
find "DI=L" <getdi.cgi
 
echo %errorlevel%
 
echo %errorlevel%
 
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=h --output-document=NUL
 
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=h --output-document=NUL
 +
rem This turns the LED on when the switch is up.
 
sleep 1
 
sleep 1
 
goto top
 
goto top
 
</pre>
 
</pre>
  
Camera documentation: [ftp://ftp.dlink.com/Multimedia/URL%20Commands/URL%20command%20for%20DCS-5300_G_,%20DCS-2100_G_%2B,%20DCS-2000,%20DVS-301_2007_06_01.pdf]
+
The most important part of all this! Camera documentation: [ftp://ftp.dlink.com/Multimedia/URL%20Commands/URL%20command%20for%20DCS-5300_G_,%20DCS-2100_G_%2B,%20DCS-2000,%20DVS-301_2007_06_01.pdf]

Revision as of 19:25, 29 November 2009

Wiring

On the camera, there's a hacked-up PoE cable that does the following:

1 wht/org ethernet
2 org/wht ethernet
3 wht/grn ethernet
4 blu/wht GND
5 wht/blu Digital Input +
6 grn/wht ethernet
7 wht/brn Relay Output
8 brn/wht +12V

In the box above the door: Ethernet pins pass through to Ethernet input (into which is plugged the feed from the back of the space.) GND from power input goes to GND from camera, also to LED cathode and SSR negative. +12 from power input goes to +12 from camera, also to switch contact. Relay Output from camera goes to LED anode and SSR positive. Digtal Input + from camera goes to switch contact. SSR isn't currently connected; signals are on orange wires, shrinkwrapped to prevent shorts in the time being.

(To accommodate a future local OPEN sign, provision has been made for connecting the big solid-state relay, which can switch anything we could throw at it.)

Software

Proof-of-concept batch file:

:top
del getdi.cgi
wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/getdi.cgi
find "DI=H" <getdi.cgi
echo %errorlevel%
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=l --output-document=NUL
rem This turns the LED off when the switch is down.
find "DI=L" <getdi.cgi
echo %errorlevel%
if %errorlevel% EQU 0 wget --user=admin --password=i3 http://i3detroit.dyndns.org:5000/cgi-bin/setdo.cgi?do=h --output-document=NUL
rem This turns the LED on when the switch is up. 
sleep 1
goto top

The most important part of all this! Camera documentation: [1]