]>
X10 Home Automation Guide for FreeBSD <author>Rich Murphey and Steve Passe</author> <date>November 1, 1995</date> <abstract>This is a brief guide to installing X10 home automation hardware and software. With it &fb can be used to control lights and appliances.</abstract> <sect><heading>X10 Overview </heading> <p> X10 devices communicate over standard household wiring. The most common use is to control appliances and lights. <p> The computer communicates via a two-way power line interface (TW523), which is analagous to a modem. The TW523 plugs in to the wall and looks similar to a wall transformer/dc power supply for a portable radio. It connects via a modular phone cable and db25 adapter to the parallel port. With it the computer can send and receive commands such as ``turn on'', ``turn off'' or ``dim'' or ``select ID#''. Only receivers set to the selected ID will respond to the commands. <p> Receivers such as lamp and appliance modules plug into standard electrical outlets and the lamp or appliance plugs into the bottom of the module. Each module has a rotary switch on front which selects the module's ID. <p> The the tw523 costs about $18. The modules cost around $12-$15. A minimal setup consisting of a lamp module, tw523, modular cord and db25 adapter costs less than $40 at Radio Shack. Caveat: it's unwise to control things like garage doors, coffie pots or anything that could be a hazzard if turned on or left on when unattended. <sect><heading>Installing the Hardware </heading> <p> The TW523 has a modular (4 conductor RJ11) connector like that of a telephone. To connect it to the parallel port you'll need an adapter. Radio Shack sells a ``Modular/EIA Adapter Kit,'' part number 276-1405 for about $3 that works well for this purpose. It looks like a male DB25 connector with a female modular phone connector on one side of the hood. To assemble it all you need is a phillips screwdriver. There are six leads attached to the RJ11 connector, each with a pin on the end of the lead that you push into the back of the DB25 connector as follows: <itemize> <item> Yellow Pin 2 <item> Green Pin 10 <item> Red Pin 25 <item> Black Pin 12 </itemize> There are two extra unused leads that you can simply leave inside the hood. Then connect a modular 4 conductor phone cord from the tw523 to the adapter and plug the adapter into your parallel port. The meaning of the leads is: <verb> TW523 Signal RJ-11 pins color DB-25 pins Parallel Port Transmit TX RJ11 pin 4 Yellow DB25 pin 2 Data Receive RX RJ11 pin 3 Green DB25 pin 10 -ACK Common RJ11 pin 2 Red DB25 pin 25 Common Zero crossing RJ11 pin 1 Black DB25 pin 12 +PaperEnd </verb> For backward compatibility the driver also accepts the zero crossing signal on pin 17 as well as pin 12. However, some known rogue parallel port hardware cannot properly read input from pin 17. During the probe, the tw driver looks at both 12 and 17 to find which pin has the 120Hz signal. So it will handle connectors using either pin 12 or 17 transparently. You don't have to reconfigure anything in the driver if you change pins. See /usr/src/sys/i386/isa/tw.c and the <tt/tw/ man page for for details. <sect><heading>Installing the software </heading> <p> The generic kernel supplied on the &fb CDROM is not configured for the tw523. So you most likely need to reconfigure a kernel with: <verb> device tw0 at isa? port 0x378 tty irq 7 vector twintr </verb> where the value for the port and irq are those of your parallel port hardware. See the <url url="http://www.freebsd.org//handbook/handbook50.html#97" name="Kernel Configuration section"> of the <url url="http://www.freebsd.org//handbook/" name="FreeBSD HandBook"> for more specific instructions on building a kernel. <p> The irq should match your parallel port and your configuration of lpt0. For more flexibility you can list tw0 before lpt0 in your kernel config file and the kernel will detect which device is present upon booting. The tw0 will only probe successfully if it sees a 60Hz signal from the tw523. If instead you have a printer plugged in, the tw0 probe will fail and the lpt0 would then succeed. You do have to reboot if you switch between plugging in the the tw523 and plugging in a printer, but you don't have to reconfigure anything. <p> The transmitter side of the driver is polled, which can be cpu intensive, but this only occurs when you send X10 commands. The receiver side is interrupt driven and thus has very low overhead. So the driver can have a transient impact on performance when sending commands but otherwise should not slow the system down at all. See the <tt/tw/ man page for more info. <p> You will also have to add a device handle to the directory /dev. In FreeBSD 2.1 all you have to do is: <p> <verb> /dev/MAKEDEV tw0 or mknod /dev/tw0 c 19 0 </verb> <p> The tw driver comes with its own daemon, "xten", but that will not be discussed here as it is not intended for use with the RcDaemon package. See the <tt/xten/ man page for more details on this daemon. <p> <sect><heading>Other Sources of Information </heading> <p> The comp.automation WWW home page: http://web.cs.ualberta.ca:80/~wade/HyperHome/ <p> The X10 FAQ: ftp://ftp.scruz.net/users/cichlid/public/x10faq <p> ``X10 Powerhouse Technical Note, The X-10 Powerhouse Power Line Intervace Model #PL513 and Two-Way Power Line Interface Model #TW523, Revision 2.4'' available from: X-10 (USA) Inc. 91 Ruckman Rd. Box 420 Closter, NJ 07624-0420 201-784-9700 800-527-0027 </article>