Raspberry Pi3 with jessie OH2 services not working

  • Platform information: Raspberry Pi 3 with OS Jessie
    • Hardware: CPUArchitecture/RAM/storage
    • OS: what OS is used and which version
    • Java Runtime Environment: which java platform is used and what version

pi@Raiba-SmartHome:/usr/share/openhab2 $ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (Zulu Embedded 8.21.0.57-linux-aarch32hf) (build 1.8.0_131-b57)
OpenJDK Client VM (Zulu Embedded 8.21.0.57-linux-aarch32hf) (build 25.131-b57, mixed mode, Evaluation)

  • openHAB version:
    OpenHAB2

*** Issue of the topic: I have installed Raspberrian Jessie and then Java Zulu, Later installed OH2 as per guide. **

I am able to see the openhab2.services is active and running but the same is not accessible

pi@Raiba-SmartHome:/usr/share/openhab2 $ systemctl status openhab2.service
â—Ź openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: active (running) since Sat 2017-11-25 17:17:04 UTC; 52min ago
Docs: http://docs.openhab.org
https://community.openhab.org
Main PID: 506 (karaf)
CGroup: /system.slice/openhab2.service
├─506 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
└─836 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 …
pi@Raiba-SmartHome:/usr/share/openhab2 $

pi@Raiba-SmartHome:/usr/share/openhab2 $ ps -ef | grep 506
openhab 506 1 0 17:31 ? 00:00:00 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
openhab 836 506 0 17:31 ? 00:00:23 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -Djetty.host=0.0.0.0 -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Djava.endorsed.dirs=/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/jre/lib/endorsed:/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/jre/lib/ext:/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/usr/share/openhab2/runtime/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
root 1506 2 0 18:11 ? 00:00:00 [kworker/u8:0]
pi 1508 1201 0 18:11 pts/0 00:00:00 grep --color=auto 506
pi@Raiba-SmartHome:/usr/share/openhab2 $ ps -ef | grep 5836

pi@Raiba-SmartHome:/usr/share/openhab2 $ ps -ef | grep 836
openhab 836 506 0 17:31 ? 00:00:23 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -
Djetty.host=0.0.0.0 -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -
Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Djava.endorsed.dirs=/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/jre/lib/endorsed:/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/jre/lib/ext:/zulu/ezdk-1.8.0_131-8.21.0.57-eval-linux_aarch32hf/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/usr/share/openhab2/runtime/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.0.8.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
pi 1513 1201 0 18:11 pts/0 00:00:00 grep --color=auto 836
pi@Raiba-SmartHome:/usr/share/openhab2 $

  • Please post configurations (if applicable):
    pi@Raiba-SmartHome:/usr/share/openhab2 $ netstat -tulpn
    (Not all processes could be identified, non-owned process info
    will not be shown, you would have to be root to see it all.)
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:5900 0.0.0.0:* LISTEN -
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
    tcp6 0 0 :::5900 :::* LISTEN -
    tcp6 0 0 127.0.0.1:41973 :::* LISTEN -
    tcp6 0 0 :::22 :::* LISTEN -
    udp 0 0 0.0.0.0:5353 0.0.0.0:* -
    udp 0 0 0.0.0.0:42465 0.0.0.0:* -
    udp 0 0 0.0.0.0:68 0.0.0.0:* -
    udp 0 0 192.168.1.130:123 0.0.0.0:* -
    udp 0 0 127.0.0.1:123 0.0.0.0:* -
    udp 0 0 0.0.0.0:123 0.0.0.0:* -
    udp6 0 0 :::5353 :::* -
    udp6 0 0 :::40935 :::* -
    udp6 0 0 fe80::d516:2dfb:f4a:123 :::* -
    udp6 0 0 ::1:123 :::* -
    udp6 0 0 :::123 :::* -
    pi@Raiba-SmartHome:/usr/share/openhab2 $

Please suggest or how do I get OpenHAB2 working?

Some errors with the runtime will be shown in joirnalctl, does the command:

sudo journalctl -u openhab2.service -b

show anything specific? Next best place to look is in /var/log/openhab2/*.log which will show configuration errors.

Outout from log file
pi@Raiba-SmartHome:~ $ cat /var/log/openhab2/openhab.log
2017-11-25 16:31:59.276 [WARN ] [internal.service.FeaturesServiceImpl] - Error loading FeaturesService state
java.io.IOException: Unexpected end of input at 1:1
at org.apache.karaf.features.internal.util.JsonReader.error(JsonReader.java:337)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.util.JsonReader.expected(JsonReader.java:331)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.util.JsonReader.readValue(JsonReader.java:93)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.util.JsonReader.parse(JsonReader.java:58)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.util.JsonReader.read(JsonReader.java:52)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.StateStorage.load(StateStorage.java:42)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.loadState(FeaturesServiceImpl.java:341)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.(FeaturesServiceImpl.java:274)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:213)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:246)[8:org.apache.karaf.features.core:4.0.8]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

2017-11-25 16:32:21.223 [ERROR] [ficate.internal.CertificateGenerator] - Failed to generate a new SSL Certificate.
java.security.cert.CertificateException: Failed to generate the new certificate.
at org.openhab.io.jetty.certificate.internal.CertificateGenerator.generateCertificate(CertificateGenerator.java:202)[168:org.openhab.io.jetty.certificate:2.1.0]
at org.openhab.io.jetty.certificate.internal.CertificateGenerator.start(CertificateGenerator.java:84)[168:org.openhab.io.jetty.certificate:2.1.0]
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_131]
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:941)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:318)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:411)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1287)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:860)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[8:org.apache.karaf.features.core:4.0.8]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[8:org.apache.karaf.features.core:4.0.8]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
Caused by: java.security.NoSuchAlgorithmException: EC KeyPairGenerator not available
at java.security.KeyPairGenerator.getInstance(KeyPairGenerator.java:218)[:1.8.0_131]
at org.openhab.io.jetty.certificate.internal.CertificateGenerator.generateCertificate(CertificateGenerator.java:159)[168:org.openhab.io.jetty.certificate:2.1.0]
… 20 more

Would you be able to put logs inside

```
code tags
```

so that it’s easier to read? But from what I can see, there’s a problem with your instance of Java and it’s ability to create EC keys. Have you got multiple versions installed? I’ve never seen Zulu have a problem with certificate generation.

Hey Ben,

Thanks for your reply, I decided to format and reinstall it again.

Now, I have installed,

OS:

It comes with Default Java

Now,
I will install either Zulu which is 1.8.0_131 OR I have option of JDK 8u152 from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

After which I will try to do manual OpenHab2 installation.

If, you have any post which can help me for clean installation.

No problem, just for reference this is my setup with a openHAB installed via apt-get:

$ cat /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
$ java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)

I’d recommend installing zulu-embedded-8 via the apt repository:

http://zulu.org/zuludocs-folder/#ZuluUserGuide/PrepareZuluPlatform/AttachAPTRepositoryUbuntuOrDebianSys.htm

1 Like

Do you have any idea why this Set Locals gives error during apt-get???

Reading changelogs... Done
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory'''

Never seen this before, is your SD card okay? There are a few popular answers in the following: