Guide: Web-based control of X10 Home Automation (CM15A) on Ubuntu Linux

I have stopped using this home automation technique and can no longer support this guide.

Here is a step-by-step guide to getting the X10 CM15A USB module to work under Ubuntu on a personal home computer, and then to further get the iPhone Home Controller web-based interface to connect with that module. For those that know what all that means, great! For those that don’t, well in the simplest of terms, it allows me to turn the lights in my house on/off or dimmed – just by accessing a website via my iPhone or computer.

This process requires several different packages of files and programs, etc. so follow the steps very carefully!

I use the sudo command a lot in the Terminal, go here to find out what sudo does, and means.

Step 1:

You need to have a flavour of Linux installed on your PC with Apache, MySQL and PHP setup correctly. I used the Ubuntu Server Edition (Jaunty Jackalope). If you are unsure of how to set this up I suggest reading up about it here first (this is a guide for the previous version of Ubuntu, but should still apply to the current version).

NOTE: Please write down ALL of the passwords and usernames you make/use in the installation process of Ubuntu as you will need these to perform certain commands and/or access certain applications throughout the rest of this guide.

Step 2:

After you have installed Ubuntu Server Edition, you may not be savvy with a command line interface for operating the system. As servers go, it’s not recommended to run a GUI on them, however if it makes it easier for you (and it did with me in this process), venture here to learn how to install one.

Step 3:

Unfortunately, I still recommend using a command line interface to compile the drivers and the interface, so get to know the Terminal application within the GUI (under the Ubuntu OS menubar: Application > Accessories ). It will allow you to run commands and install additional applications down the road.

With that said, you need to now install the latest sources of the gcc compiler library. Load up Terminal and type the following at the command line and press enter:

sudo apt-get install gcc build-essential

If this command asks you to enter the password (as it did with installing the GUI for Ubuntu), then enter it.

Let the computer do its thing, and if it asks to install a certain amount of megabytes of programs, agree to it and continue.

Step 4:

Once that is all completed, you should now be all set up to start installing the drivers and controllers.

There are a number of attempts at people trying to program a driver to communicate with the CM15A USB transceiver out there, but the only one that seemed to still be actively developed (as of today), where the developer actually managed to work with me on the implementation, and whose programming code I had the pleasure of compiling successfully was/is by Jim at Eclipse Home Automation. His controller requires the stabilized USB library and also the Compatibility layers required for the USB library. The controller interfaces with the USB library, which in turn sends commands to the transceiver.

Load up your browser (the default browser in Ubuntu is Firefox) and download the following files to your desktop on Ubuntu:

libusb-1.0 from Sourceforge

libusb-compat-0.1 from Sourceforge

Jim’s CM15A demo controller from his site

Step 5:

After those have been downloaded, you’ll see a number of tar.bz2/tar.gz files on your desktop. These are compressed files packages that contain the driver libraries and controllers. Decompress these packages by double clicking on them and extracting the files to appropriately named directories (aka “folders”) for each package so as to not merge their contents with each other.

Step 6:

Now within Terminal, navigate to the directory that contains the libusb-1.0 files.

Within the Ubuntu GUI, you can use Nautilus (a similar application to Windows File Explorer or Apple Mac’s Finder) to see all of the files within the directory on your computer, however some tasks cannot or should not be performed with Nautilus. Go here for tips on how to navigate the files and directories in Terminal).

Within that directory you should have a series of sub files and sub-directories related to the USB library. We need to now configure, build and install this library. To do this begin typing this at the Terminal command prompt:

sudo ./configure

Once that has been completed, type the next command:

sudo make

And after that has completed, install the library with this command:

sudo make install

Step 7:

In my case, all three previous commands performed flawlessly. So the next step is to install the compatibility layer for the USB Library. Navigate in your Terminal to the directory that contains your extracted compatibility layer files. And again, you should notice another set of files and directories that contain the source files. To install the compatibility layer, we perform the exact three same commands in Terminal as we used for the USB library:

sudo ./configure

After completed, type the next command:

sudo make

Now install:

sudo make install

Step 8:

With any luck, Step 6 and 7 should have installed the USB library. Now it’s time to install the CM15A controller. Navigate in Terminal to your directory that contains Jim’s CM15A interface controller source files. All we have to do is compile the source files for this one, and this can be done by typing at the Terminal command prompt:

sudo make

The compiler will create a new file called cm15ademo within the same directory as the source files. Check to see if it is there by doing a directory listing ( dir ) at the Terminal command prompt. If the file is there, then everything worked properly. If not, I would see to make sure you are in the right directory and I would review all of the previous steps just to make sure you followed everything I’ve outlined here.

Step 9:

Congratulations if everything above went properly, you’re computer should now be able to start sending commands to the CM15A transceiver to turn on/off/dim the lights!

Before we any further, we should test to see if all of the steps above were performed correctly. If you know the dial-code for some of the plugged-in light modules/switches in your house and have your CM15A USB transceiver plugged into your computer and into an electrical outlet, then lets begin by testing a couple commands on the interface at the Terminal command prompt – the format for this is as follows:

sudo ./cm15ademo xx cmnd

Where xx stands for the dial-code of the light module/switch. In my case most of my modules are set up as:

a1 a2 a3 a4 a5 a6 etc.

The cmnd stands for the commands you can send to the light modules as follows:

on
off
dim ##
bri ##

In the case for dim and bri, the ## represents a unit of decrease or increase (out of 100 units total) to the brightness of the light.

So in my case, to turn on my kitchen ceiling lights I would use the following command:

sudo ./cm15ademo a4 on

To turn my kitchen lights off I used:

sudo ./cm15ademo a4 off

To dim my kitchen lights by a degree of 40 units:

sudo ./cm15ademo a4 dim 40

To brighten my kitchen lights by a degree of 10 units:

sudo ./cm15ademo a4 bri 10

Try modifying the codes above and turning on and off your light/switch modules in your house with the above command.

Step 10:

Step 9 should confirm that your computer is communicating with the CM15A USB transceiver. We can now install the iPhone Home Controller (iPHC) web-based interface.

Because the iPHC was scripted to run on a Windows-based system with the Apache web server with MySQL and PHP (aka WAMP or XAMPP Server), I had to make some small modifications to the scripts to get it to work on Ubuntu’s Linux web-server (LAMP). I have packaged up my modifications into tar.bz compressed file that you can easily download from my server with your web browser:

iPHC zipfile

You can use Nautilus to find and decompress this zip file into its own directory (aptly named “iPHC”).
Now within the iPHC directory you should see three sub-directories and a bunch of php files. You need to place the main iPHC directory onto the system file-tree that Apache serves the web pages from. The default location for the Apache file-tree on my Ubuntu installation was found here:

/var/www/

And your iPHC directory of files should copied to and reside here:

/var/www/iPHC/

You can change the name of your iPHC directory to whatever you like, and for security reasons, I suggest that you later change it to a different name altogether.

Step 11:

iPHC is a wonderful little web-application that allows us to create list of buttons for all of lights within your x10 house configuration and name them appropriately. It remembers all of the names and the dial-codes of the light-modules by storing that information in a database within your web-server’s MySQL. Now you don’t have to know how to install MySQL (as it should be already installed and configured with the Server Edition of Ubuntu), but you will need to install PHPMyAdmin onto your server so that you can easily configure the database for iPHC.

To install PHPMyAdmin onto your system, go to your Terminal and enter the following:

sudo apt-get install phpmyadmin

Now you should be able to log into your PHPMyAdmin from your web browser by visiting this address:

http://localhost/phpmyadmin/

In my case I had to set up the access users for PHPMyAdmin, and initially started with the username root – I left the password blank and logged in. Later I created a password for the root account so that no-one could log in without knowing my password for the root user. As well, I also created a new user to separately access the iPHC database and that would have administrator permissions to create databases and access them. You can use the username iPHC and set a unique password that is different from the root user’s password you just set (for security purposes). Don’t forget to write your iPHC username and password – you will need this shortly.

If you have any problems with installing, logging in or setting database permissions with PHPMyAdmin, the following three links may help glean some helpful tips:

PHPMyAdmin Documentation on Ubuntu

Forum Post re PHPMyAdmin Initial Login

User Management and Authentication on PHPMyAdmin Wiki

Finally, make sure you log out of root user in PHPMyAdmin when you are done setting it up.

Step 12:

Now log into PHPMyAdmin using the iPHC user and password. You should see a menu along the top.

Click the button that says “Import”.

We are now going to import the fonehome.sql file within your iPHC folder within the /var/www/iPHC directory. Let PHPMyAdmin import the file with the default settings on that import page.

Completing that means that we have successfully set up the database for iPHC, and you can now log out of PHPMyAdmin by clicking the little square “Exit” button under the PHPMyAdmin logo on the left of the webpage.

Step 13:

