Twittering wall switch lets Dutch hackers know when it’s time to play

Hack42, a hackerspace in Arnhem, Netherlands recently moved into some new digs, and they wanted an easy way to let their members know whether they were open or not. Fixed hours of operation typically do not fit this sort of organization, so that was out of the question. Instead, they built a switch into the wall** that will let their members know when they are open for business.

The switch separates the TX and RX pins of two Ethernet ports that reside in an old access point embedded in the wall. When the hackerspace is open, the switch is thrown and the circuit is closed. A cron job checks the state of the eth1 port once a minute, sending the “Open” status message to Twitter and IRC once it notices the status change. When the switch is thrown again and the eth1 port goes down, a “Closed” message is broadcast.

It is a simple but cool hack, and quite befitting of a hackerspace.

**No direct Google Translate link is available, though Chrome will translate it for you without issue.

But using the GPIO line would be too orthodox! I think this is a brilliant example of a “hack”. They make use of the ethernet port for something that it’s not intended for, yet it had everything they needed to sense a stimulus change with some code.

@CutThroughStuffGuy: when the cable is unplugged the port will simply detect ‘link down’, and the status will be set to ‘closed’. If the AP’s uplink is unplugged the state changes can’t get sent to the webserver and the displayed state is frozen.

@Mike Nathan: the AP is not in the wall, we’re just using a wall jack to patch the switch through to the access point.

The switch uses just one ethernet port. When it’s closed, it’s basically a loopback plug

@griffon: I’m now connected through this very access point, and to the AP it’s just another ethernet cable hooked up to it. The switch is about 1.5 meters (5 ft) away, and anyway the baseband frequency of 100bT ethernet doesn’t bother 802.11b/g at all.

Shorting RTS or CTS on a serial port would work just as well and is far easier to code up in bash to do the same thing. Did this years ago to fire off emails to members of a ham radio club that someone was in the shack.

This is really, really smart. It required no special hardware, uses an interface they already had, and doesn’t involve an arduino. A+ would read again!

For over a year, we’ve had a similar setup at our hackerspace, but it uses our network camera’s optoisolated input. (Also uses the relay output to drive an indicator LED, so you know when it’s working.) The camera takes your picture when you throw the switch, which goes on our twitter feed: @i3detroit

@CutThroughStuffGuy: yeah, wiring problems would cause a wrong indication, but it’s hard to see how one could avoid that with a simple setup like this. Reversing the switch action and the check would just change the problem to a false indication of ‘open’ when we’re in fact closed. Also, people could forget to flip the switch (unlikely though, it’s in a very prominent location, and flipping knife switches has that special attraction that is a reminder in itself); the uplink could be down; the webserver could be wonky and twitter could have gone titsup. In short, for the setup and the effort involved, it does a good enough job.

It’s even harder now for the switch to be ignored as part of the space lighting is controller by it. Our ceiling lighting was connected to a Boring Old Switch in the central hallway, and people from other parts of the building leaving would sometime switch it off. Clearly, this was an unsatisfactory situation, so after an evening of wrestling the spaghetti cabling surrounding the fuseboard we had managed to fit two relays there that switched our lighting independently. Those relays are driven by a 555 each, for delayed switching. Also, the second ethernet port on the AP is now also switched through a double-pole relay, with the knife switch controlling the relay and the 555’s