Maxcul doesn't start for me with 1.7.1

for me it worked after putting “org.openhab.io.transport.cul-1.7.1.jar” into the “addons” folder.
and I needed to add

maxcul:device=serial:COM5
maxcul:baudrate=38400
maxcul:parity=0

to openhab.cfg

OK, I’ve now had the time to get this working. I think three things were needed:

  1. org.openhab.io.transport.cul-1.7.1.jar" into the “addons” folder
  2. actually have a device that is accessible (in my case, serial:/dev/ttyACM0), with permissions set for the user I’m running as. I think this was a key step - previously I was testing on my Mac rather than my Pi, and it looks like the binding just silently doesn’t start when the CUL dongle isn’t connected
  3. the pairing data gets stored in etc/maxcul, you have to create this directory and grant permissions to the user that openhab is running as (I’ve installed via apt-get on debian, and the default config doesn’t permit this)

I’ve updated the wiki accordingly.

It now all appears to be working, which is beyond exciting.

Hi there, thanks for your efforts. I looked at the wiki but couldn’t actually find what I really need. Let me explain what I did so far:

  1. I put org.openhab.io.transport.cul-1.7.1.jar into the addons folder
  2. I put org.openhab.binding.maxcul-1.7.1.jar into the addons folder
  3. In openhab.cfg, I added maxcul:device=serial:/dev/ttyS1
  4. In openhab inside init.d, I added the startup parameters -Dgnu.io.rxtx.SerialPorts=/dev and /ttyS1-Djava.library.path=/usr/lib/jni (as in the wiki for the cul binding)
  5. I created a folder /usr/share/openhab/etc/maxcul which doesn’t seem to be used
  6. My openhab is run as root, so there shouldn’t be any permission problems at all (I need root access for GPIO anyhow)

My CUL device is /dev/ttyS1, so this should be the correct serial device. Have I forgotten anything? I don’t get any mention of cul or maxcul in my openhab.log .

Thanks to all in this thread. By following all the advices in your posts, I managed finally to establish the communication between OpenHAB and my MAX! basic radiator thermostats. The battery status does not seem to be supported though (which is not important to me), and I get quite a lot of 2016-01-02 09:17:20.616 [ERROR] [o.b.m.internal.messages.AckMsg] - Got ACK message with incorrect length! Does anyone observe this, too? BTW, I updated the wiki with my experiences.

I also get the ack with invalid length messages. It doesn’t appear to impact usage though.

Good to hear that I am not the only one though. I am using a RFBee flashed as CUL so I wasn’t sure if that might cause problems.
The communication between the thermostats and OpenHAB seems to be quite o.k., sometimes a message gets lost, but I am just at the beginning.
I’m not too sure if this binding is really maintained by anyone? On the other hand, there is a lot of experience at the FHEM project, so it might be worth a try to transfer some of that to OpenHAB.