Now we need to connect the iPHC web-interface to the database we just created in MySQL. To do this we need to edit the connect.php file within the iPHC folder at /var/www/iPHC/. Type the following command at the Terminal prompt and press the Enter key:

sudo gedit /var/www/iPHC/connect.php

This should momentarily bring up a new application on your screen. This program is called GEdit, and it is a simple text editor that is useful for editing text files and PHP script files.

You will notice the content of this PHP file look somewhat like the following:

 

 

Change the text YOUR USER NAME and YOUR PASSWORD with the ones you created in PHPMyAdmin for the iPHC database. Save the file and close the GEdit application.

Step 14:

If everything so far has been completed properly you should be able to see the iPHC web-interface and utilize its functions by visiting the following address:

http://localhost/iPHC/

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. Once you have entered all of your modules, you may notice them also show up in a list when you select module at the top of the screen too.

Don’t get too excited, they don’t work quite yet! We have one last step to perform before they are operational.

Step 15:

One of the best parts about Linux, is the amount of security that is embedded into the system. It can save people a lot of headaches because they aren’t normally allowed to change or run certain files on the system and make mistakes that might cripple the computer/server altogether. Only users that are administrators can temporarily operate as a super user (also known as the root user) and access and run anything.

Unfortunately this also makes it very hard for our iPHC web-interface running on Apache, to access and use the cm15ademo controller application we compiled earlier. Why?!? Because the Apache web-server in Ubuntu doesn’t run as a root user (for good reason), and we need invoke the commands on cm15ademo as a super user.

One might think, “well why not just use sudo???” Well, aren’t they smart!!! But there’s a hitch: sudo asks for a password when it is invoked from a shell command, and PHP is not programmed to create a command-line session so that it can provide a response/reply with the sudo password.

Fortunately, there is a way to use sudo without having to provide a password in Linux – AND if configured correctly, you can specifically limit a “password-less” sudo command to which users, from where on the network, to which folder on the system and on what application.
This is done by modifying the sudo users (aka sudoers) list, by accessing it with the Terminal application called visudo.

Let’s begin by typing the following in your Terminal prompt:

sudo visudo

The Terminal screen will then change content that takes up the entire Terminal window. In this screen is a list of codes that comprise the default sudo users list, as follows:


# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

We need to add the following code to the line below the root user privelege specification:

www-data ALL=(ALL) NOPASSWD: /var/www/iPHC/cm15ademo

And your file should look like this:


# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

Defaults env_reset

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL
www-data ALL=(ALL) NOPASSWD: /var/www/iPHC/cm15ademo

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

Make sure that you DO NOT modify anything else!! Now quit visudo by pressing the keyboard keys CTRL and x at the same time. Visudo will ask you if you want to save the modified buffer, and type ‘y’ or yes, then hit enter twice.
Visudo will return you to the Terminal command prompt and if there were any errors it will tell you in the above lines in Terminal. That means that you did not enter the above information correctly and will have to redo the above step to fix it.

I’m going to hear some flack from someone out there, that this way is very risky if not implemented properly, and why not use some other PHP method like suPHP. The problem is that suPHP is known to take a huge performance hit on the system being up to 25 percent slower. The “password-less” allowance for sudo in my implementation restricts the Apache user www-data to the specific location and specific file of cm15ademo on the server, and nothing else.

As well, if your apache installation is running a different user other than www-data, you can find that out typing ps -ef|grep -v root|grep apache all in one line at the Terminal prompt, noting the the name of the user running instances of Apache on your system. From this you will have to change the www-data to the name of that user.

Step 16:

Okay.

You’ve made it this far, and I hope you have had luck following this guide from Step 1 through 15, and that it took you a fraction of time it took me to figure this all out.

Load up the following link:

http://localhost/iPHC/

Go to the ‘Modules’ page of the iPHC controller. Click the center buttons of the modules that you have listed in your house to turn off and on your lights, and the side buttons to dim or brighten your lights.

Step 17:

>Portions of Step 17 & 18 are reused from the iPhone Home Controller Website<
To get this to work on your iPhone you will need to find out what IP address your computer address has.
At the Terminal prompt type the following:

sudo /sbin/ifconfig

It should provide you with your IP address on your computer. Go here to find out more information on deciphering the IP address from all that mumbo-jumbo spit out with the /sbin/ifconfig command.

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 the IP address you found above into your browser address window to get to the main Apache homepage that your computer is serving.

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 perform a search on Google for your specific router and firewall setup.

Step 18:

