Having a lot of trouble installing bindings

Hi, I can’t figure out how to install any bindings. I’m using openhabian and I go to Paper UI -> Addons -> Bindings. Hit install on the binding I want and the circle just spins forever. If I refresh it just shows the install button again. Any ideas on whats going on? Thanks!

EDIT:

I found the log and it gave me these errors.

This is when I try to install through paperui, doesn’t give much info

2017-03-26 22:31:41.947 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-mqtt, openhab-ui-habmin, openhab-binding-sonos': Error
2017-03-26 22:56:33.246 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-mqtt, openhab-ui-habmin, openhab-binding-sonos': Error
2017-03-26 22:57:07.628 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-mqtt, openhab-ui-habmin, openhab-binding-network, openhab-binding-sonos': Error
2017-03-26 23:00:23.315 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-persistence-mqtt, openhab-ui-habmin, openhab-binding-network, openhab-binding-sonos, openhab-binding-mqtt1': Error

and this when I try to manual install a binding. Which gives more info but I would assume these packages come installed with openhab?

2017-03-26 22:31:40.870 [ERROR] [org.openhab.binding.mqtt            ] - FrameworkEvent ERROR - org.openhab.binding.mqtt
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mqtt [183]
  Unresolved requirement: Import-Package: org.openhab.core.binding

	at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

I am still completely stuck on this and have done a full re-install and I still get the same issue. Is it maybe some sort of permissions issue, I notice on a lot of the tutorials they want you to use openhab as the user but in openhabian it uses the user openhabian. Maybe those missing files are set to openhab or root only permissions??

I’m super new to linux!

This looks relevant

1 Like

Thanks,

Seems like the solution offered there no longer exists. I get a 404 for the page.

I found something about the compatibility layer here http://docs.openhab.org/developers/development/compatibilitylayer.html

but the command provided doesn’t work, going to do some googling.I have another problem though as I am also unable to install 2.0 bindings from paperui, although I am able to intall them manually.

I’m having trouble finding steps on how to install the comparability layer.

They steps are here

http://docs.openhab.org/developers/development/compatibilitylayer.html

Best
Sami

1 Like

Hello,
a word of general advice. Your problem looks pretty unique and is not what would be expected from a fresh openHAB/openHABian installation. Therefore I’d assume there is a deeper problem outside of openHAB. Instead of trying to fix the apparent error I’d try to eliminate the outside problem that’s causing the issue.
Start by flashing openHABian once again. If it doesn’t change anything or fails, check and/or replace the SD card.

2 Likes

I’m going to do as suggested. Ill post an update after I have tried.

That did the trick thanks!

@ThomDietrich - referencing this thread as I’m having a similar issue. Hoping you can point me in the right direction as my head seems to be spinning on documentation. Where could I find some direction on “backing up” my current OpenHAB config and moving it onto a fresh OpenHABian install?

I’m thinking I am in need of doing this, and don’t want to run into the lost off all my work. Additionally I don’t want to have permissions issues when restoring things. And finally, I want to ensure any quirky thing I have in my current setup, doesn’t get moved to the new install.

A bit complicated I know - but it seems to be my last hope as I currently have this issue as the root cause of a faulty startup of my ZWave binding, causing multiple rules to be triggered after startup when the binding finally gets past these “requirements” that it doesn’t seem to find upon initial starts.

Logs for reference:

