iPhone Home Controller 2.1 Release and XAMPP Lite Tutorial
The 2.1 iPHC release is here. Not too much as far as styling changes but I have fixed some of the html and css. The application now uses jQuery at its core for event handling. This allowed me to, as is the jQuery way, “write less and do more.” The iPHC package should work a little faster now as jQuery can speed things up a bit. If you already have the iPHC system running, you can simply delete the old files and copy in the new ones (leave your connect.php file intact - there is no need to change it). The database settings have not changed so the switchover should be seamless.
For iPHC newbies, here is a step by step guide of how I got the system up and running at my house using Windows XP, XAMPP Lite, iPHC v2.1, the x10 cm15a, and an x10 module for testing.
1. Purchase the cm15a x10 transmitter. You will need at least one x10 module to control as well (also available from x10.com).
2. Install the cm15a driver/ActiveHome interface. (you should be able to download it here or) A link to download it comes in an email after you purchase the cm15a. Plug the cm15a into a usb port that is on the computer you will be installing the iPHC system on. Then plug the cm15a into the wall.
3. Download XAMPP lite. There is a zip file or an exe file to grab. Either one is fine. I placed the main xampp folder in my “program files” folder.
4. Open the xampplite folder and click setup_xampp.bat. After you see the success message you can close the window.
5. Download and unzip iPHC2.1. Copy the iPHC2.1 folder and paste it into the xampplite\htdocs folder.
6. Go back into the xampplite folder and click xampp_start. This should start mysql and apache. Leave the window that opens, open. Only use xampp_stop to stop mysql and apache. (Note: When I tried to start mysql and apache I got error messages with apache. In my case I had to add the file “msvcr71.dll” to the xampplite/apache/bin folder.)
7. Open a browser and type localhost into the address bar.
8. You should see the XAMPP welcome screen. Choose your language.
9. You can check the status of the install by clicking on status. Then click security.
10. Setup name and password for mysql and to secure your htdocs folder. This is essential if you are going to connect your system to the internet.
11. Copy the xampplite\phpMyAdmin folder and paste it into the xampplite\htdocs floder.
12. Go to localhost/phpMyAdmin in your browser and log in using the mysql name and password you had set up earlier. If you see a mcrypt error you can ignore it or follow the instructions here to get rid of it. You will have to restart xampp and log back in to see that it has been fixed.
13. Create a database called fonhome in phpMyAdmin.
14. Select the database you created and click import. Select the fonhome.sql file that is in the iPHC2.1 folder and upload it.
15. Locate the connect.php file in your xampplite\htdocs\iPHC2.1 folder and open it using a text editor or html editor. I use PSPad. Change the user name and password to the ones you had set up for mysql earlier and save the file.
16. In your web browser go to localhost/iPHC2.1.
17. If everything went well you should be able to see the interface and utilize its functions. Select admin at the top of the screen and use the form to add a new module. Name and enter the address of your test module and click add. Go to the modules screen and try turning on and off the module you have just added.
18. To get this going on your iPhone you need to find out your IP address. If you don’t have a router with a firewall or anything else in the way like an internal firewall then you should be able to paste this IP into your browser address window and get to the main XAMPP page. In my case I do have a router and have to open up port 80 on it as well as set my computer’s firewall to allow apache and mysql. You will have to search on how to do this for your specific router and firewall setup.
19. If everything works out you should be able to enter your IP address/iPHC2.1 in your iPhone browser (or any other web enabled mobile device) and access your system.
If there are any questions or comments let me know. I’ll add more as I keep testing.
Tags: ActiveHome Pro, iphone, jquery, x10

