Opentherm (cannot open /dev/ttyUSB0)

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

So, i've been trying to get started with domotiga, but i can't figure it out.

Started with an old laptop with a defective screen, installed ubuntu 12.04 server, gambas 2 and domotiga on it. Tried to add the opentherm gw i build to show thermostat setpoint and such, could not find any information on how to do this so just filled in a name and location. But nothing would show up. Tried the opentherm monitor program from the same site and the schematic and got results.
Then the wireless adapter of the laptop failed. So i put everything on hold and ordered a raspberry pi.

Installed wheezy image, gambas 2 and domotiga on that, then the gw died. Transistor damage. Got my brother to check everything, then hooked up the GW again. checked if it was working with otmonitor again. it was. Changed thermostat setpoit, that worked. Added the opentherm interface with auto device creation setting and then... nothing...
Log shows something along the lines of: Device not found, Cannot open /dev/ttyUSB0.

I can do "cat /dev/ttyUSB0" and see opentherm codes flying all over the place.
The otmonitor can also read and write to the ttyUSB0 without problem.


Can someone please help me to get this to work? :cry:
BreFra
Starting Member
Starting Member
Posts: 21
Joined: Wed Jan 06, 2010 10:44 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by BreFra »

To me it looks like you domotiga does not have the proper permission to open the port.
otmonitor and domotiga both running using the same credentials?
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

Yes, both run under root. decided to ignore the huge security warning for now.
vanisher

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by vanisher »

sometimes you have to change the ownership of /dev/ttyUSBx
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

The port is already owned by the root user, the owner group is dailout, root is already a member of this group. I've also run chmod 777 /dev/ttyUSB0.
Anything else i might be able to try?
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

Also here's some output:
-----
2013/02/20 00:14:01 OpenTherm gateway support enabled.
2013/02/20 00:14:01 [Devices] Interface with name 'OpenTherm Gateway' has id '37'
2013/02/20 00:14:01 [Devices] Device with address 'Thermostat' is 'OpenTherm Thermostat device #1'
2013/02/20 00:14:01 [Devices] Interface with name 'OpenTherm Gateway' has id '37'
2013/02/20 00:14:01 [Devices] Device with address 'CentralHeating' is 'OpenTherm Central Heating device'
2013/02/20 00:14:01 [Devices] Interface with name 'OpenTherm Gateway' has id '37'
2013/02/20 00:14:01 [Devices] Device with address 'Boiler' is 'OpenTherm Boiler device #1'
2013/02/20 00:14:01 [Devices] Interface with name 'OpenTherm Gateway' has id '37'
2013/02/20 00:14:01 [Devices] Device with address 'Burner' is 'OpenTherm Burner device #1'
2013/02/20 00:14:01 [Devices] Interface with name 'OpenTherm Gateway' has id '37'
2013/02/20 00:14:01 [Devices] Device with address 'Outside' is 'OpenTherm Outside sensor device '
2013/02/20 00:14:02 [OpenTherm] Gateway is not responding
2013/02/20 00:14:02 ERROR: OpenTherm gateway interface FAILED to connect to Port /dev/ttyUSB0
-----

And ls -l gives:

crwxrwxrwx 1 root root 188, 0 Feb 20 00:16 /dev/ttyUSB0
FoRMaTC
Member
Member
Posts: 89
Joined: Fri Sep 26, 2008 1:50 am
Location: Netherlands

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by FoRMaTC »

What is lsusb giving you?
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

lsusb returns:

Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
BreFra
Starting Member
Starting Member
Posts: 21
Joined: Wed Jan 06, 2010 10:44 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by BreFra »

Your debug log pointed me to a bug in the DomotiGa code that prevents activating the OpenTherm interface. (Apparently I mixed up "WAIT" and "SLEEP" commands :oops: )
I've just created a bug request (http://www.domotiga.nl/issues/253) to get this fixed.
PHiAX
Starting Member
Starting Member
Posts: 9
Joined: Mon Nov 05, 2012 3:27 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by PHiAX »

Wow thanks :)
I'll wait for a fix then
User avatar
sj3fk3
Member
Member
Posts: 119
Joined: Mon Apr 23, 2012 8:33 am
Location: Abcoude

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by sj3fk3 »

instead of running as root you can do something like this in /etc/udev/rules.d/70-usb-serial.rules
KERNEL=="ttyUSB*", SUBSYSTEMS=="usb", ATTRS{serial}=="serialstringoftheusbdevice", SYMLINK+="otgw", OWNER="username"
Kind Regards,
Greg.
MartinF
Starting Member
Starting Member
Posts: 2
Joined: Tue Feb 12, 2013 3:23 pm

Re: Opentherm (cannot open /dev/ttyUSB0)

Post by MartinF »

click on FAQ on domotiga.nl and you have fix for it there.
Post Reply

Return to “DomotiGa Forum”