Page 1 of 1

0.1.201: no CM15a control, command line control is fine

Posted: Sun Nov 06, 2011 6:17 pm
by OWK
Some 2 months ago I've started playing with Domotiga 0.1.176 and Ubuntu 10 in order to get X10/CM15a running.

With this setup I can control devices C1 and A1 from the command line using CM15ademo (see WiKi, Heyu), surprisingly C3 can't be controlled :? .
However, I couldn't contol devices A1 and C1 from Domotiga and decided to wait for the announced new relase 0.1.201.

After upgrading to release 0.1.201 (and Ubuntu 11.10) last week I still can't control CM15a from Domotiga, control of C1 and A1 from the command line is still fine (C3 is still not responding). No error is displayed in the log, on/off events/triggers are enabled.
The log shows the on/off status change for device C1 and in 'Devices' the lamp on/off picture for C1 is displaying alternating.

Any tips to evercome this problem?

btw I found that 'disable of X10Cmd' message in Domotiga log was caused by my setup. You have to point to an executable and not to the folder (as default is configured).

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Sun Nov 06, 2011 10:34 pm
by RDNZL
Hi,

the x10cmd is the simplest interface code for domotiga, so i guess we can make it work..

the cm15ademo binary only works if you execute it as root (because of the device driver).
So you need to set the sticky bit once, to allow it to run as root from a normal user.

Code: Select all

$ sudo chmod +s /path/to/cma15demo 
Then try to switch lamp a1..a2..c1..c2 etc from the command line as normal user, the same as the one you run domotiga as.
If this doesn't work it's a bug in a15ademo.

If this works, try inside domotiga, enable X10Cmd debugging, if it doesn't work check the command it tries to execute in the debug log.
Is it different than the one used above, maybe we have to specify the address in lowercase or uppercase...

Please post the result and log entries here..

Regards,
Ron.

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Mon Nov 07, 2011 12:33 am
by OWK
Thanks for the quick response Ron

There you mention something: the debug log... How can I forget :D

I looked in there and it reports: couln't open USB device /dev/bus/usb/006/002: permissions denied. Result: libusb requires write access.

Since being a newbe on Linux (and on this forum I just experienced :wink: ), I found on the internet:
sudo chmod 666 /dev/bus/usb/006/002. That fixed the control issue. Domotiga responds quickly to the command! I'm happy with that!

The problem with C3=On is gone, but I still can't set C3=off. The device simply doesn not respond while the main log printed it is on.

Regards,

Olaf

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Mon Nov 07, 2011 2:04 pm
by jrkalf
OWK wrote:Thanks for the quick response Ron

There you mention something: the debug log... How can I forget :D

I looked in there and it reports: couln't open USB device /dev/bus/usb/006/002: permissions denied. Result: libusb requires write access.

Since being a newbe on Linux (and on this forum I just experienced :wink: ), I found on the internet:
sudo chmod 666 /dev/bus/usb/006/002. That fixed the control issue. Domotiga responds quickly to the command! I'm happy with that!

The problem with C3=On is gone, but I still can't set C3=off. The device simply doesn not respond while the main log printed it is on.

Regards,

Olaf
Don't forget that after a reboot this will fail yet again due to the dynamic population of your /dev area by udev. You'd have to setup a udev rule to set the proper permissions on this device stub when it's connected to your server.


Jelle

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Mon Nov 07, 2011 2:06 pm
by jrkalf
Addition to this post (because I didn't want to edit the previous one). When you've got that covered, write a little "howto" for Ron so he can place that next to the device information on the domotiga.nl website.


Jelle

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Mon Nov 07, 2011 8:34 pm
by OWK
Hi Jelle,

Thanks for the tip, I did not give this thought. The setup of the usb was an issue anyway because I had to find installation tips on the internet to make it work. USB was not included in Linux 10.10.

As a Linux newbe I'm proud of what achiefed so far, but now some structure is needed :)

I worked my way from the Domotiga live version 0.1.176 to now 0.1.201; Linux 10.10 LTE to now 11.10. Is the permissions problem solved if I make a clean install of Linux 11.10? Otherwise I will have to hunt for a 'of the shelf' solution on permissions to USB.

I had some installation data dumps saved for the WiKi intending to make a guide, but developments on X10Cmd where much faster than me learning new stuff.

Thanks again!

Olaf

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Mon Nov 07, 2011 11:08 pm
by RDNZL
Just use the sudo chmod +s to the cm15ademo binary. It will survive a reboot and it doesnt matter which device node is used.

Re: 0.1.201: no CM15a control, command line control is fine

Posted: Thu Nov 17, 2011 9:30 pm
by OWK
Hi All

As Jelle predicted a reboot of Linux gives no control over the CM15a. Need to work with udev rules...
Since I'm a Linux newbe Ron's tip (using chmod +S to the binary file (X10Cmd)) sounded more attractive :) This is what I did:

ls -l X10Cmd

-rwxr-xr-x 1 root root 94976 2011-11-06 14:34 X10Cmd

sudo chmod +s X10Cmd
ls -l X10Cmd

-rwsr-sr-x 1 root root 94976 2011-11-06 14:34 X10Cmd

This does not give the expected result. Still no control over CM15a from the command prompt.

After extensive digging on the Internet for a 'how to' on udev rules found a tip to fix this problem. See steps below:

Step 1: Open terminal session (Ubuntu 11.10: Ctrl+Alt+T)

Step 2: Find out hardware details of the CM15a connected to the usb port:

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 413c:8140 Dell Computer Corp. Wireless 360 Bluetooth
Bus 006 Device 002: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)
Bus 007 Device 002: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub
Bus 007 Device 003: ID 0b97:7772 O2 Micro, Inc. OZ776 CCID Smartcard Reader

On Bus 006 Device 002 my CM15a is found

Step 3: change to the directory that holds the rules files

cd /etc/udev/rules.d/


Step 4: Create a rules file and copy/past rule below

sudo gedit 10-X10Cmd.rules

# udev rules file for X10 CM15a
BUS=="usb", SYSFS{idVendor}=="0bc7", SYSFS{idProduct}=="0001", GROUP="plugdev"

0bc7 and 0001 are taken from the info at Bus 006 Device 002

Step 5: Save and exit gedit

Step 6: Reboot Linux

Step 7: Test control of CM15a from the command prompt

X10Cmd A1 On

Step 8: test control from within Domotiga

That started working after going into setup|interfaces|X10Cmd to hit save after restoring the existing path to the X10Cmd binary. Sounds strange but true.

Regards Olaf