FYI, there are some last-minute improvements for the maxcul binding that made it into 1.8.0 release.
The [installation docs] (https://github.com/openhab/openhab/wiki/MAX!-CUL-Binding) were updated, too

Hi
i have problems to get the maxcul to work under openhab.

It works fine under fhem

I use a pi 2 and installed openhab via apt-get install.

I installed (apt-get) both plugins (org.openhab.io.transport.cul and org.openhab.binding.maxcul) into the addons folder.

In the openhab.cfg i put this lines:

################################ Max!CUL Binding ###########################################
maxcul:device=serial:/dev/ttyUSB0
maxcul:baudrate=38400
maxcul:parity=0

Openhab runs under the openhab user and the openhab user is in dialout group.

I get this debug-log:

01:49:12.208 [DEBUG] [o.b.m.internal.MaxCulActivator:34 ] - MaxCul binding has been started.
01:49:12.262 [DEBUG] [i.internal.GenericItemProvider:341 ] - Start processing binding configuration of Item ‘culpair (Type=SwitchItem, State=Uninitialized)’ with ‘MaxCulGenericBindingProvider’ reader.
01:49:12.264 [DEBUG] [i.MaxCulGenericBindingProvider:102 ] - Processing item culpair
01:49:12.279 [DEBUG] [.m.i.MaxCulBindingConfigParser:38 ] - Pair Mode switch found
01:49:12.311 [DEBUG] [.io.transport.cul.CULActivator:35 ] - CUL transport has been started.
01:49:12.375 [DEBUG] [.o.io.transport.cul.CULManager:133 ] - Registering class org.openhab.io.transport.cul.internal.CULSerialHandlerImpl for device type serial
01:49:12.380 [DEBUG] [.o.io.transport.cul.CULManager:133 ] - Registering class org.openhab.io.transport.cul.internal.CULNetworkHandlerImpl for device type network
01:49:12.395 [DEBUG] [.maxcul.internal.MaxCulBinding:104 ] - Activating MaxCul binding
01:49:12.400 [DEBUG] [.maxcul.internal.MaxCulBinding:250 ] - MaxCUL Reading config
01:49:12.404 [DEBUG] [.maxcul.internal.MaxCulBinding:266 ] - Setting up device serial:/dev/ttyUSB0
01:49:12.406 [DEBUG] [.maxcul.internal.MaxCulBinding:285 ] - Opening CUL device on serial:/dev/ttyUSB0
01:49:12.413 [DEBUG] [.o.io.transport.cul.CULManager:75 ] - Trying to open device serial:/dev/ttyUSB0 in mode MAX
01:49:12.417 [DEBUG] [.o.io.transport.cul.CULManager:140 ] - Searching class for device type serial
01:49:12.448 [INFO ] [o.i.t.c.i.CULSerialHandlerImpl:124 ] - Update config, baudrate = 38400
01:49:12.453 [INFO ] [o.i.t.c.i.CULSerialHandlerImpl:133 ] - Update config, parity = NONE (0)
01:49:12.456 [DEBUG] [o.i.t.c.i.CULSerialHandlerImpl:241 ] - Opening serial CUL connection for /dev/ttyUSB0
01:49:12.567 [ERROR] [.maxcul.internal.MaxCulBinding:292 ] - Cannot open CUL device
org.openhab.io.transport.cul.CULDeviceException: gnu.io.NoSuchPortException
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:269) ~[na:na]
at org.openhab.io.transport.cul.internal.AbstractCULHandler.open(AbstractCULHandler.java:154) ~[na:na]
at org.openhab.io.transport.cul.CULManager.createNewHandler(CULManager.java:170) ~[bundlefile:na]
at org.openhab.io.transport.cul.CULManager.getOpenCULHandler(CULManager.java:89) ~[bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.setupDevice(MaxCulBinding.java:286) [bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.updated(MaxCulBinding.java:267) [bundlefile:na]
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
Caused by: gnu.io.NoSuchPortException: null
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[na:na]
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:244) ~[na:na]
… 7 common frames omitted

I would be thankful for any help

It says it cannot find/open the /dev/ttyUSB0 device. I had some problems like that – I’d suggest checking the device actually exists (on mine, I was testing on a machine that didn’t have the dongle plugged in), and that the user you’re running under has access to that device (sometimes you have to add them to the tty group).

Paul

From: Arne Stenmanns <bot@community.openhab.orgmailto:bot@community.openhab.org>
Reply-To: openHAB Community <replies+b58352b9f147f6cfadd21807431ca278@community.openhab.orgmailto:replies+b58352b9f147f6cfadd21807431ca278@community.openhab.org>
Date: Wednesday, 3 February 2016 at 2:08 PM
To: Paul Lambert <paul@planar.id.aumailto:paul@planar.id.au>
Subject: [openHAB] [Add-ons/Bindings] Maxcul doesn’t start for me with 1.7.1

[https://community.openhab.org/letter_avatar_proxy/v2/letter/m/fbc32d/45.png] MotShttps://community.openhab.org/users/mots Arne Stenmannshttps://community.openhab.org/users/mots
February 3

Hi
i have problems to get the maxcul to work under openhab.

It works fine under fhem

I use a pi 2 and installed openhab via apt-get install.

I installed (apt-get) both plugins (org.openhab.io.transport.cul and org.openhab.binding.maxcul) into the addons folder.

In the openhab.cfg i put this lines:

########################## Max!CUL Binding

maxcul:device=serial:/dev/ttyUSB0
maxcul:baudrate=38400
maxcul:parity=0

Openhab runs under the openhab user and the openhab user is in dialout group.

I get this debug-log:

01:49:12.208 [DEBUG] [o.b.m.internal.MaxCulActivator:34 ] - MaxCul binding has been started.
01:49:12.262 [DEBUG] [i.internal.GenericItemProvider:341 ] - Start processing binding configuration of Item ‘culpair (Type=SwitchItem, State=Uninitialized)’ with ‘MaxCulGenericBindingProvider’ reader.
01:49:12.264 [DEBUG] [i.MaxCulGenericBindingProvider:102 ] - Processing item culpair
01:49:12.279 [DEBUG] [.m.i.MaxCulBindingConfigParser:38 ] - Pair Mode switch found
01:49:12.311 [DEBUG] [.io.transport.cul.CULActivator:35 ] - CUL transport has been started.
01:49:12.375 [DEBUG] [.o.io.transport.cul.CULManager:133 ] - Registering class org.openhab.io.transport.cul.internal.CULSerialHandlerImpl for device type serial
01:49:12.380 [DEBUG] [.o.io.transport.cul.CULManager:133 ] - Registering class org.openhab.io.transport.cul.internal.CULNetworkHandlerImpl for device type network
01:49:12.395 [DEBUG] [.maxcul.internal.MaxCulBinding:104 ] - Activating MaxCul binding
01:49:12.400 [DEBUG] [.maxcul.internal.MaxCulBinding:250 ] - MaxCUL Reading config
01:49:12.404 [DEBUG] [.maxcul.internal.MaxCulBinding:266 ] - Setting up device serial:/dev/ttyUSB0
01:49:12.406 [DEBUG] [.maxcul.internal.MaxCulBinding:285 ] - Opening CUL device on serial:/dev/ttyUSB0
01:49:12.413 [DEBUG] [.o.io.transport.cul.CULManager:75 ] - Trying to open device serial:/dev/ttyUSB0 in mode MAX
01:49:12.417 [DEBUG] [.o.io.transport.cul.CULManager:140 ] - Searching class for device type serial
01:49:12.448 [INFO ] [o.i.t.c.i.CULSerialHandlerImpl:124 ] - Update config, baudrate = 38400
01:49:12.453 [INFO ] [o.i.t.c.i.CULSerialHandlerImpl:133 ] - Update config, parity = NONE (0)
01:49:12.456 [DEBUG] [o.i.t.c.i.CULSerialHandlerImpl:241 ] - Opening serial CUL connection for /dev/ttyUSB0
01:49:12.567 [ERROR] [.maxcul.internal.MaxCulBinding:292 ] - Cannot open CUL device
org.openhab.io.transport.cul.CULDeviceException: gnu.io.NoSuchPortException
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:269) ~[na:na]
at org.openhab.io.transport.cul.internal.AbstractCULHandler.open(AbstractCULHandler.java:154) ~[na:na]
at org.openhab.io.transport.cul.CULManager.createNewHandler(CULManager.java:170) ~[bundlefile:na]
at org.openhab.io.transport.cul.CULManager.getOpenCULHandler(CULManager.java:89) ~[bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.setupDevice(MaxCulBinding.java:286) [bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.updated(MaxCulBinding.java:267) [bundlefile:na]
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
Caused by: gnu.io.NoSuchPortException: null
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273) ~[na:na]
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:244) ~[na:na]
… 7 common frames omitted

I would be thankful for any help

Thank you for the fast response.

The device is exist on /dev/ttyUSB0:

ls -la /dev/serial/by-id/
lrwxrwxrwx 1 root root 13 Feb 3 02:09 usb-1a86_USB2.0-Serial-if00-port0 -> …/…/ttyUSB0

ls -l /dev
crw-rw---- 1 root dialout 188, 0 Feb 3 10:07 ttyUSB0

i add the openhab user to the tty group with the same result.

One Question:
In which file must i put the parameters:
-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0
-Djava.library.path=/usr/lib/jni (/usr/lib/jni does not exist on my system)

I removed the parameters from /etc/default/openhab
and get this error:

10:25:00.185 [ERROR] [.maxcul.internal.MaxCulBinding:292 ] - Cannot open CUL device
org.openhab.io.transport.cul.CULDeviceException: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:273) ~[na:na]
at org.openhab.io.transport.cul.internal.AbstractCULHandler.open(AbstractCULHandler.java:154) ~[na:na]
at org.openhab.io.transport.cul.CULManager.createNewHandler(CULManager.java:170) ~[bundlefile:na]
at org.openhab.io.transport.cul.CULManager.getOpenCULHandler(CULManager.java:89) ~[bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.setupDevice(MaxCulBinding.java:286) [bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.updated(MaxCulBinding.java:267) [bundlefile:na]
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:212) ~[na:na]
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:258) ~[na:na]
… 7 common frames omitted