2017-09-24 21:20:52.985 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zwave.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zwave [10]
  Unresolved requirement: Import-Package: gnu.io
  Unresolved requirement: Import-Package: com.thoughtworks.xstream
    -> Export-Package: com.thoughtworks.xstream; bundle-symbolic-name="org.eclipse.smarthome.config.xml"; bundle-version="0.9.0.201709121704"; version="0.0.0"
       org.eclipse.smarthome.config.xml [100]
         Unresolved requirement: Import-Package: org.osgi.service.component.annotations; resolution:="optional"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core.i18n
           -> Export-Package: org.eclipse.smarthome.config.core.i18n; bundle-symbolic-name="org.eclipse.smarthome.config.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
              org.eclipse.smarthome.config.core [97]
                Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
                Unresolved requirement: Import-Package: org.osgi.service.component.annotations; resolution:="optional"
                Unresolved requirement: Import-Package: org.apache.commons.lang.reflect
                  -> Export-Package: org.apache.commons.lang.reflect; bundle-symbolic-name="org.apache.commons.lang"; bundle-version="2.6.0"; version="2.6.0"
                     org.apache.commons.lang [40]
                       No resolution report for the bundle.                Unresolved requirement: Import-Package: com.google.common.base
                  -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="18.0.0"; version="18.0.0"; uses:="javax.annotation"
                     com.google.guava [26]
                       Unresolved requirement: Import-Package: javax.annotation; resolution:="optional"
                         -> Export-Package: javax.annotation; bundle-symbolic-name="javax.annotation-api"; bundle-version="1.2.0"; version="1.2.0"
                            javax.annotation-api [30]
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.net
                  -> Export-Package: org.eclipse.smarthome.core.net; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
                     org.eclipse.smarthome.core [101]
                       Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
                       Unresolved requirement: Import-Package: org.osgi.service.component.annotations; resolution:="optional"
                       Unresolved requirement: Import-Package: org.osgi.service.component
                         -> Export-Package: org.osgi.service.component; bundle-symbolic-name="org.apache.felix.scr"; bundle-version="2.0.12"; version="1.3.0"; uses:="org.osgi.framework"
                            org.apache.felix.scr [41]
                              Unresolved requirement: Import-Package: org.apache.felix.service.command; version="[0.6.0,1.0.0)"; status="provisional"; resolution:="optional"
                              Unresolved requirement: Import-Package: org.apache.felix.shell; version="[1.0.0,1.1.0)"; resolution:="optional"
                       Unresolved requirement: Import-Package: com.google.common.collect
                         -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="18.0.0"; version="18.0.0"; uses:="com.google.common.base,javax.annotation,com.google.common.primitives,com.google.common.math"
                       Unresolved requirement: Import-Package: org.apache.commons.io
                         -> Export-Package: org.apache.commons.io; bundle-symbolic-name="org.apache.commons.io"; bundle-version="2.2.0"; version="2.2.0"
                            org.apache.commons.io [39]
                              No resolution report for the bundle.                       Unresolved requirement: Import-Package: com.google.common.base
                         -> Export-Package: com.google.common.base; bundle-symbolic-name="com.google.guava"; bundle-version="18.0.0"; version="18.0.0"; uses:="javax.annotation"
                       Unresolved requirement: Import-Package: org.apache.commons.lang
                         -> Export-Package: org.apache.commons.lang; bundle-symbolic-name="org.apache.commons.lang"; bundle-version="2.6.0"; version="2.6.0"
                       Unresolved requirement: Import-Package: com.google.gson
                         -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.3.1"; version="2.3.1"
                            com.google.gson [25]
                              No resolution report for the bundle.                Unresolved requirement: Import-Package: com.google.common.collect
                  -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="18.0.0"; version="18.0.0"; uses:="com.google.common.base,javax.annotation,com.google.common.primitives,com.google.common.math"
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common.registry
                  -> Export-Package: org.eclipse.smarthome.core.common.registry; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common
                  -> Export-Package: org.eclipse.smarthome.core.common; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.events
                  -> Export-Package: org.eclipse.smarthome.core.events; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"; uses:="org.eclipse.smarthome.core.items,org.osgi.service.event,org.eclipse.smarthome.core.types"
                Unresolved requirement: Import-Package: org.osgi.service.component
                  -> Export-Package: org.osgi.service.component; bundle-symbolic-name="org.apache.felix.scr"; bundle-version="2.0.12"; version="1.3.0"; uses:="org.osgi.framework"
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.i18n
                  -> Export-Package: org.eclipse.smarthome.core.i18n; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
                Unresolved requirement: Import-Package: com.google.gson
                  -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.3.1"; version="2.3.1"
                Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common.osgi
                  -> Export-Package: org.eclipse.smarthome.core.common.osgi; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.core.i18n
           -> Export-Package: org.eclipse.smarthome.core.i18n; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common.registry
           -> Export-Package: org.eclipse.smarthome.core.common.registry; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common
           -> Export-Package: org.eclipse.smarthome.core.common; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.config.core
           -> Export-Package: org.eclipse.smarthome.config.core; bundle-symbolic-name="org.eclipse.smarthome.config.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.core.service
           -> Export-Package: org.eclipse.smarthome.core.service; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
         Unresolved requirement: Import-Package: org.osgi.service.component
           -> Export-Package: org.osgi.service.component; bundle-symbolic-name="org.apache.felix.scr"; bundle-version="2.0.12"; version="1.3.0"; uses:="org.osgi.framework"
         Unresolved requirement: Import-Package: org.eclipse.smarthome.core.common.osgi
           -> Export-Package: org.eclipse.smarthome.core.common.osgi; bundle-symbolic-name="org.eclipse.smarthome.core"; bundle-version="0.9.0.201709121704"; version="0.0.0"
  Unresolved requirement: Import-Package: com.thoughtworks.xstream.io
    -> Export-Package: com.thoughtworks.xstream.io; bundle-symbolic-name="org.eclipse.smarthome.config.xml"; bundle-version="0.9.0.201709121704"; version="0.0.0"
  Unresolved requirement: Import-Package: com.google.gson
    -> Export-Package: com.google.gson; bundle-symbolic-name="com.google.gson"; bundle-version="2.3.1"; version="2.3.1"
  Unresolved requirement: Import-Package: com.google.common.collect
    -> Export-Package: com.google.common.collect; bundle-symbolic-name="com.google.guava"; bundle-version="18.0.0"; version="18.0.0"; uses:="com.google.common.base,javax.annotation,com.google.common.primitives,com.google.common.math"
  Unresolved requirement: Import-Package: com.thoughtworks.xstream.converters
    -> Export-Package: com.thoughtworks.xstream.converters; bundle-symbolic-name="org.eclipse.smarthome.config.xml"; bundle-version="0.9.0.201709121704"; version="0.0.0"
  Unresolved requirement: Import-Package: com.thoughtworks.xstream.io.xml
    -> Export-Package: com.thoughtworks.xstream.io.xml; bundle-symbolic-name="org.eclipse.smarthome.config.xml"; bundle-version="0.9.0.201709121704"; version="0.0.0"
  Unresolved requirement: Import-Package: com.thoughtworks.xstream.annotations
    -> Export-Package: com.thoughtworks.xstream.annotations; bundle-symbolic-name="org.eclipse.smarthome.config.xml"; bundle-version="0.9.0.201709121704"; version="0.0.0"

	at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) [?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253) [8:org.apache.felix.fileinstall:3.6.0]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225) [8:org.apache.felix.fileinstall:3.6.0]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512) [8:org.apache.felix.fileinstall:3.6.0]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361) [8:org.apache.felix.fileinstall:3.6.0]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312) [8:org.apache.felix.fileinstall:3.6.0]

