rt_x10 is a realtime kernel driver for the X10 "two way power line interface" (model TM523).
Version:rt_x10 is a realtime kernel driver for the X10 "two way power line interface" (model TM523).
Operating System: Linux
X10 is a protocol for sending signals over power lines. There are lots of relatively cheap components available at x10.com (and other places) that make home automation
feasible for the average consumer.
If you want seamless automation without any glitches, X10 is not for you. If you want a pretty good system that mostly works, and is cheap, then you should give this a try.
X10 as a protocol is pretty awful, but it is at least very well documented (see X10.technicalnote.pdf). X10 signals are fragile, and are frequently garbled.
There is some amount of redundancy in the signal, so it is usually possible to detect a corrupt code, but the occasional glitch still happens, especially when packets collide.
The X10 devices do not respond to query, as provoded for by the X10 spec, so one can only send repeated commands in hopes that the device will eventually be put in the desired state.
You need to start with a "two way power line interface" module (Model TW523), and build a connection circuit as described on page 11 of the X10.technicalnote.pdf.
Attach this to a serial port, tying the 60 Hz "zero-crossing" signal to CTS, the X10 "receive" signal to DSR, and the X10 "transmit" to DTR.
Because of the inconvenient relationship between the two signals provided by the TW523, it is more practical to use real-time polling in software to sample the pulse windows rather than to extend the required interface circuitry by adding logic gates and counters and clocks.
For this, I wrote rt_x10.c. rt_x10.o is a kernel module that works with Linux RTAI. It could be easily modified to work with RTLinux or other similar infrastructures, but RTAI is the best, so give it a try first.
Once the realtime kernel module is installed, it writes X10 codes to /dev/rtf0 whenever they appear on the power line, and when X10 commands are written to /dev/rtf1, the module sends these codes over the power line.
There are two simple userspace example programs that demonstrate reading and writing X10 codes : recvx10 and sendx10.
These should serve as a basis for a userspace program that implements all the timing and logic for specific configurations of sensors, lights, and appliances.