A Power Switch Remotely Controlled by SMS


This article describes a system, setup to remotely control a power switch via SMS (Short Message Singaling).

The Actor Hardware

The actor side consists of a PC running Linux connected to the internet. Bit 0 of the data lines of the PC's parallel printer port is used to drive a relay switching line power to a connected device.

I used an old external CDROM drive case to install the needed hardware and could use the switching power supply to power the needed interface board and the relay.

dsc_3425_150.jpg dsc_3429_150.jpg dsc_3428_150x164.jpg

The Actor Software

I wrote a small tool in "C", which can control the bits of the PC's parallel printer port.

The Signalling Pipeline

The command to control the power switch goes from a mobile phone sms over the sms - email gateway of the mobile phone network provider (bluewin.ch) to an smtp server receiving all the mail addressed to me.

On that server postfix' forwarding facility (~/.forward) is used to pipe all received email through a filter script written in Perl.

If the filter script finds the email matching a defined set of headers, it writes the important email headers and the email body content to a temporary file and invokes a shell script, which reads the file, decodes the contents of the email and does the requested switching action remotely via ssh.

line
Visitors since 2009-12-03: counter last updated: 2009-12-16
line
This site maintained by:
lukas.zimmermann@unibas.ch
My public PGP key
HOME Valid CSS! Valid XHTML 1.0 Strict