Ayefon.com

X10 Home Control Installation (cont'd)

Most of the required prompts for input are just the permission to remove the existing partitions on the drive and reformat it prior to the install. I could have automated these too but having a CD lying around that automatically boots and frags your hard drive was not something I wanted to risk without a user explicitly giving permission at least a few times repeatedly! ;-) So you'll have to endure a couple of the usual "Are you sure...are you REALLY REALLY sure prompts. The assumption is that whatever box you choose to use for the full .iso install is going to be dedicated as a wireless web server for your iPhone so it "nukes" the drive and does a clean install. You've been warned.

The install will repartition and format the drive, install a Fedora Core 8 Linux installation with Apache web server and PHP. It will then install the HEYU X10 package and configure it to use the first comm port. At the end of all this you get a congratulatory message asking you to reboot. When you reboot you should have a working Linux Apache web server with PHP installed as the dynamic web scripting language. In addition, my PHP script, icons and other goodies will be preinstalled in the web root and ready to run when you "hit" it with your iPhone.

You only need the CD/DVD reader attached to load the CD for the install. You can remove it for the permanent installation if you wish as it isn't needed for operation.

If you already have your own web server/PHP setup and you want to use this then don't boot the CD. Rather, just copy the heyu package and my PHP script and do your own integration. See the heyu site for the installation instructions.

Whither Wireless?

Let's talk about the network for a minute. If you have your own wireless router already you should be able to just plug this PC into one of your router ports and then access it with your iPhone wirelessly. If you don't have a wireless network or would prefer to have your X10 server "stand alone" then I recommend that you buy a DLink WBR-1310 wireless router. I've seen these on sale at places like Office Depot for $40. I like the DLink because you can configure it directly from your iPhone without needing to plug in a PC. This is because some of the other manufacturers do some strange Javascripting in their configuration pages that isn't compatible with the Safari browser that is built into the iPhone. The WBR-1310 DLink routers are more "middle of the road" when it comes to HTML. However, in most cases you should be able to just plug your new web server right into one of the four client ports on the router and have it work with the factory defaults without any configuration at all. You don't need to run the CD configuration software included with the router to set it up unless you also plan to use the router for more than just this web application. The ultimate goal is that you wirelessly connect to the web server you just built using the iPhone's built in wireless features

Finally, this is a LOCAL network wireless connection. You don't particularly need to connect the "uplink" of the wireless router to the Internet at all. Your call. Just connect to your wireless network with your iPhone and point Safari to http://192.168.0.151/x.php (if you did the D-Link install) or http://192.168.1.151/x.php for the Linksys version. Once you've connected, use the the "+" sign option at the bottom of the screen and select "Add to home screen." You'll get a nice lamp incon on your desktop. You can modify the "apple-touch-icon" href at the top of the script to point to a custom desktop icon (perhaps of one of your own lamps) if you wish.

 


Security

Once you get connected and everything is working, I would recommend that you go back and set the wireless network access password on your router unless you want perfect strangers that are nearby to connect to your "hot spot" and control your lights and appliances! You might find it easier to turn security off while troublshooting. But fundamentally, if your iPhone connects to the router, that's the goal. Your router security doesn't affect the web server because it is on the "inside" connected to one of the router ports.

In essence that's all there is to it. What you are doing is hitting your own wireless web server with the iPhone. That server has my PHP script installed which will execute the HEYU commands on that server to perform any of the X10 control functions supported by the HEYU package and the X10 modules involved. My script just passes the commands through to the HEYU command so while I have thus far only implemented the basic lamp dimmer and appliance controls, you can modify the script as you wish to do anything that HEYU supports. See www.heyu.org for more info. Or, feel free to modify the script to execute different commands of some other X10 command line package that you prefer if you aren't using HEYU. I've deliberately designed the script to be "modification friendly." It's all about having fun and experimenting.

The script is laid out so that you should be able to modify it with a text editor to suit any set of controls and iPhone "desktop" groupings you'd like to have. However, as part of the package if you really need it, I'll be glad to do a one time edit and "customize" the script for your particular home automation setup by changing the titles and X10 module codes as required if you provide a desired list. I'll just email it to you. Out of the box the script comes configured for X10 addresses A1-A16 with the first 12 setup as lamp modules and the last 4 setup as appliance modules. But you can alter this with easy cut and paste using a text editor of your choosing.

I'm also going to have an on-line script builder on this site for customers that have bought this package just as soon as I can get it written. But in the meantime I'm happy to help you with your initial script as part of the service.

Utilities

I've bundled WinSCP2 and Putty to give you a way to easily access and update your server from your other workstations in your home network as desired. I work this way with mine so that I don't have to keep a monitor and keyboard attached. You may have to tweak the bios in your web server's PC to have it ignore the missing keyboard/monitor on boot for so called "headless" mode operation. You can use your favorite SFTP and SSH utilities instead of these for tweaking your setup and scripts. I just wanted to provide some commonly available "freebies" for convenience. The nice thing about Linux is that it comes configured out of the box for SFTP and SSH access. The root userid and password appears on the successful purchase page.

(next)