Concurrent access to CUL transport binding is not working >= 1.7.0

811 views
Skip to first unread message

Andre Heuer

unread,
Jun 1, 2015, 10:01:59 AM6/1/15
to ope...@googlegroups.com
Hi all,

I have opened an issue (https://github.com/openhab/openhab/issues/2671) describing a problem with the CUL transport binding and bindings using this transport binding if more than one binding uses the CUL transport binding.

Maybe someone else has the same problems?

BR
André

Andre Heuer

unread,
Jun 4, 2015, 8:27:49 AM6/4/15
to ope...@googlegroups.com
Ok, I did some research now and the problems seems to be properties of a serial connection (parity & baudrate).

If, e.g., the intertechno binding requests a CUL Handler using the method getOpenCulHandler(device, mode), this call is piped to the method getOpenCulHandler(device, mode, properties) with null as properties. However, in getOpenCulHandler(device, mode, properties), the equality of properties is checked. In the CULSerialHandlerImpl Implementation of the properties check, FALSE is returned if the properties are NULL and an open serial CUL device cannot be returned even if the properties (maybe?) irrelevant.

Eventually, this return false should be changed to return true, because if properties is NULL, the properties of the serial connection might be irrelevant.

Any other views on the problem?

BR,
André

Dirk Clemens

unread,
Jun 6, 2015, 3:44:58 AM6/6/15
to ope...@googlegroups.com
unfortunately I have the same issue running FHT, FS20 and S300TH in parallel (openhab 1.7.0):
My openhab.cfg looks like

cul:device=/dev/ttyACM0
cul:housecode=DC69
fht:device=serial:/dev/ttyACM0
fht:housecode=DC69
#fs20:device=serial:/dev/ttyACM0
#fs20:baudrate=38400
#fs20:parity=NONE
#s300th:device=serial:/dev/ttyACM0

when I delete the # sign, I see the same error messages: 
Can't open CUL
org.openhab.io.transport.cul.CULDeviceException: The device serial:/dev/ttyACM0 is already open in mode SLOW_RF

I seems to run only for one of these bindings at a time.

Any help appreciated

Cheers, 
Dirk

Andre Heuer

unread,
Jun 6, 2015, 5:12:11 PM6/6/15
to ope...@googlegroups.com
Hi Dirk,

as I described above, I have patched the Cul transport binding. Using the attached binding, the problem should be fixed (remove current binding before).

BR
André
org.openhab.io.transport.cul-1.7.0-SNAPSHOT.jar

Thomas E.-E.

unread,
Jun 7, 2015, 12:17:25 PM6/7/15
to ope...@googlegroups.com, ahe...@gmx.net
Hi Andre,

thanks for taking action on this!

Would be great if you could provide this patch as PR once Dirk (or others) confirm it's working.

Thanks, Thomas E.-E.

Dirk Clemens

unread,
Jun 7, 2015, 5:27:21 PM6/7/15
to ope...@googlegroups.com
Hi André, 

I am running my config with your patch for round about 30 minutes so far and I can state that all components (FS20, FHT, S300TH) are running in parallel without any error. Thanks very much for providing this patch! 

For those of you interested in my setup (coming from FHEM):
  • Raspberry Pi 2 B+ - quite fast with my setup ;-) 
  • CUL V3 868MHz (CC1101 - USB - Lite module - http://www.busware.de/tiki-index.php?page=CUL), original firmware
  • FHT80B - Funk-Heizkörperthermostate
  • FHT 80TF-2 - Funk-Tür-Fenster-Melder
  • FS20 - Funkschalter (in verschiedenen Ausführungen, z.B. 
  • FS20 SU-2 - Unterputz-Funk-Schalter ,
  • FS20 S8M - FS20-4/8-Kanal- Sender, ... )
  • S 300 TH - Funk-Temperatur-/ Luftfeuchte-Sensor
I am still not able to get these components working: 
  • FS20 PIRA - 2-Kanal-Funk-Bewegungsmelder für Außeneinsatz (Beispielnachricht F557A003A6F15)
  • FS20 KSE - Klingelsignal- Erkennung 
My openhab.cfg file looks like (update / corrected):
fht:device=serial:/dev/ttyACM0
fht:housecode=DC69
fs20:device=serial:/dev/ttyACM0
s300th:device=serial:/dev/ttyACM0

My *.items file looks like:
/* FHT80B - Funk-Heizkörperthermostate */
Number HeizungMultiraumDesired "Multiraum Soll-Temp. [%.1f °C]" <temperature>(Heating){ fht="housecode=552D;datapoint=DESIRED_TEMP" }
Number HeizungMultiraumMeasured "Multiraum Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=552D;datapoint=MEASURED_TEMP" }
Number HeizungMultiraumValve "Multiraum Ventil [%.1f %%]"<heating>(Heating){ fht="housecode=552D;address=00;datapoint=VALVE" }
Switch HeizungMultiraumBattery "Multiraum Heizung Batterie [%s]" <battery>(Heating){ fht="housecode=552D;datapoint=BATTERY" }