Hello Shawn,

first of all, you basically need to follow the “manually” instructions given under http://docs.openhab.org/installation/linux.html#backup-and-restore

The crux of it: You need to backup the two folders /etc/openhab2 and /var/lib/openhab2 and restore them on the new system (without the tmp and cache data). After installing openHABian, stop openHAB, move/delete existing configuration and restore the old config. Next you can use the sudo openhabian-config configuration tool to “Fix Permissions”. Restart openHAB and you should be good to go.
The maybe easiest way to backup and restore files with the comfort of your main PC/Mac, access your system via Samba network shares. openHABian provides the openHAB-share network share, which contains all locations you need to worry about, including a README file with further tips.
One last tip: Depending on your current configuration you might want to be careful to only restore files you really need.

@ThomDietrich - thank you, this helps. I was mostly thinking everything you mentioned was what I would be doing, but I like to validate (trust but verify!). I’m sure everyone here can imagine how much crap we get when we touch, change, break, or take down our smart home automation! :stuck_out_tongue:

So before doing so I wanted to be sure I knew what I needed to do. The plan is to use a secondary SD card so in case of disaster, we just go backwards to the old SD card that works, but with some annoyance. Interesting to see they added a backup tool in 2.2! I wasn’t aware of this.

One question for clarification - I know you mentioned only restoring files needed, are there specific things I need to focus on? Obviously site config, and I will need the core DB that holds the configs, and possibly state DB (rrd4j or similar) - but outside this I can skip most things I can imagine? Honestly the state DB can probably be skipped as well since I don’t care about my first startup here.

1 Like

Truth told :smiley:

That’s the great thing about the openHAB project. Many people are constantly adding improvements. The mentioned script and the instructions in the documentation got merged just a few hours ago…

I didn’t go into detail there because that really depends on your setup. My setup is 99% configuration files and my backup doesn’t even include the userdata folder… The only thing I need to do after a restore is reinstall all my bindings through paper UI. Besides that everything else is configured through config files. For persistence I am using InfluxDB and my setup works without restoreOnRestart (probably what you are referring to when you talk about restoing state).
But yes sure you are right, you just need to restore those specific files you actually see value in (jsondb, rrd4j, …). Hope that was helpful.

