I am trying to upgrade in openHAB 2.4 only one existing binding (official repository) from 2.4 to 2.5.0-SNAPSHOT.
Is it even possible to accomplish it at all?
What I have done:
Created a jar file for a binding 2.5.0 version (git/maven)
Unzipped openhab-addons-2.4.0.kar
Replaced in \repository\org\openhab\binding a current 2.4 version of the jar file with a new 2.5 in 2.5 subfolder, deleted 2.4 folder
Edited /META-INF/INDEX.LIST - changed 2.4 to 2.5 for the binding
zipped a new openhab-addons-2.4.0.kar
stopped openhab2 service
deleted /var/lib/openhab2/cache
deleted /var/lib/openhab2/tmp
started openhab2 service
feature:list | grep openhab- output still shows binding 2.4 version
Paper UI shows it as a 2.4 version as well.
I can’t figure it out.
Am I doing something wrong?
It didn’t work for me either. That is why I did what I described.
The binding in question already exists in 2.4 openhab-addons-2.4. If I understand it correctly, that /addons folder is for some new bindings. And addons.cfg file is for listing those new bindings or existing ones to install them not via GUI. Correct me if I am wrong.
…unless there are other dependencies needed. That is why there is a manual update script for Z-Wave & ZigBee, for instance. You must uninstall any conflicting existing binding before placing a new one in the addons folder though.
I have found in /var/lib/openhab2/tmp/mvn/org/openhab/binding that binding 2.4 jar file.
That means that when openHAB can’t find 2.4 jar file in openhab-addons-2.4.0.kar it builds it from the github source via the Internet.
openHAB doesn’t accept 2.5 because it expects 2.4.
I have disconnected a server from the Internet and a binding installation failed:
No. The addons folder is for any manual installed binding. Once a jar file is put in that directory it just works (almost) like a regular binding. The version number in the file(name) has no meaning other than being a version number. The reason a 2.5 binding doesn’t work is either because it is dependent on newer code or because it misses dependencies on other libraries (the missing dependencies is why I wrote almost) . It is possible to install those dependencies via karaf console, But I don’t know the exact command out-of-my+head.
No. It downloads the jar from the internet.
I don’t know if this specific 2.5 binding works on 2.4. But normally, to try, uninstall the 2.4 version, if installed, and then put the 2.5 in the addons directory. In the logging you’ll see if that will work or not.
Does it download the full version of the binding or missing dependencies? Why did it download 2.4 version?
Is this a problem only with this particular samsungtv binding?
In which case does openHAB download that binding from the Internet?
What a binding uninstallation process does in openHAB? The old version of the binding is still in kar and it is loaded in /tmp folder. From where is it removed?
If I put a new version jar file into the addons directory and there is still an old binding jar file in a kar file, does openHAB install a new jar placed into addons directory and ignore an old version in a kar?
How does Paper UI (Karaf) determine a binding version? Should it list an installed binding as 2.5 and not 2.4.
Sorry for bothering you, but I need to figure out on how it works.
I will try with other bindings to make sure that this particular doesn’t work as it supposed to.
I know you can delete all the contents of that tmp folder and OH can recreate what it needs. Perhaps it keeps the old version so it it ready to reinstall without downloading. That is really a developer question. I have never paid any attention to the contents of the tmp or cache folders.
Where are you downloading the new jar file from?
Thank you for that link, but I have created/built this 2.5 SNAPSHOT from the Github source. This file I injected into kar and tried it separately in /addons directory.
/tm/mvn downloaded 2.4 version with the size of 34KB and that full size 2.4 is 57 KB (2.5 is 107KB). Probably openHAB downloads only some missing binding dependencies into /tmp/mvn .
In the log file flooded with java warnings/errors (after my aggressive handling of the situation it created a lot of 16MB files, at least I know that a log rotation works ) I have found a similar issue (Problem dependencies) gson missing dependency.
bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar
and
bundle:install http://central.maven.org/maven2/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar
It didn’t help with the 2.5 installation.
I am giving up on this particular binding at least for now (openHAB 2.5 stable is a goal). I basically needed it only as a source of presence (a powered on TV). It doesn’t deserve all those efforts.
This is a Development rather than an Installation question then.
Please be aware many of the developers do not use this forum. They focus on issues submitted on GitHub.
Eventually, I was able to get rid off 2.4 and to have a 2.5 version active.
karaf feature and bundle commands helped me to find a problem.
The SamsungTV Binding deployed via /addons directory is listed only under bundle:list: 354 │ Active │ 80 │ 2.5.0.201911040338 │ openHAB Add-ons :: Bundles :: SamsungTV Binding
And it is not listed as installed in feature:list
2.4 still there (a feature).
It is a bit confusing, when a binding bundle is deployed via /addons, that Paper UI Binding list shows a binding as not installed but in reality it is active and running. My guess, Paper UI lists available features and if a bundle is installed via Paper UI or via addons.cfg it lists it as installed.
That running binding only shows up when a thing is being added manually via Paper UI.