Thank you

It looks like the group you need to have your user in is “dialout”, have you tried granting that permission to your user?

Paul

From: Arne Stenmanns <bot@community.openhab.orgmailto:bot@community.openhab.org>
Reply-To: openHAB Community <replies+bbab8a47150db00f8bbf3b42bfc8fe00@community.openhab.orgmailto:replies+bbab8a47150db00f8bbf3b42bfc8fe00@community.openhab.org>
Date: Wednesday, 3 February 2016 at 10:28 PM
To: Paul Lambert <paul@planar.id.aumailto:paul@planar.id.au>
Subject: [openHAB] [Add-ons/Bindings] Maxcul doesn’t start for me with 1.7.1

[https://community.openhab.org/letter_avatar_proxy/v2/letter/m/fbc32d/45.png] MotShttps://community.openhab.org/users/mots Arne Stenmannshttps://community.openhab.org/users/mots
February 3

Thank you for the fast response.

The device is exist on /dev/ttyUSB0:

ls -la /dev/serial/by-id/
lrwxrwxrwx 1 root root 13 Feb 3 02:09 usb-1a86_USB2.0-Serial-if00-port0 -> …/…/ttyUSB0

ls -l /dev
crw-rw---- 1 root dialout 188, 0 Feb 3 10:07 ttyUSB0

i add the openhab user to the tty group with the same result.

One Question:
In which file must i put the parameters:
-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0
-Djava.library.path=/usr/lib/jni (/usr/lib/jni does not exist on my system)

I removed the parameters from /etc/default/openhab
and get this error:

10:25:00.185 [ERROR] [.maxcul.internal.MaxCulBinding:292 ] - Cannot open CUL device
org.openhab.io.transport.cul.CULDeviceException: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:273) ~[na:na]
at org.openhab.io.transport.cul.internal.AbstractCULHandler.open(AbstractCULHandler.java:154) ~[na:na]
at org.openhab.io.transport.cul.CULManager.createNewHandler(CULManager.java:170) ~[bundlefile:na]
at org.openhab.io.transport.cul.CULManager.getOpenCULHandler(CULManager.java:89) ~[bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.setupDevice(MaxCulBinding.java:286) [bundlefile:na]
at org.openhab.binding.maxcul.internal.MaxCulBinding.updated(MaxCulBinding.java:267) [bundlefile:na]
at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:212) ~[na:na]
at org.openhab.io.transport.cul.internal.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:258) ~[na:na]
… 7 common frames omitted

