Maxcul doesn't start for me with 1.7.1

Well, I once got it to work. I believe it was in 1.7.1 or 1.7.0.
I recall I needed the org.openhab.io.transport.cul binding.
Also, you need a cul:… line in openhab.cfg and you eventually need to edit the java parameters that openHAB is started with to serve the serial port.

I just re-tried and got the following messages at startup.
After that, however, I don’t see any no more CUL messages as I did before.
So it seems you’re right, something must have changed recently.

Markus

2015-11-18 17:04:49.558 [DEBUG] [o.b.m.internal.MaxCulActivator] - MaxCul binding has been started.
2015-11-18 17:04:49.717 [DEBUG] [.io.transport.cul.CULActivator] - CUL transport has been started.
2015-11-18 17:04:49.735 [DEBUG] [.o.io.transport.cul.CULManager] - Registering class org.openhab.io.transport.cul.internal.CULSerialHandlerImpl for device type serial
2015-11-18 17:04:49.738 [DEBUG] [.o.io.transport.cul.CULManager] - Registering class org.openhab.io.transport.cul.internal.CULNetworkHandlerImpl for device type network
2015-11-18 17:04:49.769 [DEBUG] [.maxcul.internal.MaxCulBinding] - Activating MaxCul binding
2015-11-18 17:04:49.772 [DEBUG] [.maxcul.internal.MaxCulBinding] - MaxCUL Reading config

You got more than I did though - you got the binding actually starting.

I did include org.openhab.io.transport.cul, and I included parameters for the serial port.

When you say you need a cul: line in openhab.cfg, do you mean a maxcul: line? I have one of those as I have the full config that it says it needed - but I don’t have a cul line. If that’s not a typo, then could you tell me what needs to be in the cul line?

Any chance you could show that section of your openhab.cfg file?

Also, what version are you on? I’m on 1.7.1, but happy to upgrade to a newer version if that’s likely to get me closer.

I’m running latest 1.8.0 snapshot.
Here 's the entry from openhab.cfg:

################################ CUL Binding  ###########################################
cul:device=/dev/ttyACM0

OK, I downloaded 1.8.0 and tried with that, with exactly the same result. So I got more adventurous, and added every addon to the list, at which point I at least got the CUL binding starting (not Maxcul yet though).

I then removed the addons until it stopped working - the one that it seems to want is the s300th binding. No idea what that is.

So I went back to my 1.7.1 install, and if I add the s300th binding to the addons directory, I now at least get a message that the CUL binding is starting. Maxcul still not starting, but at least I have some progress.

Actually, thinking about that further, it looks like s300th is one of the bindings that uses the CUL transport. So perhaps MaxCul doesn’t actually use the CUL transport? Or it’s just still not loading for me for some obscure reason. Sigh.

@mstormi, what other addons do you have in your directory - although for me even with every addon in, I didn’t get the MaxCul lines that you have.

Sorry, but I have no other bindings that are relevant to the serial port and/or 868 MHz communication.

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!