X10, CM11a, ttyUSB0, Status: OFFLINE - COMMUNICATION_ERROR Serial port /dev/ttyUSB0 is in use by another application (Unknown Linux Application)

Tags: #<Tag:0x00007f386eb55c18>

Hi All,

I’m having an issue that I’ve been researching for months and just can’t find an answer, at least not a recent, applicable answer…

I am running OpenHAB 2 on a Raspberry Pi 3. I have 2 Belkin USB-Serial adapters (ttyUSB0 on my CM11a, and ttyUSB1 on my CM17a Firecracker). I am using the CM11a binding.

When I try to connect to the X10 devices I get the following error:
Status: OFFLINE - COMMUNICATION_ERROR Serial port /dev/ttyUSB0 is in use by another application (Unknown Linux Application)

The only other appllication that I have loaded is Heyu.

So far I have tried:
only using one USB-serial adapter
configuring Heyu for a different port
putting OH on USB0 and Heyu on USB1
putting OH on USB1 and Heyu on USB0
resetting the OH port (USB0 or USB1

Heyu has no problems communicating with the X10 devices. I’m trying to figure out what could be blocking the port when OH is the only thing on it.

Sorry, I would have put the files in the boxes, but I couldn’t find the option.
I appreciate any help I can get. This can easily become maddening… :face_with_symbols_over_mouth:

Sitemap:
sitemap home label="Hutchins Home Automation" {
	Frame label="Date" {
		Text item=Date
		Text item=Time
	}
	Frame label="Main Menu" {
		Group	item=gUS	label="Upstairs"	icon="firstfloor"
		Group	item=gDS	label="Downstairs"	icon="groundfloor"
		Group	item=gOS	label="Outside"		icon="garden"
		Group	item=gHVAC	label="Heating & Air"	icon="heating"
		Group	item=gA		label="Alarms"		icon="alarm"
		Group	item=gM		label="Mobile"		icon="qualityofservice"
		Group	item=gW		label="Weather"		icon="sun"
	}
}
Things file:
Bridge	cm11a:cm11a:433932a0	[ serialPort="/dev/ttyUSB0" ]	{
	Thing	dimmer	Light_DS_Family_Portrait	[ HouseUnitCode="A9" ]
	Thing	switch	Light_DS_Coat_Closet		[ HouseUnitCode="A10" ]
	Thing	dimmer	Light_DS_Living_Portrait	[ HouseUnitCode="A13" ]
	Thing	switch	Light_US_Master_Closet		[ HouseUnitCode="B3" ]
	Thing	switch	Light_US_Hall_Ceiling		[ HouseUnitCode="B8" ]
	Thing	switch	Light_US_Guest_Ceiling		[ HouseUnitCode="B9" ]
	Thing	switch	Light_US_Kasea_Ceiling		[ HouseUnitCode="B10" ]
	Thing	switch	Light_US_Den_Ceiling		[ HouseUnitCode="B11" ]
	Thing	switch	Light_OS_Porch_Front		[ HouseUnitCode="C12" ]
	Thing	switch	Light_OS_Porch_Back		[ HouseUnitCode="C12" ]
	Thing	switch	Light_OS_Porch_Side		[ HouseUnitCode="C12" ]
	Thing	switch	Light_OS_Holiday		[ HouseUnitCode="C12" ]
	Thing	switch	Light_Test			[ HouseUnitCode="D2" ]
}
Items file:
//Dimmer	Light_DS_Family_Portrait	"Portrait"	<dimmablelight>	(DS_Family, Lights)	{ channel="cm11a:dimmer:433932a0:lightlevel" }
//Dimmer	Light_DS_Living_Portrait	"Portrait"	<dimmablelight>	(DS_Living, Lights)	{ channel="cm11a:dimmer:433932a0:lightlevel" }

//Switch	Light_US_Master_Closet 		"Closet"	<wardrobe>	(US_Master, Lights) 	{ channel="cm11a:switch:433932a0:switchstatus" }
//Dimmer	Light_US_Hall_Ceiling		"Hall"		<dimmablelight>	(US_Hall, Lights)	{ channel="cm11a:dimmer:433932a0:lightlevel" }
//Switch	Light_US_Guest_Ceiling		"Guest"		<light>		(US_Guest, Lights)	{ channel="cm11a:switch:433932a0:switchstatus" }
//Switch	Light_US_Kasea_Ceiling		"Kasea"		<light>		(US_Kasea, Lights)	{ channel="cm11a:switch:433932a0:switchstatus" }
//Switch	Light_US_Den_Ceiling		"Den"		<light>		(US_Den, Lights)	{ channel="cm11a:switch:433932a0:switchstatus" }

Switch	Light_Test		"Test"		<light>		(Lights)	{ channel="cm11a:switch:433932a0:switchstatus" }
OpenHAB.log:
2018-12-16 12:43:23.248 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'x10.items'
2018-12-16 12:43:24.370 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'x10.items'
2018-12-16 12:44:08.264 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'x10.things'
2018-12-16 12:44:08.574 [ERROR] [ing.cm11a.handler.Cm11aBridgeHandler] - No such port exists on this machine: /dev/ttyAMA0
2018-12-16 12:44:09.803 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'x10.things'
2018-12-16 12:44:20.228 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'x10.things'
2018-12-16 12:44:20.495 [INFO ] [ing.cm11a.handler.Cm11aBridgeHandler] - Initialized CM11A X10 interface on: /dev/ttyUSB0
2018-12-16 12:44:20.560 [WARN ] [.binding.cm11a.internal.X10Interface] - Serial port /dev/ttyUSB0 is in use by another application (Unknown Linux Application)
2018-12-16 12:44:21.721 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'x10.things'
2018-12-16 12:45:23.595 [INFO ] [st.core.internal.thing.ThingResource] - Received HTTP PUT request for update configuration at 'things/cm11a:switch:433932a0:Light_Test/config' for an unmanaged thing 'cm11a:switch:433932a0:Light_Test'.
2018-12-16 12:45:23.595 [INFO ] [st.core.internal.thing.ThingResource] - Received HTTP PUT request for update at 'things/cm11a:switch:433932a0:Light_Test' for an unmanaged thing 'cm11a:switch:433932a0:Light_Test'.
2018-12-16 12:45:32.496 [INFO ] [st.core.internal.thing.ThingResource] - Received HTTP PUT request for update configuration at 'things/cm11a:switch:433932a0:Light_Test/config' for an unmanaged thing 'cm11a:switch:433932a0:Light_Test'.

Thanks,

Fenced them.

Well, I fixed the ttyUSB0 error. I created a udev rule in /etc/udev/rules.d/99-usb-serial.rules:

KERNEL=="ttyUSB*", MODE:="0666", OWNER:="openhabian", GROUP:="dialout"

I was guided by this thread:

Now I’m just trying to get things to show in the correct places on my site map and WORK reliably. I can get them to work in Paper UI, but not in Basic UI. Making progress…

I’ve made some changes:

Sitemap:

sitemap home label="Hutchins Home Automation" {
	Frame label="Date" {
		Text item=Date
	}
	Frame label="Main Menu" {
		Group	item=gUS	label="Upstairs"	icon="firstfloor"
		Group	item=gDS	label="Downstairs"	icon="groundfloor"
		Group	item=gOS	label="Outside"		icon="garden"
		Group	item=gHVAC	label="Heating & Air"	icon="heating"
		Group	item=gA		label="Alarms"		icon="alarm"
		Group	item=gM		label="Mobile"		icon="qualityofservice"
		Group	item=gW		label="Weather"		icon="sun"
		Group	item=gH		label="Holiday"		icon="light"
	}
}

x10.things

Bridge	cm11a:cm11a:8a8632d7	[ serialPort="/dev/ttyUSB0" ]	{
	Thing	dimmer	Light_DS_Family_Portrait	[ houseUnitCode="A9" ]
	Thing	switch	Light_DS_Coat_Closet		[ houseUnitCode="A10" ]
	Thing	dimmer	Light_DS_Living_Portrait	[ houseUnitCode="A13" ]
	Thing	switch	Light_US_Master_Closet		[ houseUnitCode="B2" ]
	Thing	switch	Light_US_Hall_Ceiling		[ houseUnitCode="B8" ]
	Thing	switch	Light_US_Guest_Ceiling		[ houseUnitCode="B9" ]
	Thing	switch	Light_US_Kasea_Ceiling		[ houseUnitCode="B10" ]
	Thing	switch	Light_US_Den_Ceiling		[ houseUnitCode="B11" ]
	Thing	switch	Light_OS_Porch_Front		[ houseUnitCode="C12" ]
	Thing	switch	Light_X10_Holiday		[ houseUnitCode="H2" ]
}

x10.items

Switch	Light_US_Master_Closet 			"Closet"	<wardrobe>	(US_Master, Lights) 	{ channel="cm11a:switch:8a8632d7:switchstatus" }

Switch	Light_X10_Holiday			"Holiday"	<light>		(gH, Lights)		{ channel="cm11a:switch:8a8632d7:switchstatus" }
Switch	Light_OS_Porch_Front			"Front"		<light>		(gOS, Lights)		{ channel="cm11a:switch:8a8632d7:switchstatus" }

lights.things

Dimmer	Light_DS_Entry			"Entry"			(DS_Entry, Lights)	["Lighting"]
Switch	Light_DS_Coat_Closet		"Closet"		(DS_Entry, Lights)
Dimmer	Light_DS_Living_Table		"Table"			(DS_Living, Lights)
Dimmer	Light_DS_Living_Portrait	"Portrait"		(DS_Living, Lights)
Dimmer	Light_DS_Family_Portrait	"Portrait"		(DS_Family, Lights)
Switch	Light_DS_Hall_Ceiling		"Ceiling"		(DS_Hall, Lights)
Dimmer	Light_DS_Nook_Ceiling		"Breakfast Nook"	(DS_Nook, Lights)
Switch	Light_DS_Kitchen_Ceiling	"Ceiling"		(DS_Kitchen, Lights)
Switch	Light_DS_Kitchen_Island		"Island"		(DS_Kitchen, Lights)
Dimmer	Light_DS_Dining_Cabinet		"Cabinet"		(DS_Dining, Lights)
Switch	Light_DS_Bath_Mirror		"Mirror"		(DS_Bath, Lights)
Switch	Light_DS_Bath_Shower		"Shower"		(DS_Bath, Lights)
Switch	Light_DS_Linda_Ceiling		"Ceiling"		(DS_Linda, Lights)

Dimmer	Light_US_Master_Desk		"Desk"			(US_Master, Lights)
Dimmer	Light_US_Master_Stand		"Stand"			(US_Master, Lights)
Switch	Light_US_Hall_Ceiling		"Ceiling"		(US_Hall, Lights)
Switch	Light_US_Hall_Loft		"Loft"			(US_Hall, Lights)
Switch	Light_US_Guest_Ceiling		"Ceiling"		(US_Guest, Lights)
Switch	Light_US_Kasea_Ceiling		"Ceiling"		(US_Kasea, Lights)
Switch	Light_US_Den_Ceiling		"Ceiling"		(US_Den, Lights)
Switch	Light_US_Bath_Mirror		"Mirror"		(US_Bath, Lights)
Switch	Light_US_Bath_Shower		"Shower"		(US_Bath, Lights)
Switch	Light_US_Game_Ceiling		"Ceiling"		(US_Game, Lights)
Switch	Light_US_126			"126"			(US_Master, Lights)
Switch	Light_US_119			"119"			(US_Master, Lights)

Switch	Light_OS_Holiday		"Holiday"		(gH, Lights)

lights.items

/* Lights */

Dimmer	Light_DS_Nook_Ceiling 	"Breakfast Nook [%d %%]" <light> (DS_Nook, Lights) 	{ channel="zwave:device:64ce45e1:node5:switch_dimmer" }

Switch	Light_DS_Dining_Cabinet	"Dining Cabinet"	<light>	(DS_Dining, Lights)	{ channel="wemo:socket:Socket-1_0-221737K0113CD3:state" }

Dimmer  Light_US_Master_Desk    "Desk"          	<light> (US_Master, Lights)     { channel="network:pingdevice:10_5_0_136:switch_dimmer" }

Dimmer  Light_US_Master_Stand   "Stand"          	<light> (US_Master, Lights)     { channel="network:pingdevice:10_5_0_113:switch_dimmer" }

Switch	Light_OS_Holiday	"Holiday"		<light>	(gH, Lights)		{ channel="wemo:socket:Socket-1_0-221737K011404C:state" }

Thanks,

Todd

I finally got the X10 stuff working. Some of it is a little flakey, but it works, rules and everything… :smile:

Sitemap:

 sitemap home label="Hutchins Home Automation" {
	Frame label="Date" {
		Text item=Date
		Text item=Time
	}
	Frame label="Main Menu" {
		Group	item=gUS	label="Upstairs"	icon="firstfloor"
		Group	item=gDS	label="Downstairs"	icon="groundfloor"
		Group	item=gOS	label="Outside"		icon="garden"
		Group	item=gHVAC	label="Heating & Air"	icon="heating"
		Group	item=gA		label="Alarms"		icon="alarm"
		Group	item=gM		label="Mobile"		icon="qualityofservice"
		Group	item=gW		label="Weather"		icon="sun"
		Group	item=gH		label="Holiday Lights"	icon="tree_96"
	}
}

Things file:

Bridge	cm11a:cm11a:8a8632d7	[ serialPort="/dev/ttyUSB0" ]	{
	Thing	dimmer	Light_DS_Family_Portrait	[ houseUnitCode="A9" ]
	Thing	switch	Light_DS_Coat_Closet		[ houseUnitCode="A10" ]
	Thing	dimmer	Light_DS_Living_Portrait	[ houseUnitCode="A13" ]
	Thing	switch	Light_US_Master_Closet		[ houseUnitCode="B2" ]
	Thing	dimmer	Light_US_Hall_Ceiling		[ houseUnitCode="B8" ]
	Thing	switch	Light_US_Guest_Ceiling		[ houseUnitCode="B9" ]
	Thing	switch	Light_US_Kasea_Ceiling		[ houseUnitCode="B10" ]
	Thing	switch	Light_US_Den_Ceiling		[ houseUnitCode="B11" ]
	Thing	dimmer	Light_OS_Porch_Front		[ houseUnitCode="C12" ]
	Thing	switch	Light_X10_Holiday		[ houseUnitCode="H2" ]
}

Items file:

Switch		Light_US_Master_Closet 		"Master Closet"		<wardrobe>	(US_Master, Lights)  	{ channel="cm11a:switch:8a8632d7:Light_US_Master_Closet:switchstatus" }

Switch		Light_X10_Holiday		"Holiday X10"		<light>		(gH, Lights)		{ channel="cm11a:switch:8a8632d7:Light_X10_Holiday:switchstatus" }
Dimmer		Light_OS_Porch_Front		"Front Porch"		<outdoorlight>	(gOS, Lights)		{ channel="cm11a:dimmer:8a8632d7:Light_OS_Porch_Front:lightlevel" }


Dimmer	Light_DS_Family_Portrait		"Family Portrait"	<slider>	(DS_Family, Lights)	{ channel="cm11a:dimmer:8a8632d7:Light_DS_Family_Portrait:lightlevel" }
Dimmer	Light_DS_Living_Portrait		"Living Portrait"	<slider>	(DS_Living, Lights)	{ channel="cm11a:dimmer:8a8632d7:Light_DS_Living_Portrait:lightlevel" }


Dimmer		Light_US_Hall_Ceiling		"US Hall Ceiling"	<slider>	(US_Hall, Lights)	{ channel="cm11a:dimmer:8a8632d7:Light_US_Hall_Ceiling:lightlevel" }
Switch		Light_US_Guest_Ceiling		"Guest Ceiling"		<light>		(US_Guest, Lights)	{ channel="cm11a:switch:8a8632d7:Light_US_Guest_Ceiling:switchstatus" }
Switch		Light_US_Kasea_Ceiling		"Kasea's Ceiling"	<light>		(US_Kasea, Lights)	{ channel="cm11a:switch:8a8632d7:Light_US_Kasea_Ceiling:switchstatus" }
Switch	Light_US_Den_Ceiling			"Den Ceiling"		<light>		(US_Den, Lights)	{ channel="cm11a:switch:8a8632d7:Light_US_Den_Ceiling:switchstatus" }

Unfortunately none of this works for me.

I have a functioning USB to Serial adapter showing in Ubuntu under ttyUSB0 but putting that in and running the commands referenced here do nothing OpenHAB shows “No such port exists on this machine: /dev/ttyUSB0”

Any guidance? This is the ONLY article that references the x10 cm11a controller on the internet for OpenHAB…

Hi Steve,

Here are some web sites I came across in my research. They helped me find my answers:


https://www.linuxquestions.org/questions/linux-newbie-8/how-to-reset-serial-device-from-shell-450083/
weininger.net/how-to-write-udev-rules-for-usb-devices.html
http://reactivated.net/writing_udev_rules.html

I hope this helps.

Todd

Hi Steve,

Another thought… Have you tried testing with Heyu? it is a CLI interface that works with X10. If your USB to Serial interface is working, you should be able to communicate with your X10 devices.

Still hoping…

Todd