Project:Door sensor
From London Hackspace Wiki
(Redirected from Door sensor)
Door Sensor
Aim
To tell the state of the (front) door without having to physically be there/see it. More generically, a binary input that is on the network.
How it works
- You can create Ethernet loop back devices by shorting a couple of pairs on Ethernet cables as per http://erikugel.wordpress.com/2011/09/14/making-an-ethernet-loopback-adapder/
- By opening and closing one pair you can bring a network interface up/down
- A micro switch has been mounted into the door frame at the top and brown/white cable run to choc blocks, and then a network cable run back to Cisco2 switch, port 42
Cisco port need some configuring:
interface GigabitEthernet1/42
no keepalive
speed 100
duplex full
Things it doesn't interact with
This has nothing to do with:
- Doorbot
- Spacecensus
- Alarm Cabling
How do I interact with this?
?doorstatus on IRC will responsd with "Door closed" or "Door open"
?doorsnmp will do a more advanced check, with SNMP polling and respond thusly: Door is closed (last movement was on 18/11/2012 at 20:29:29)
The ?doorsnmp (/usr/share/irccat/doorsnmp.py on babbage) code isn't the greatest, I'm sure someone can improve it.
What next?
- Tidy up the script that tells IRC the status. At the moment it is the quickest dirtiest python you will ever see
- Add more doors! - Build a complete building management system that has the status of all infrastructure
- Log/graph it in Cacti?