/* FHT 80TF-2 - Funk-Tür-Fenster-Melder */
Contact FenstersensorMultiraum "Multiraum [MAP(de.map):%s]" <contact>(Window){ fht="housecode=52FB;address=7B;datapoint=WINDOW" }

/* S 300 TH - Funk-Temperatur-/ Luftfeuchte-Sensor     */
Number S300TerrasseTemp "Terrasse Temperatur [%.1f C]" <wind> (Outdoor) {s300th="address=1;datapoint=TEMPERATURE"} 
Number S300TerrasseHumi "Terrasse Luftfeuchtigkeit [%.1f %%]" <wind> (Outdoor) {s300th="address=1;datapoint=HUMIDITY"}

/* FS20 Licht/Schalter     */
Switch LichtDachHinten "Licht Dach hinten" <hue> (Lights) { fs20="DC69B0" }

PIRA does not yet do what I want it to, but the log file says, that is being recognized:
Switch PirGartentor "Bewegung Gartentor [%s]" <hue> (Outdoor) { fs20="557A00" }

openhab.log:

2015-06-07 23:18:56.269 [DEBUG] [.o.b.fs20.internal.FS20Binding] - Received FS20 message: F557A003A6F15

2015-06-07 23:18:56.270 [DEBUG] [.o.b.fs20.internal.FS20Binding] - Received command UNKOWN for device 557A00


Cheers,
Dirk

offtopic: I am not able to setup the IDE on Mac OS 10.10, errors on step 3 when generating the models, even the link posted in the wiki doesn't help. Anyone facing the same issues?

Andre Heuer

unread,
Jun 13, 2015, 9:38:06 AM6/13/15
to ope...@googlegroups.com
Hi Dirk,

thank you for your reponse. I have created a PR for the openhab Repo (https://github.com/openhab/openhab/pull/2730). However, I changed the realization of the patch a bit. However, the result is the same: the CUL can be used concurrently. However, my provided patch generates a warning in the logs, because the FS20 binding does not provide any properties for the CUL binding. But I think, this is an intended behavior and should be fixed in the FS20 binding by providing properties.

Cheers
André

Dirk Clemens

unread,
Jun 13, 2015, 2:34:55 PM6/13/15
to ope...@googlegroups.com
Hi André, 

after some days of testing of your first snapshot I was able to "reconstruct" that my FS20 components must not have the following properties defined:
fs20:parity=NONE
fs20:baudrate=38400
If defined, the FS20 components do not switch when activated by openhab. If not defined (comment out with a # upfront), the debug log shows the following error messages.
Maybe you can figure out the reason for that or even fix it? But thats no urgent request from my point of view. 
I am still trying to setup the IDE on my iMac. When I am able to manage that, I will do some own investigations and post my updates here. 

Cheers
Dirk

20:19:56.748 [DEBUG] [.o.b.fht.internal.FHTActivator:34   ] - FHT binding has been started.

20:19:56.815 [DEBUG] [.io.transport.cul.CULActivator:35   ] - CUL transport has been started.

20:19:56.889 [DEBUG] [.o.io.transport.cul.CULManager:137  ] - Registering class org.openhab.io.transport.cul.internal.CULSerialHandlerImpl for device type serial

20:19:56.894 [DEBUG] [.o.io.transport.cul.CULManager:137  ] - Registering class org.openhab.io.transport.cul.internal.CULNetworkHandlerImpl for device type network

20:19:56.917 [DEBUG] [.o.io.transport.cul.CULManager:75   ] - Trying to open device serial:/dev/ttyACM0 in mode SLOW_RF

20:19:56.919 [DEBUG] [.o.io.transport.cul.CULManager:144  ] - Searching class for device type serial

20:19:56.960 [DEBUG] [o.i.t.c.i.CULSerialHandlerImpl:241  ] - Opening serial CUL connection for /dev/ttyACM0

RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyACM0

20:19:57.070 [DEBUG] [o.i.t.c.i.CULSerialHandlerImpl:266  ] - Adding serial port event listener

20:19:57.073 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:303  ] - Sending raw message to CUL /dev/ttyACM0:  'X21

'

20:19:57.075 [DEBUG] [inding.fht.internal.FHTBinding:190  ] - Processing 0 waiting FHT temperature commands

20:19:57.080 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:287  ] - Requesting credit report

20:19:57.093 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:238  ] - Received raw message from CUL: 21  882

20:19:57.098 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:269  ] - credit10ms = 882

20:19:57.100 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:303  ] - Sending raw message to CUL /dev/ttyACM0:  'T01DC69

'

20:19:57.102 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:287  ] - Requesting credit report

20:19:57.121 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:238  ] - Received raw message from CUL: 21  882

20:19:57.123 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:269  ] - credit10ms = 882

20:19:57.522 [DEBUG] [.b.fs20.internal.FS20Activator:34   ] - FS20 binding has been started.

20:19:57.596 [DEBUG] [.o.b.fs20.internal.FS20Binding:65   ] - Activating FS20 binding

20:19:57.599 [DEBUG] [.o.b.fs20.internal.FS20Binding:148  ] - Received new config

20:19:57.602 [DEBUG] [.o.b.fs20.internal.FS20Binding:77   ] - Opening CUL device on serial:/dev/ttyACM0

20:19:57.604 [DEBUG] [.o.io.transport.cul.CULManager:75   ] - Trying to open device serial:/dev/ttyACM0 in mode SLOW_RF

20:19:57.607 [DEBUG] [.o.io.transport.cul.CULManager:81   ] - Requested device: serial:/dev/ttyACM0, returned hanlder: org.openhab.io.transport.cul.internal.CULSerialHandlerImpl@5e7c12

20:19:57.612 [ERROR] [o.i.t.c.i.CULSerialHandlerImpl:157  ] - Error parsing config key 'parity'. Use one of [EVEN, MARK, SPACE, NONE, ODD].

20:19:57.617 [DEBUG] [.o.io.transport.cul.CULManager:82   ] - Requested properties: {}, compared prop: true

20:19:57.618 [DEBUG] [o.b.s.internal.S300THActivator:34   ] - S300TH binding has been started.

20:19:57.620 [ERROR] [o.i.t.c.i.CULSerialHandlerImpl:157  ] - Error parsing config key 'parity'. Use one of [EVEN, MARK, SPACE, NONE, ODD].

20:19:57.625 [DEBUG] [.o.io.transport.cul.CULManager:85   ] - Device serial:/dev/ttyACM0 is already open in mode SLOW_RF, returning already openend handler


LittleDevil

unread,
Jul 10, 2015, 2:00:44 AM7/10/15
to ope...@googlegroups.com
Hi All,

i have a realy strange problem. Open hab can access my cul. I hope anyone can help me.

openhab.log 

 
 2015-07-09 21:41:15.404 [ERROR] [inding.fht.internal.FHTBinding] - CUL device is not accessible

openhab.cfg

fht:device=serial:/dev/ttyACM1
fht:housecode=1234
fs20:device=serial:/dev/ttyACM1
s300th:device=serial:/dev/ttyACM1

/dev/ttyACM0 is for homegear/homematic

 

I have also homegear installed, is this a problem.

The homegear homematic binding works fine. I have also tested the alternativ transport.jar from Andre Heuer.

In my older fhem installation works all perfect.

Many thanks

Alex


LittleDevil

unread,
Jul 24, 2015, 8:12:37 AM7/24/15
to openhab, venusalex...@googlemail.com
Hi,

the problem is opnehab had no permissons to acess the usb port.

i made this 
usermod -a -G dialout openhab

and it´s running

By Alex
Reply all
Reply to author
Forward
0 new messages