-
Notifications
You must be signed in to change notification settings - Fork 3
Code for the Hackerspace Open // Closed switch.
Hive13/openswitch
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The 'Door Switch' or 'Is the Hackerspace Open?' switch has two main software components: 1. The microcontroller client code. 2. The webserver database and webpages. ######### 1. The Microcontroller ######## ~~ The electrical components ~~ 1. A standard lightswitch 2. An Arduino Mega with Ethernet Board ~~ The Code ~~ The micro remembers the last state of the switch, when the state changes it sends out an HTTP 'GET' request to the webserver to 'isOpen/logger.php?switch=[0|1]'. A switch state of '0' means the hackerspace is closed, a switch state of '1' means the hackerspace is open. ~~ Light Status Codes ~~ Waiting for response: Both LEDs solid Cannot contact the network: Alternating blink of both LEDs Cannot reach server: Simultaneous blink of both LEDS ######### 2. The Webserver ######## The webserver contains several parts: 1. A MySQL database with a 'doorEvents' table. 2. The logger.php page which accepts 'get' requests from client. 3. The checkStatus.php which polls the database for the current door status. 4. An index.html which uses javascript to refresh the icon when the status changes.
About
Code for the Hackerspace Open // Closed switch.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published