Openhab Status shows disabled ? (/usr/lib/systemd/system/openhab.service; disabled)

Hi,

I exactly installed Openhab according apt-get … on a Raspi PI" with Jessie. I started OH according wiki
with sudo systemctl start openhab.

Any ideas?

Many thx in advance

Peter

You can try enabling it with this command:

sudo systemctl enable openhab.service

Hi works,

but changing user & group to to root dosn’t solve the problem with

Jan 05 16:07:38 raspberrypi openhab.sh[1088]: 2016-01-05 16:07:38.036 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyAMA0
Jan 05 16:07:38 raspberrypi openhab.sh[1088]: 2016-01-05 16:07:38.126 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyAMA0 does not exist
Jan 05 16:07:42 raspberrypi openhab.sh[1088]: 2016-01-05 16:07:42.943 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been shut down

Double check the following:

Make sure openhab is indeed in the dialout group

getent group dialout

It should read something like dialout:x:20:openhab

Make sure /dev/ttyAMA0 exists and has usable permissions

ls -l /dev/ttyAMA0

It should read something like crw-rw---- 1 root dialout 188, 0 Jan 5 10:58 /dev/ttyUSB0

Make sure your z-wave controller is actually at /dev/ttyAMA0 and not /dev/ttyAMA1 or /dev/ttyUSB0 or the like. You can check this by seeing which devices disappear when you unplug and which reappear when you replug the device back in. NOTE: when you replug it back in it may one up the number so it would start as /dev/ttyUSB0, unplug and this device disappears, then plug it back in and it will show up as /dev/ttyUSB1.

Make sure openHAB is running as root

With the changes to that config file openHAB should be running as root:root. Check this by running:

ps-elf | grep openhab

You should see a line like the following:

4 S openhab  12426     1  0  80   0 -  1119 wait   Jan04 ?        00:00:00 /bin/sh /usr/share/openhab/bin/openhab.sh -o

The third column is the user who owns the process. In your case it should be “root” now.

Hi,

first many thx for your support, I checked all, all result are as expected, but error message stil there, Yesterday I ordered a zwave Gen5 Stick. In think this is a special issue with the razzbery board …Hope this works …

Peter

Hi,

one question: after booting the raspberry I get with: sudo /etc/init.d/openhab status

pi@raspberrypi:~ $ sudo /etc/init.d/openhab status
● openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; enabled)
Active: active (running) since Mi 2016-01-06 13:04:16 CET; 1min 7s ago
Docs: http://www.openhab.org
Process: 447 ExecStartPre=/usr/share/openhab/bin/setpermissions.sh (code=exited, status=0/SUCCESS)
Main PID: 688 (openhab.sh)
CGroup: /system.slice/openhab.service
├─688 /bin/sh /usr/share/openhab/bin/openhab.sh -o
└─710 /usr/bin/java -Dlogback.configurationFile=/etc/openhab/logback.xml -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true…

Jan 06 13:04:16 raspberrypi setpermissions.sh[447]: setting permissions and owner openhab:openhab for /usr/share/openhab/webapps/static
Jan 06 13:04:16 raspberrypi setpermissions.sh[447]: setting permissions and owner openhab:openhab for /etc/openhab/jetty/etc/keystore
Jan 06 13:04:16 raspberrypi setpermissions.sh[447]: setting permissions and owner openhab:openhab for /etc/openhab/configurations/users.cfg
Jan 06 13:04:16 raspberrypi systemd[1]: Started Starts and stops the openHAB Home Automation Bus.
Jan 06 13:04:54 raspberrypi openhab.sh[688]: 2016-01-06 13:04:54.220 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been star…v1.7.1).
Jan 06 13:04:59 raspberrypi openhab.sh[688]: 2016-01-06 13:04:59.397 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - mDNS service has been started
Jan 06 13:04:59 raspberrypi openhab.sh[688]: 2016-01-06 13:04:59.588 [INFO ] [o.o.i.s.i.DiscoveryServiceImpl] - Service Discovery initializat…mpleted.
Jan 06 13:05:09 raspberrypi openhab.sh[688]: 2016-01-06 13:05:09.316 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
Jan 06 13:05:14 raspberrypi openhab.sh[688]: 2016-01-06 13:05:14.860 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /openhab.app
Jan 06 13:05:22 raspberrypi openhab.sh[688]: 2016-01-06 13:05:22.198 [INFO ] [.o.io.habmin.HABminApplication] - Started HABmin REST API at /s…s/habmin
Hint: Some lines were ellipsized, use -l to show in full.
pi@raspberrypi:~ $ ls -l /dev/ttyAMA0
crw–w---- 1 root tty 204, 64 Jan 6 13:04 /dev/ttyAMA0

it seems to me Opnehab is started:

After

pi@raspberrypi:~ $ sudo systemctl start openhab
pi@raspberrypi:~ $ sudo /etc/init.d/openhab status

I get this result:

pi@raspberrypi:~ $ sudo /etc/init.d/openhab status
● openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; enabled)
Active: active (running) since Mi 2016-01-06 13:04:16 CET; 3min 24s ago
Docs: http://www.openhab.org
Process: 447 ExecStartPre=/usr/share/openhab/bin/setpermissions.sh (code=exited, status=0/SUCCESS)
Main PID: 688 (openhab.sh)
CGroup: /system.slice/openhab.service
├─688 /bin/sh /usr/share/openhab/bin/openhab.sh -o
└─710 /usr/bin/java -Dlogback.configurationFile=/etc/openhab/logback.xml -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djet…

Jan 06 13:05:22 raspberrypi openhab.sh[688]: 2016-01-06 13:05:22.198 [INFO ] [.o.io.habmin.HABminApplication] - Started HABmin REST API at /services/habmin
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.760 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, port = /dev/ttyAMA0
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.763 [INFO ] [.z.internal.ZWaveActiveBinding] - Update config, healtime = 2
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.767 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been started
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.861 [INFO ] [b.z.i.protocol.ZWaveController] - Starting Z-Wave controller
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.865 [INFO ] [b.z.i.protocol.ZWaveController] - Z-Wave timeout is set to 5000ms. S…is false.
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.868 [INFO ] [b.z.i.protocol.ZWaveController] - Connecting to serial port /dev/ttyAMA0
Jan 06 13:05:27 raspberrypi openhab.sh[688]: 2016-01-06 13:05:27.962 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyAMA0 does not exist
Jan 06 13:05:32 raspberrypi openhab.sh[688]: 2016-01-06 13:05:32.772 [INFO ] [.service.AbstractActiveService] - ZWave Refresh Service has been shut down
Jan 06 13:07:36 raspberrypi systemd[1]: Started Starts and stops the openHAB Home Automation Bus.
Hint: Some lines were ellipsized, use -l to show in full.
pi@raspberrypi:~ $ ls -l /dev/ttyAMA0
crw–w---- 1 root tty 204, 64 Jan 6 13:04 /dev/ttyAMA0

Peter

Yes, its running. The only problem I see is the z-wave error but you are already working to deal with that.