If everything works out you should be able to enter the your IP address with the iPHC sub-directory in your iPhone’s Safari browser (or any other web enabled mobile device for that matter) and access your system.

For example, it may look like the following:

http://192.168.1.34/iPHC/

In Conclusion

I hope this worked out for everyone interested in setting this up. This took me a while to figure out and a lot of thanks goes to Jim for providing the LibUSB connector to operate the CM15A USB device.

fin

Comments

45 responses to “Guide: Web-based control of X10 Home Automation (CM15A) on Ubuntu Linux”

  1. Andrew Avatar
    Andrew

    You’re a mad scientist! Congrats on doing it!

  2. Mike Avatar

    I just found out that there is a problem with the all off and all on commands within the iPhone Home Controller code. I am investigating this with the cm15ademo programmer to see how this can be resolved from an connection standpoint. Will update the files soon.

  3. Dimis Avatar
    Dimis

    Hi, I tried to follow this nice step by step guide, but unfortunately Jim’s demo app was not found. (Address not Found)
    Any ideas?

    1. Mike Avatar

      The first link in the body text of Step 4 sends you to his website, from there you have to download his Simple Demo Application, it’s the third link at the list at the bottom of the page. Unpack the tarball file.

  4. Corey Avatar

    I found your blog on google, and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.

    1. Mike Avatar

      Thanks Corey for following!

  5. Vincent Demay Avatar

    Hi,
    good job

    just a point Eclipse Home Auto domain’s name changed is now : http://www.eclipsehomeauto.com

    so the simple demo can now be found at http://www.eclipsehomeauto.com
    /cm15a/cm15ademo.tar.gz

    thx

    1. Mike Avatar

      I fixed the links in this post just to make sure they now go to eclipse home auto.
      As for the other thing .. I cannot load the link up for the french boutiques site.

  6. Vincent Demay Avatar

    Hi again 🙂

    I’m locking for something in order to do the same think as you did under ubuntu. I’m french, so i’m loocking for a french vendor, I found out this one http://www.boutique-habitatmalin.com/controller?form-name=Id&action-name=site.ConsultProduit&id=95&rub=50 but the module name is CM15 and not CM15A, do you think the driver will work with it?

    (I’m sorry the link it is in french)

  7. Brad Avatar
    Brad

    Holy smokes it worked! I just needed the initial part about interfacing with the CM15A, but I’ve been looking for a way to do that for years! THANK YOU!

  8. Damir Avatar
    Damir

    I have one question: do you experience certaine time-out effect, i.e. after I succesfull send command every other command sent in next cca 15 seconds dont work. After that it works again, and so on

  9. Mike Avatar

    Sometimes there is a delay from when I click button, to the time that the light goes on. I always thought that the delay (maybe 1-2 seconds max) was based on the speed of my computer – my setup is running on a Intel Celeron 2.53GHz – it’s not even a dual core system!

    But I am able to quickly click the buttons, and turn lights on, off and dim in succession. I especially quickly click repeatedly on the dim buttons to dim the lights which after a short delay the light dims one level up or down, and again, and again, often within a couple of seconds, etc., etc.

  10. Louis Avatar
    Louis

    Hi,

    I’ve been following the steps of your guide and everything is working great (I can even control my lights from the command prompt, very cool !) until I get to step 10. The link to the iPHC Tarball gives an Internal Server Error. I am also using Ubuntu 10.10 (desktop) so I believe I need that file, but I continued through the steps nonetheless. I got the database setup, I’ve imported the fonehome.sql successfully and the web site’s index page loads up. But when I try to add a new module, nothing happens; no error message, the page just reloads and nothing is added to the database. So I added a module directly in the database using phpmyadmin. That module now shows up on the Web page, but nothing happens when I try to control it even after editing the sudo user file as described in step 15.
    Is the iPHC Tarball file still available and if not, can you explain the modifications you have made to the script for it to work under Ubuntu ?

    Also, I’ve been searching for the iPhone Home Controller App on the App store, but I cannot find it. Can you point me in the right direction ?

    Thanks again for this great guide.

    1. admin Avatar
      admin

      I’ve updated the link now. Sorry I upgraded my wordpress installation to multisite and lost the linkage.
      Should be all good now!

  11. Rich Avatar
    Rich

    Just got this working on Ubuntu 10.10. Just the interface part, I don’t need the iphone part.

    I’m just sending the commands from launchers on my desktop. It works well except for the latency of 3 to 5 seconds. I’m working on figuring that out.

    Thank you for this.

  12. Kurt Avatar
    Kurt

    First of all thanks for a great guide, i didn’t need the iphone part because i’ll be implementing my own system for that.

    But i would like to know, if it’s possible to open some kind of socket to listen to incoming messages from other devices…

    For example if i have a simple controller and i press A1 on, that goes to my CM15a, is it possible to detect that message using this system and for example append it to a simple text file…

    1. admin Avatar
      admin

      I am not sure, I didn’t write the code for the CM15a USB linux driver, I just implemented three technologies together: iPhone controller, CM15A linux driver, and Ubuntu Linux. Sorry.

  13. Nathan Avatar
    Nathan

    Has anyone experienced issues with RF devices? I got the CM15 turning off and on a power line lamp module(LM465) but my RF Transceiver Module (TM751) will not turn on/off from the command line. I am able to use a PalmPad Remote (HR12A) to turn it on/off. Any ideas?

    Thanks

  14. codedmind . Avatar
    codedmind .

    Hy there!

    What is de /dev/* it uses? if we know maybe we can use heyu 

    1. Michael J Kormendy Avatar

      I am not sure .. But this is the source for the drivers.

      http://www.eclipsehomeauto.com/cm15a_on_linux/cm15a.shtml

      1. codedmind . Avatar
        codedmind .

        I have search there also but no luck 😐

        I’m stuck with this now

      2. Michael J Kormendy Avatar

        Did you try contacting the owner of eclipse home automation?
        He was very helpful to me by email when I put this together.

      3. codedmind . Avatar
        codedmind .

        I send him an email today, to info@
        But din’t get an answer

  15. Fordy101 Avatar
    Fordy101

    on step 8 i keep getting an error and i’ve checked everything any ideas?

    1. Michael J Kormendy Avatar

      What is the error exactly?

      1. fordy101 Avatar
        fordy101

        gcc -DDEVEL -DDEBUG -DLINUX -DX10DEMO -g /lib/libpthread* -o cm15ademo cm15ax10.c cm15ademo.c libusbahp.c -lusb -lm
        gcc: /lib/libpthread*: No such file or directory
        In file included from cm15ax10.c:11:0:
        libusbahp.h:5:17: fatal error: usb.h: No such file or directory
        compilation terminated.
        In file included from cm15ademo.c:7:0:
        libusbahp.h:5:17: fatal error: usb.h: No such file or directory
        compilation terminated.
        In file included from libusbahp.c:7:0:
        libusbahp.h:5:17: fatal error: usb.h: No such file or directory
        compilation terminated.
        make: *** [cm15ademo] Error 1

      2. fordy101 Avatar
        fordy101

        i’ve managed to install usb.h and now the error is this

        gcc -DDEVEL -DDEBUG -DLINUX -DX10DEMO -g /lib/libpthread* -o cm15ademo cm15ax10.c cm15ademo.c libusbahp.c -lusb -lmgcc: /lib/libpthread*: No such file or directorymake: *** [cm15ademo] Error 1

        Thanks!!

      3. Michael J Kormendy Avatar

        It looks as though libusb is missing on your system. But I think libusb was an old library or it was updated or something.
        Unfortunately I did not write this part of the code, this was done by someone else.

      4. Perfectg_uk Avatar
        Perfectg_uk

        the make file in step 9 is looking for libpthread in the lib folder. On newer installations it is still there but in the  i386-linux-gnu folder. Open the make file with a text editor, I found double clicking on it opened it. Change the line that says /lib/libpthread* to /lib/i386-linux-gnu/lippthread* -o $@ then retry the sudo make command. This worked for me so hope it helps.

  16. Todd Avatar
    Todd

    This is a great tutorial.  I have referenced this many times and have it running on a SheevaPlug.  Great Ubuntu box with extremely low power consumption.  I was wondering if you knew of a way to have your implementation listen to X10 codes as well as receiving them?  If so, it seems it would be easy to create a cron job that could fire when a particular X10 code was received.

    1. Todd Avatar
      Todd

      Sorry, I meant the following: “I was wondering if you knew of a way to have your implementation listen to X10 codes as well as TRANSMIT them”.

      1. Michael J Kormendy Avatar

        I have been running this setup on a large box for quite some time and have been keenly looking to move it all over to a sheevaplug as you have, I am glad to hear the tutorial was helpful for you.

        As for the receiving of signals from the CM15A device, I do know that the device IS capable of receiving signals and reporting it, however that functionality was never programmed into the controller package that I used in my tutorial. I am not sure if the developer that created the controller package has updated his efforts here.

        Unfortunately I have physically moved locations from a house with one electrical block to a condo with two separate electrical blocks for separate halves of the condo. The X10 modulation signals don’t cross over from one block to the other, and I have since really stopped using it altogether.

        I will continue to host this tutorial on my website for anyone that wants to set it up as such. However I cannot support it any longer.
        I would seek out the developer if you are curious in taking on these steps and improving the setup.

  17. sabinesgreenp Avatar

    These are some truly wonderful smart home products. I wonder what the future of home automation will be? http://sabinessmarthome.com

  18. Henriseiter Avatar
    Henriseiter

    I agree this is realy a great tutorial, i have just one problem if i’m using a scheme definition to but the lights on or off with iPHC i increment every time a cm15ademo process on my Ubuntu Box. 

  19. zathras Avatar
    zathras

    To get around the sudo option, to use cm15ademo as the apache user,  i only needed to add the apache user to the group USB and it was fixed too. Great work btw!

    1. Mike Avatar
      Mike

      Zathras, that’s great! I did not realize that there was a USB group. Having a better handle on permissions for myself, this would be the way I would have gotten around the sudo option too. Thanks for noting that!

    2. Louis Avatar
      Louis

      I would also like to get around the sudo option, but I am not sure I understand. By apache user, you mean www-data user? And what about the group USB? It does not seem to exist (cat /etc/group). I am using LinuxMint 13 (Maya)

  20. Mariodab Avatar
    Mariodab

    I can’t seem to get phpmyadmin to import the fonehome sql.  I have my user set up and logged in. I select the database with my user name in the left panel then click on the import button  and browse to fonehome.sql and click go at the bottom. It says “Import has been successfully finished, 3 queries executed.”

    When I log out and enter “http://localhost/iPHC” I get “unknown database fonehome.” I checked the readout from the import and it says “MySQL returned an empty result set (i.e. zero rows).”  Am I doing something wrong? Is there another database I should be using, or was I supposed to manually set up a database?

    1. Mariodab Avatar
      Mariodab

      nevermind I figured it out, you didn’t say anything about changing the name of the database in the connect.php file, or maybe you did and I just overlooked it. Anywho, still trying to get is set up. Apparently I have something not set up correctly with the sudoers file because my commands are not getting thru,  Taking a break for the night, if anyone has any insight on the sudoers file issue, I would appreciate some enlightenment.

      1. Mike Avatar
        Mike

        I would take the route that zathras suggested .. that will avoid the whole sudoers option altogether.

  21. mpegg Avatar
    mpegg

    this worked great on ubuntu 12.04 with one small change to the cm15ademo makefile. make failed with error regarding libpthread, so I updated line in makefile

    ##LFLAGS = -DDEVEL -DDEBUG -DLINUX -DX10DEMO -g /lib/libpthread* -o $@
    LFLAGS = -DDEVLE -DDEBUG -DLINUX -DX10DEMO -g -pthread -o $@

  22. Pierre Avatar
    Pierre

    Hello,
    i follow your steps until step 9 but there i have a problem. i have a cm15pro x10 from marmitek and afther the command from step 9 i get no access reply from the software.
    Are there other sugesstions ?

    Tanks in advance
    pierre.schippers@telenet.be

    1. Michael J Kormendy Avatar

      I would contact the person who created the connecting APIs that interface with the USB port. It’s not likely that the cm15pro has the same signal series like the device I used in this example.

  23. cedric Avatar
    cedric

    hi Michael thanks a lot

    I did the entire installation procedure

    the sudo ./cm15ademo A1 OFF command switch the light it s fine

    the webpage worked I add my module A1 fine

    But when I click on the button .. nothing happens .. is there logs somewhere

    an idea to check the setup?

    thanks a lot

    1. Michael J Kormendy Avatar

      Unfortunately I am no longer using this technique to automate my home and it has been sometime since I last touched this. The cm15ademo is quite the old device and there are newer options out there that have better support than I can find or offer.

      My only lead on your problem would be either that your web server doesn’t have the permissions to execute the cm15ademo executable, or that there’s an issue with sending the command via ajax to the server.

      You can always check your apache access logs to see if they are receiving the command. If they are, then that means there’s a permissions issue. If they are not, then I would bet there’s something not quite right with the ajax call or the web-page build.

      I was in the middle of hacking mine to improve it but never finished and moved away to a completely different lighting automation solution altogether.