Thank you

Visit Topichttps://community.openhab.org/t/maxcul-doesnt-start-for-me-with-1-7-1/4030/20 or reply to this email to respond.

Yes the openhab and the pi user are in dialout group

It’s now Invalid Parameter Error

I have a similar error, when I delete the baudrate config it runs. I’m now trying to work out why baudrate isn’t working as a parameter.

Looks like baudrate is a known defect in 1.8. Which is unfortunate, as I’m getting quite a few dropped packets / non responses, and wanted to try a lower baudrate to see if that improved things. Either way, it works well enough with the baudrate config removed.

Please download, install and use the new CUL bundles updated here:

They can be downloaded from here:

https://openhab.ci.cloudbees.com/job/openHAB1-Addons/lastSuccessfulBuild/artifact/bundles/

@tarioch also updated the wiki pages recently. Many thanks to him for his efforts.

Please provide feedback on successes/failures. Thank you!

I’m keen to test this, if only because my system relies heavily on maxcul, so I’d like to know it’s keeping working.

Having said this, looks like baud rate only controls the connection to the dongle, not from the dongle upstream to the valves, which is where I think I’m losing connectivity (and looks like the default is 9200 anyway, so I can’t go slower).

Two questions:

  1. Is there any other setting in the code that impacts packet loss as it sends to the valves? Or is that just something I live with because it’s how the devices work?
  2. What’s my best way to go about testing this new version? I’m running 1.8 from the debian repository, but it looks like the cul jar has changed from a binding to a transport? Can I just drop the changed jars in and expect it to work, or do I need to upgrade my whole openhab to the snapshot version?