67 Responses to “iPhone Home Controller 2.1 Release and XAMPP Lite Tutorial”
February 22nd, 2009 at 1:58 pm
The upgrade worked with no trouble.
Thank you.
March 5th, 2009 at 5:51 pm
Do you have to use Apache or could you be running IIS?
March 5th, 2009 at 6:08 pm
@x:faktor
As long as you have PHP going the system will work. I’ll have to remember to mention that in the tutorial. Thanks!
March 19th, 2009 at 7:18 pm
Chuck,
I’m using IPHC on my iPod and it’s awesome, however I want to expand it to one of my mac’s, basically what I want to do is teach the map to W GET a url, via voice command, I can handle the AppleScript side of this, but what is the syntax I can call on the iphc to access certain things? Ie, if I said “Vicky, turn on kitchen overhead” she (Mac is named Vicky, as thats the name of the TTS engine) would W GET http://server/iphc/ihopesomething.php?node=A1&command=on?
Thanks!
March 19th, 2009 at 10:34 pm
In case anyone else wants to know, chuck and I have confirmed that calling the IPHC-process.php in this manner:
http://server/iphc/IPHC-process.php?q=A1+on
and
http://server/iphc/IPHC-process.php?q=A1+off
Will allow you to control devices without the interface in case you wanted to write your own scrips using the IPHC backend.
April 5th, 2009 at 5:17 am
Hi Chuck,
I took what you told chris to do and decided to try it myself.
http://server/iphc/iphc.php?node=A1&command=on
I copy and pasted the changes you mentioned above and it didn’t work.
Is there another change that needs to be made?
Thanks!
AJ
April 5th, 2009 at 11:30 am
@AJ
Change the code in the iPHC-process.php file you switched back to what it was originally.
Check Chris’ other comment and use that code. It will work except the logic will be reversed (off will be on…). To make it work correctly in this case you would have to edit the iPHC-process.php file on lines 54 and 60 and change “on” to “off” and “off” to “on”.
April 12th, 2009 at 5:27 pm
Does this work on a linux box with apache mysql and php?
April 13th, 2009 at 1:22 pm
@Michael
As far as I know, yes, it should. You will have to be able to install the driver for the cm15a on it though.
April 17th, 2009 at 6:01 pm
@chuck .. I’m not too savvy with linux yet .. I’ve installed ubuntu on my server computer .. the one that works on PHP with apache on windows works fine .. but I have no idea how to do this for ubuntu .. I might write a step by step process if I collect enough information on here on how to do this .. pretty much from the first steps of installing ubuntu to getting the x10 driver working with the module and the interface here from this website to work with PHP ..
April 17th, 2009 at 11:38 pm
How hard would it be to add a refresh feature?
One which would query the light status and update the webpage accordingly (ie: kitchen light is already on, so the corresponding module should be highlighted)
April 21st, 2009 at 1:36 pm
Do you guys sometimes get the message (on vista):
X10 ActiveHome Scripting Commandline stopped working and was closed
The lights still close/open fine, but this message is somewhat annoying.
April 21st, 2009 at 2:27 pm
@Gabe
Light modules (at least the ones I have) are not two way. They cannot be polled. If you have some that are let me know what kind and I will look into 2 way communication.
Also, I do not have vista. Maybe it has something to do with the ActiveHome software? I am not sure if it is vista approved or not.
April 21st, 2009 at 2:28 pm
@Michael
Sounds good.
I think there is a Linux version of XAMPP That would be a good place to start. If you are having a hard time I can have some of my Linux nerds look into this. Let me know.
If you do put a tutorial and wouldn’t mind having it posted here please let me know as well.
Thanks!
May 2nd, 2009 at 12:13 am
Thanks Chuck, after some exhaustive research online and some lightspeed learning of Ubuntu, I think I have found some serious preliminary work done, that’s modestly recent (December 2008) as opposed to some outdated work from 2005 by neil cherry.
Ubuntu Server Edition already comes prepackaged with a similar *AMP installation and it’s all up to date.
As for my documenting, I will only be addressing how to get the right drivers, installing any additional library packages on a Linux system, and providing the modified code of the iPhone AJAX interface to work with the drivers for the CM15A module on Linux.
I’ve already started with the process as I come across things and documenting it.
May 3rd, 2009 at 12:44 pm
[...] guide to getting the X10 CM15A USB module to work under Ubuntu, and then to further get the iPhone Home Controller web-based interface to connect the [...]
May 6th, 2009 at 10:42 pm
X10 Home Automation (CM15A USB Module) + Linux (Ubuntu SE) + Eclipse Home Automation CM15A Drivers + iPhone Home Controller = SUCCESS!!!
May 6th, 2009 at 10:45 pm
Chuck can you email me?
I have a completed process with modified files and an entirely written step by step guide on how to do this (under a protected post on my blog) but need to coordinate with you first before I go live with this.
May 9th, 2009 at 2:46 am
Well… okay…
I’m somewhat new to AMP… but:
Ive got windows 7 beta IIS and AMP running.
I had to change the port to 8080 and got localHost:8080/iPhC2.1 to log into my MySql instances fonehome DB… all seems to be set up….
So… my hardware did not ship with a cd… I downloaded the driver from: http://www.x10.com/support/support_soft1.htm
the driver: ftp://ftp.x10.com/pub/applications/drivers/x10drivers_6432_239.exe
which says it even works for windows 7…
I’ve just never set up X10 before. I have something called a socket rocket, which does not have dials; it’s for a light.
It says if you plug it in and toggle the on off with your software it will adopt whatever code is toggled on and off within 30 sec of getting powered up.
But I have nothing… Any advice?
May 9th, 2009 at 9:40 am
Would it be possible to run it on a NAS with a webserver on it like the Synology?
I think many Synology users would love to be able to control a home with this feature!
I have the app running but I don’t know if it is possible to connect to a X10 device like a CM15
May 11th, 2009 at 10:41 am
@sean
I have had problems with the socket rocket not cooperating, I currently don’t use mine at all. That module may not be functional.
As far as the program, if the buttons change color when you hit them then iPHC is working fine…
If not let me know.
May 11th, 2009 at 10:45 am
@w.korsten
It seems like synology supports PHP and MySQL so yes I don’t see why this system wouldn’t work. The one question I cannot answer is if it would support the x10 hardware…
August 11th, 2009 at 1:12 pm
Hello,
I’m grench and i tried to follow the tutorial. All is fine except step 13. When i tried to import the fonehome.sql, i had an error (see below).
The step 15 give : Unknown database ‘fonhome’
Please HELP !
Thanks
Patrice
Erreur
requête SQL:
–
– Table structure for table `modules`
–
CREATE TABLE IF NOT EXISTS `modules` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`name` VARCHAR( 50 ) NOT NULL ,
`type` VARCHAR( 20 ) NOT NULL ,
`addressnum` INT( 2 ) NOT NULL ,
`addresslet` VARCHAR( 1 ) NOT NULL ,
`status` VARCHAR( 20 ) NOT NULL ,
KEY `id` ( `id` )
) ENGINE = INNODB DEFAULT CHARSET = latin1 AUTO_INCREMENT =36;
MySQL a répondu:
#1046 - No database selected
August 31st, 2009 at 6:24 pm
I have installed and using on my G1 perfectly too, i will also try and test it on a BB and Windows mobile next tile i get the opportunity, but I see no reason why it would work.
Love this, finally something that just works without stupid dll’s and ActiveX.
September 5th, 2009 at 2:34 pm
Hello,
I follow all the tutorial and i succeded in having the page on my iphone but when i click on the module to switch on the x10 appliance with A1 address, nothing happend !!!
Have I to keep Active Home switch on ?
Please do you know what could happend ?
September 19th, 2009 at 3:30 pm
If you’re following these instructions exactly on a new install like I was, you’ll need another step just be #13.
-> Go to phpMyAdmin and create a new database named “fonhome”
October 22nd, 2009 at 11:39 pm
Will this work with the CM11A X10 interface (the older, serial one)? I was going to just try it but that’s a lot of work to find out it’s not compatibile…
October 25th, 2009 at 3:26 am
Hi, Thanks for the guide, this is exactly what I’m looking for (web-based X10 control). I’ve gott the web interface up on the browser, but then I get a javascript error when trying to add a module, similar to Francois. Any suggestions?
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Sun, 25 Oct 2009 07:23:21 UTC
Message: Object expected
Line: 2
Char: 1
Code: 0
URI: http://localhost/iphc2.1/js/iphc.js
October 29th, 2009 at 12:48 am
I’m having the same issue as Francois. I can install apache and mysql with XAMPP, but after the site is up, I can’t make changes. I get the following error in IE:
Line: 3
Char: 1
Error: Object Unexpected
Code: 0
URL: http://localhost/iPHC2.1/
October 29th, 2009 at 9:32 pm
Followed instructions but decided to install PHP with IIS7 on Win 7 (PHP requires cgi module also enabled in IIS) plus MYSQL. IIS application pool, that PHP site is using needed to be given additional rights to launch local services (can be modified via run> dcomcnfg and look DCOM config application name “x10nets” and give rights for Launch and Activation). You can find application and account guid in windows log aswell.
Works perfectly now!
November 2nd, 2009 at 7:33 pm
Hello, Thanks for the guide and the program. I got the same javascript error as Martin and Francois (in IE). I think the problem is that the javascript code used by IPHC2.1 only works with the Safari browser. After I installed and used Safari and the problem was over. When you use the IPOD/IPHONE to add a module, the error will also not occur. Maybe this addition could be added to the guide?
November 6th, 2009 at 10:27 pm
Thanks Jos, with safari the website is working perfectly. Internet explorer seems to be the only bad actor (MS not playing nice with javascript). I’ve confirmed it works on Opera, Firefox, Chrome, Safari, and the default browser on android phone (Chromium?).
November 29th, 2009 at 12:22 pm
Windows 7 64 bits with CM19a works fine.
Fews problems:
I had was downloading the package and it was corrupt (when I was installing it .exe, it stopped and said one of the files is corrupt) just try downloading a different package (I used the .exe)
Install the drivers for the CM19A just because it works with firecracker doesn’t mean it is going to play nice with all the other problems.
http://www.x10.com/support/support_soft1.htm
When you test it, in the cmd prompt uses these commands.
ahcmd.exe sendrf a1 dim 50
ahcmd.exe sendrf a1 on
ahcmd.exe sendrf a1 off
So you are going have to change the code from: sendplc to sendrf in the IPHC-process.php
Done and it works great.
February 25th, 2010 at 2:28 pm
I have trying to reinstall this repeatedly, but whenever I go to http://localhost/iPHC2.1 I get an Object Not Found error. What do I do wrong?
February 25th, 2010 at 2:40 pm
@gerhard
I suggest you go through the tutorial step by step and make sure you have not missed anything. It seems that you are not putting the iPHC2.1 folder in the correct place.
If you can go to localhost and do not have any problems then it is most likely what I stated above.
February 25th, 2010 at 2:50 pm
Thanks for your quick response. I checked again and it is in E:\Program Files\xampplite\htdocs\iPHC2.1. That is correct, yes? Bringing up http://localhost/phpMyAdmin works fine …
February 25th, 2010 at 2:59 pm
Here is the complete error msg:
Not Found
The requested URL /iPHC2.1 was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 Server at localhost Port 80
February 25th, 2010 at 3:07 pm
Does this need to be on a root drive C:\ ?
February 25th, 2010 at 3:24 pm
@gerhard
I always use drive C but if you can access phpmyadmin the you should be fine. I would try changing the name of the iPHC folder. If that does not work I would make a new folder in the htdocs folder and put an index.php page in it with the word test on the page and try to access that. Other than that, I am really not sure what the problem could be.
February 25th, 2010 at 3:31 pm
I got it to work. I had to reinstall everything after a hdd crash. I could save all the files related to this. Which file contains the database I built? Can I just copy it over the new file?
February 25th, 2010 at 3:34 pm
if you did not dump the database to a new file then you lost that info in the reinstall. you will have to re-start with the sql file included in the iPHC package.
February 25th, 2010 at 3:46 pm
I still have the backup of the old HDD - there is no file I can take from there and copy to the new HDD?
February 25th, 2010 at 4:17 pm
not that I am aware of, the data must be somewhere but I am not sure how you would retrieve it.
February 28th, 2010 at 6:07 pm
As requested in previous posts i would also like to see the status of a module. As i found in other posts about the sdk it seems possible to use the gueryplc command to get the status even for 1 way devices. http://forums.x10.com/index.php?topic=7851.0 to bad the link for the x10diehard post is no longer available but i did request dbemowsk for the dll. i will try myself to get it to work but i am not a genius in php / ajax etc.
March 12th, 2010 at 10:06 am
@Andre I looked up the sites you referred to and even checked archive.org for the info but the download was gone. If anyone can provide a version that does have queryplc working I would be happy to immediately include it in this program.
April 5th, 2010 at 9:28 pm
This works perfectly except for few issues:
a) The website does not work properly with IE. I haven’t tested with other browsers because I will use it only with iPhone. I tested with Safari and it works like a charm.
b) There are only A-D house codes. I had to add up to P in the index.php manually. Now I can use all 16 house codes and 16 device codes.
c) There does not seem to be any password to access the website. Anyone on internet can get access to the website and add/delete modules and turn on/off lights. Is there a workaround to put a password?
Thanks…
April 6th, 2010 at 10:05 am
@arun
- iPHC does not support IE. I could go in to how horrible of a browser it is but lets just leave it there.
- Thanks for bringing the letter codes (and the lack of them) up. i’ll make that change to the program.
- You can password protect your pages in many ways, including using the htaccess file http://www.javascriptkit.com/howto/htaccess3.shtml
April 6th, 2010 at 8:18 pm
Thanks Chuck. I myself do not use IE at all but just felt lazy to install Safari on a new PC. I was not at all complaining about lack of support for IE.
Since I am not a programmer, putting the password in was a bit of a challenge but using the website you provided and some Google search, I was able to provide at least some level of protection to the website.
I found that the password generated by Apache utility htpasswd.exe works but the one generated by the utility on the javascriptkit website does not work. I kept getting a password mismatch error in Apache logs. Finally I used htpasswd -c -b .htpasswd , I was able to generate .htpasswd file with right password.
Your program works very well.
Thanks…
Arun Gupta
April 7th, 2010 at 9:40 am
@arun
I suggest Chrome or Firefox for PCs as Safari on a PC is glitchy (at least for me). Anyway the reason there is no password protection that comes with iPHC is because the user (you) are opening your computer as a server. Doing this without adding security is a big no-no. So as is stated in the guide it is best to secure your server right away. When I can i’ll add appropriate links to simple guides on how to do so. (I know the htpasswd thing is kinda tough to work out, I have had similar issues. Glad you figured it out!)
April 20th, 2010 at 1:11 pm
Great, lovely beautiful!!!
Exactly what i was looking for. I started bringing my AHP to the web, so had already build my XAMPP site with joomla. This is a great extension. I just need to dig into this to see how i can integrate it with my existing site.
Thanks
Paul
May 9th, 2010 at 6:35 pm
I am currently porting this (with a better interface (no offense)) to the iPad. This should turn out REALLY nice!
June 19th, 2010 at 6:48 am
I’ve been reading this thread and preparing to try this all out, and realized that this whole install (linux + drivers + XAMPP + iPHC) could really just be packaged as one virtual server install. Has anyone tried this?
This would seem to be able to get everyone on the same code releases regardless of what their underlying OS is.
Here is a similar example of a virtual appliance http://www.vmware.com/appliances/directory/86653
Thanks,
Shawn
July 5th, 2010 at 1:41 am
Hello ,
1st) Sorry for my english i’m frensh and i know my english are bad … :-p
2nd)so , i have install IPHC 2.1 on windows 7 , following all of the step of this tutorial and i’ts doesn’t work at the first time i tried it …
but i know why :-)))
i install the SDK of active home and after evrything are good .
The ahcmd doesnt send anything if you use it like this i guess … you just have to install the sdk and that’s work
Thank’s for this software
Mike.
July 23rd, 2010 at 10:11 pm
Will this work with the CM11A X10 interface (the older, serial one?
I have all the steps done and was wondering if it will work with the Serial one as well.
Does anybody have it working?
Thanks Jeff Bakker
August 2nd, 2010 at 5:28 pm
Hi
When I checked ’status’ I got ‘DEACTIVATED’ for
1) MySQL
2) Apache::ASP
3 perl with mod_perl
I’m using Win7 | IE8
/localhost/iPHC2.1 shows but I cannot add any modules
Thanks
Henri
August 2nd, 2010 at 6:27 pm
Installed Firefox and iPHC2.1 looks fine now. Instlled/added a few of my modules, but noe worked. Plugged in CM15A and test module AM12 very close to PC, but with zero result. Can you advise?
Thank you.
Henri
August 2nd, 2010 at 6:29 pm
Forgot to ask - does your software only work in the USA (110V-60Hz v. 220-240V-50Hz)?
August 2nd, 2010 at 6:48 pm
This is a hardware situation. See the specs on the activehome module.
August 9th, 2010 at 11:41 am
Hi
can I use the same process for a Mac OS?
Vav
August 9th, 2010 at 11:49 am
i think the driver is for PC only.
August 9th, 2010 at 4:14 pm
I don’t understand: “This is a hardware situation. See the specs on the activehome module.” All X10 units (240V 50Hz) work fine in Ireland - jsut checking if your output signals work over European domestic lines.
Thanks
Henri
August 9th, 2010 at 4:18 pm
The output signals are sent from the ActiveHome cm15a module so if there are concerns in this area you would have to ask the manufacturer. iPHC is a web interface that sends signals to the module internally. So, as long as you have the correct software on your computer iPHC would work just fine in any country.
August 9th, 2010 at 5:08 pm
Hi Chuck
what if I want to control the cm15a from a Mac in a similar fashion
what module would I need ?
Vav
August 9th, 2010 at 5:42 pm
@Vav
You would have to run windows on your mac
http://www.applematters.com/article/three-ways-to-run-windows-on-your-mac/
August 10th, 2010 at 9:27 am
Hi Chuck
thanks a lot for the quick reply.
I have successfully installed your application and used it through an iphone
but I want it to look like an iphone app( like to have a iphone app symbol for this , which open the page when I click on it) and also when I open the application I do not want the ip address to show up in the browser tab . Is there anyway I could achieve this.
I am new to all this .your help is really appreciated.
Regards
Vav
August 10th, 2010 at 10:08 am
You can make an icon for it by bookmarking the page.
As it stands right now there is no way to remove the ip address as the whole system works inside of safari.
August 10th, 2010 at 10:14 am
thank for the info chuck
Leave a Reply