openHAB2 conflicts on homegear image (Pi3, Jessie)

I installed OpenHAB2 following the instructions for PI and Linux using the “Package Repository Installation”.
The installation was done on a fresh homegear image (Raspian) from this page:

If I start openHAB2 with “sudo” from /usr/share/openhab2/, everything is fine.

But when I use “sudo /etc/init.d/openhab2 start” or with autostart, I get the following error:

Okt 23 19:42:24 homegearpi systemd[1]: Started openHAB 2 - empowering the smart home.
Okt 23 19:42:24 homegearpi[6897]: Launching the openHAB runtime…
Okt 23 19:43:31 homegearpi[6897]: wiringPiSetup: Must be root. (Did you forget sudo?)
Okt 23 19:43:31 homegearpi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE
Okt 23 19:43:32 homegearpi stop[7664]: stop: Ignoring predefined value for KARAF_HOME

How can I fix this problem?


Hello Albert,
the homegear image comes preinstalled with openhab and judging by this line it’s still openHAB 1.8. I would guess that’s your problem, you have now two conflicting versions installed. The mentioning of “wiringPiSetup” is also uncommon to me. Not sure if it’s part of the normal openHAB setup.

To solve your problem, you should uninstall both versions and then start fresh with openHAB 2 following the guide.

However this will be bothersome. Consider installing openHABian on your Raspberry Pi. It’s an extended Raspbian setup with openHAB pre-installed. From the included menu (sudo openhabian-config) you can install homegear with one click. So it’s similar to the homegear image but “the other way around”.

Thanks for the fast reply.
I used explicitly the image without OpenHAB preinstalled. So this should not be the problem (hopefully).

Ah… in this case I have to say that a few things could be the problem. Solving it might take a few minutes, installing openHABian takes 45 :upside_down:

I switched to openHABian:

  • First run: everything was fine

  • I could use the Paper UI und I installed a few bindings (hue, homematic, harmony hub, denon, netatmo, squeezebox, opensprinkler)

  • I installed home gear using “sudo openhabian-config”, changed the config to use my cul and paired a first homematic device --> everything fine

  • I rebooted the pi to load the new home gear configuration … and openhab stopped working :frowning:

  • When using “sudo systemctl status openhab2.service” I can see the same error than before:

    [16:32:04] pi@openHABianPi:/var/log/openhab2$ sudo systemctl status openhab2.service
    ● openhab2.service - openHAB 2 - empowering the smart home
       Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
       Active: deactivating (stop) (Result: exit-code) since Sat 2016-10-29 16:32:04 CEST; 571ms ago
      Process: 14300 ExecStart=/usr/share/openhab2/ server (code=exited, status=1/FAILURE)
     Main PID: 14300 (code=exited, status=1/FAILURE);         : 14661 (karaf)
       CGroup: /system.slice/openhab2.service
                 ├─14661 /bin/sh /usr/share/openhab2/runtime/karaf/bin/karaf stop
                 ├─14759 /usr/lib/jvm/java-8-oracle/jre/bin/java -version
                 └─14760 grep ^IBM

    Oct 29 16:31:35 openHABianPi systemd[1]: Started openHAB 2 - empowering the smart home.
    Oct 29 16:31:35 openHABianPi[14300]: Launching the openHAB runtime...
    Oct 29 16:32:04 openHABianPi[14300]: wiringPiSetup: Must be root. (Did you forget sudo?)
    Oct 29 16:32:04 openHABianPi systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE
    Oct 29 16:32:05 openHABianPi stop[14661]: stop: Ignoring predefined value for KARAF_HOME 

Maybe it is a problem with a specific binding???

How can I uninstall a binding from the command line (because no UI is working) … OpenHAB2 restarts every minute :frowning:

Additionally I found the following log file (user data/cache):

!SESSION 2016-10-29 15:36:32.499 -----------------------------------------------
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=arm, WS=gtk, NL=en_US

!ENTRY org.glassfish.hk2.osgi-resource-locator 4 0 2016-10-29 15:36:32.500
!MESSAGE FrameworkEvent ERROR
org.osgi.framework.BundleException: Exception in org.apache.karaf.features.internal.service.FeaturesServiceImpl$3.end()
at org.eclipse.osgi.internal.framework.OSGiFrameworkHooks$CoreResolverHookFactory.handleHookException(
at org.eclipse.osgi.internal.framework.OSGiFrameworkHooks$CoreResolverHookFactory$CoreResolverHook.end(
at org.eclipse.osgi.container.ModuleResolver$ResolveProcess.resolve(
at org.eclipse.osgi.container.ModuleResolver.resolveDelta(
at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(
at org.eclipse.osgi.container.ModuleContainer.resolve(
at org.eclipse.osgi.container.ModuleContainer.resolve(
at org.eclipse.osgi.container.Module.start(
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(
at org.eclipse.osgi.framework.eventmgr.EventManager$

Again me :slight_smile:

I started OpenhAB with “sudo ./” and everything was fine …
I deleted the Denon-Binding and the OpenSprinkler Binding and restarted the PI

What should I say : Now, OpenHAB2 is up and running :slight_smile:
I think that the Denon-Binding was the problem …

it’s probably a good idea to do things step by step. However installing addons should not result in a problem of the whole system! A few bindings need special privileges on your system (which you can give without the need to execute as root) and the denon binding might be one of these.

Do you still see the line "wiringPiSetup: Must be root. (Did you forget sudo?)"
I do not and this is obviously the problem here.