This could be a question for @tarioch. Are any differences in required JARs from previous documented in the wiki?

The new JARs should work under the 1.8 version of the openHAB runtime. Just remove the 1.8 JARs and put the 1.9.0-SNAPSHOT JARs in the addons folder.

The change from binding to transport happened before, I just updated the documentation to reflect this as well.

I tried these JARs from the cloudbees build
org.openhab.binding.maxcul-1.9.0-SNAPSHOT.jar
org.openhab.io.transport.cul-1.9.0-SNAPSHOT.jar

and got the following error.
So it’s basically telling me that the cul transport module can’t open the serial port because it is already using it ? huh?

2016-04-21 18:06:45.783 [DEBUG] [.maxcul.internal.MaxCulBinding] - Activating MaxCul binding
2016-04-21 18:06:45.788 [DEBUG] [.maxcul.internal.MaxCulBinding] - MaxCUL Reading config
2016-04-21 18:06:45.804 [INFO ] [t.c.i.s.CULSerialConfigFactory] - Update config, parity = NONE (0)
2016-04-21 18:06:45.807 [DEBUG] [.o.i.t.cul.internal.CULManager] - Trying to open device serial:/dev/ttyACM0 in mode MAX
2016-04-21 18:06:45.808 [DEBUG] [.o.i.t.cul.internal.CULManager] - Searching class for device type serial
2016-04-21 18:06:45.834 [DEBUG] [i.t.c.i.s.CULSerialHandlerImpl] - Opening serial CUL connection for /dev/ttyACM0
2016-04-21 18:06:45.838 [ERROR] [.o.i.t.cul.CULLifecycleManager] - Can't open CUL
org.openhab.io.transport.cul.CULDeviceException: The port /dev/ttyACM0 is currenty used by org.openhab.io.transport.cul.internal.serial.CULSerialHandlerImpl
    at org.openhab.io.transport.cul.internal.serial.CULSerialHandlerImpl.openHardware(CULSerialHandlerImpl.java:80) ~[bundlefile:na]
    at org.openhab.io.transport.cul.internal.AbstractCULHandler.open(AbstractCULHandler.java:139) ~[bundlefile:na]
    at org.openhab.io.transport.cul.internal.CULManager.createNewHandler(CULManager.java:149) ~[bundlefile:na]
    at org.openhab.io.transport.cul.internal.CULManager.getOpenCULHandler(CULManager.java:84) ~[bundlefile:na]
    at org.openhab.io.transport.cul.CULLifecycleManager.open(CULLifecycleManager.java:77) [bundlefile:na]
    at org.openhab.io.transport.cul.CULLifecycleManager.config(CULLifecycleManager.java:66) [bundlefile:na]
    at org.openhab.binding.maxcul.internal.MaxCulBinding.updated(MaxCulBinding.java:265) [bundlefile:na]
    at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
    at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]

How does your config look like?