Interesting you should highlight having all the config done in config files. I tried switching in OH2 to using the interface to configure most things as I felt it would give me a cleaner and less convoluted mechanism to set things up. I keep finding myself somehow wishing I had stuck wit the old OH1 way and used all config files to populate things. When I manually controlled configs it turned out better it seems. :frowning: Unfortunately a bit late to turn back now - too much work already put in.

Ok, got it - ya mine are set with the restoreOnRestart function. I’m curious, how are you able to not use that yet have you states restored properly? I’m always intrigued at other mechanisms for persistence as it’s a bit of a tricky thing.

1 Like

I wouldn’t say that. Now that you already have everything in Paper UI / console, you just need to copy paste everything part by part. Probably takes a few minutes but definitely possible.

When talking about “have states restored” we need to differentiate:

  1. Items bound to bindings - those items will receive data via the binding channel representing the actual device state. No action needed.

  2. Items not bound to a binding or not initialized by it - those are initialized by a rule. (see below)

The important thought here is that I decided against restoring old probably outdated and potentially misleading states. My home automation system has to represent my home and should hence only work with what is actually known about it. I prefer to show “unknown” in the Sitemap rather than pretending for something to be OFF when it’s actually on.

Check out my configuration for more details:

@ThomDietrich - I have to validate, but I think you just uncovered a leftover misconception I had from OH1. Though my fear is that it’s still some items that are not bound to a binding that are causing my trouble as I think deeper.

In a previous life - I had a MiOS device (MiCasaVerde device) for ZWave control. Due to some restrictions and the infancy of the binding, I had to persist the states - or maybe OH hadn’t gotten there yet. Now I’ve moved into a situation where I have a ZWave stick attached to the system and it uses the ZWave binding (which I’m testing the security binding). So in my case, I don’t need to persist all my ZWave devices, which is the majority of my setup, as they should update from the channel as the binding starts.

Now I’m going to test setting up a persist group to mark items needing persistence, then skip out on the others. Let’s see if that helps fix an issue I have with my startup causing items to be triggered.

PS - On a positive note, I found out that it wasn’t actually a full re-build of my OH that I needed to solve the issue I saw above in this post. It turns out, it stemmed from an odd behavior I found from some update along the way. It seems that even though PaperUI said the Serial binding was installed, and I thought I had looked at the OSGi console - it wasn’t really. Once I simply ran the install on the console for it, the cascading errors went away!

1 Like

That is something people do differently. My personal opinion is that the use of a “persist group” is not the best option. You should already have (or define now) a location-based as well as function-based Groups and Items hierarchy. Check out these freshly added parts of the documentation:

I’d recommend to do selective persistence based on THOSE groups. Adding another group for persistence all over doesn’t make sense and breaks with the concept of nested locational and functional groups while making the configuration of what should be persisted oddly intransparent. See my persistence rules here.

I hear you. I haven’t quite fully gotten there yet or have really sat to think about it. For me I have a few random one off type items scattered and some that are part of other groups where they don’t have a binding associated. I won’t say my setup is EXTREMELY unique, but I do have some not so ordinary type of things. I’m exploring use of NodeRED as well for rules and potentially getting rid of some of my “virtual” items for use with Amazon Echo and HomeKit. So all of this is a bit of a changing thing for me. Turns out setting up the persistence group may not even solve the issue as well anyhow, I’m actually better using the restoreOnStartup option for ALL as my ZWave devices seem to trickle in after startup if I don’t restore immediately.

Thanks for the insight and the links to your setups. It’s always nice to see what other people have going on to help understand other ways folks are implementing things. I need to figure out how to handle publishing secure data, and then I’d like to do the same. Right now I have some sensitive info in my config, so I can’t be sharing it out publicly in a git repo … yet.

Hint: https://github.com/ThomDietrich/openhab-config/blob/master/.gitignore

Oh no, I know about that - but I wanted to actually still include the files. What I was thinking about was something I had seen/heard of that can allow the secure data to actually be tokenized in content. I have to do some digging on where I had seen it and get some insight how to use effectively. But the idea is it would allow me to actually use git to publish my actual content, but it would strip out the sensitive information with substituted information in a way that I can correct it upon pull. This would also be the goal so that I can actually have a non-local project copy to work from but an ability to de-tokenize it later on any installs.