How to install a 2.X binding manually? (In this case KNX)

Hi,

I was curious if I can try out the KNX 2.X Binding and searched for it.
I found this https://github.com/kgoderis/openhab2/tree/knx/addons/binding/org.openhab.binding.knx
and this thread on github: https://github.com/openhab/openhab2-addons/pull/21

I understand, that the binding isn’t completely ready yet, but wanted to try it out.
I am stuck on how to install the binding the right way: there are .jars availible in the directory, but I am not sure, if they are suitable to install.
I tried to search the forum for other bindings which had to be installed manually, but found only 2 or 3 threads but unfortunately without real information how it should work.

So can someone tell if these jars are suitable for bringing them in directly to OH2, or has sth. to be compiled first?
If they are OK for use, how?
Just putting the jars in the addonsfolder wasn’t working for me. If I understood correctly the folder is more for 1.X bindings which are compatible. But in another thread on the forum it seemed that OH2 binding jars could also go there.
If they belong anywhere else: where? And does it work putting just the jars in or is there some configuration to do anywhere before they are recognized?

Thanks in advance!

You can just put it in the addons folder - I do exactly this for my bindings. However, you need to make sure that any dependencies are also added here otherwise it won’t start (I don’t know if KNX has any dependencies).

If you drop the JAR into the addons, then go to the console you can see its state. If it’s not active, then start it, and if it won’t start due to missing dependencies, it should tell you what’s missing.

I tried that, and I looked at the karaf console if it shows up in bundle:list and binding:list, but I had seen nothing.
Also restarted the whole system.
So it should normally work that way? Or do I use the wrong console for it? Using the pine64 (arm) shouldn’t make a difference?

I would expect it should work - it certainly works fine for me. I use this regularly for debugging bindings, and adding HABmin etc. I just drop them in the addons folder, and they start and work fine…

I would expect the pine to work the same way (I’m running my production system on a Synology, but I really wouldn’t expect it to matter).

Strange.
I think I’ll create a new VM and a fresh OH2 install and try again. Although I have no idea what could be screwed up, since it is a relatively fresh install, but who knows.
Will get back when I see if it works or not.

Maybe the KNX JAR you are trying to run is corrupted? Alternatively, if this is a derivative of the apt-get install, I know folders end up in many places around the file system - maybe your addons folder is not in the place the system is looking.

On the pine I used the image for the SD Card, so things are installed in /opt/openhab and the addonsfolder is /opt/openhab/addons, which “looks” right so far. But it is an idea to check that.
If the jars are corrupted is difficult to find out, I downloaded them two times. The author in the thread https://github.com/openhab/openhab2-addons/pull/21 says it’s ok, but hgerts had also the problem to run them.
I’ll get a VM ready now.

One further thought - if you are downloading JARs from Github, make sure they download correctly. It is very common for them to abort if you don’t select the raw option. Often if this happens they are only around 30kb long…

Just a thought… This is one of the most commonly asked questions for HABmin!

1 Like

I know, I had that, when I tried to use habmin the first time and found an advice from you to look after that, and yes, the first habminjars where abount 30kb, but after redownloading it worked.
The jars I downloaded here had bigger size. Seemed to be OK the download.
What I just wondered about, I downloaded three jars from this directory https://github.com/kgoderis/openhab2/tree/knx/addons/binding/org.openhab.binding.knx/lib and left the two with -sources in it alone. Because I thought I just need binaries but no sources. Maybe that’s a mistake, too?

I think that’s a reasonable assumption. If you were missing JARs, then I would still expect that they would show up in the console, but they would be in the INSTALLED state only and wouldn’t run if you tried to start them.

So, fresh debian install, deb-package OH2b3 installed, downloaded all 5 jars with the right size, put in /usr/share/openhab2/addons/ (should be the right directory for the .deb install).
Restarted all but won’t show at bundle:list or feature:list
I can’t see there anything like knx or calimero.
The only thing I see is the KNX 1.9 feature, but I think that shouldn’t block the 2.X binding from showing up?
Eventual @kgoderis is the only one who can bring some light into this.
I have no more ideas at the moment.

You need to get hold of the .jar and put that in the add-on folder. The jar you can get by for example importing the binding in the eclipse IDE and compile it. The source code sits in my clone of the official repo. Or I can send you the jar but I am without a pc the next 2 weeks.

The you uninstall the 1.9 bundle, and the 2.0 should start up. The 2.0 is not yet part of the official repo but @kaikreuzer maybe we should effectively push on with the experimental features, and include non revised bindings or work in progress in there as well.

K

So the jars from the repo aren’t ready to just put them into the addons folder, it has to be compiled first?
That would explain why it doesn’t work.
If you can send me a compiled jar would be great, then I’ll try that out.

I can send you a jar in 2 weeks - patience will be a virtue :/)

Of course, I’ll wait for it.
If I get surprisingly much spare time and set a eclipsedevelopementenviroment up and compile it myself I’ll let you know, but I don’t really think so :wink:

Hi Karel :slight_smile:

Could you please send the KNX 2.0 jar file to me as well? Would be truly appreciated.

Thanks
Chris

I haven’t received it till now, so yes, can you please send it, @kgoderis?

Sure - where to / email address?

nico@nibweb.net - thank you!

Hi @kgoderis,

would you please be so kind and send it to me too?

ch.wrobel@gmx.net

many thanks.