Does Openhab run on Rock Pi 4?

Thanks, I’ll look into it to see if it happens on the C2 or only RockPi4. Note if you dont use that package I found the ‘system info’ binding would not work with ARM64 devices. So to get java working without using the udev:armhf these steps can be used. It should be as easy as removing udev:armhf and using libc6:armhf in its place. Also there may be a java enviroment option to remove.

Let me know if you find another way to get the system info binding working for the ARM64 processors, thanks…

@TheNetStriker
I edited and uploaded a script for you to try. Same location it is just called install-openhab-rockpi4.sh
Leave the RTC disabled as you will need to find what steps work for yours, it may be similar and the code is clear which parts are for the Odroids RTC…
I would expect that you will hit the hurdle of java crashes due to the big.little processors once you actually get things running. The script does not handle that for you but my post above gives a thread with a number of fixes for this in it.

EDIT: I seem to recall that the big.little issue was caused by a licensing issue with Samsung and since the rockchip ARM in the rockpi4 is not made by Samsung it may not have the same problem.

Good luck and be sure to post what you find as the RockPi4 does look good for 1 reason and that is the M2 NVME ability, would have preferred M2 sata as they are cheaper but that will change and nvme is better.

Thanks, I will try this script on the Ubuntu image. I’m currently running the Debian image and there the udev service runs without any problems. I’ve also just tested the Systeminfo binding and that works too.

What exactly didn’t work with the Systeminfo binding without the udev service?

I’ve just tested this and I also get this error with the systeminfo binding in Ubuntu image without the udev:armhf service. Here is the output when I try to install the udev:armhf service:

rock@openhabianpi:~$ sudo apt-get install udev:armhf
[sudo] password for rock: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libacl1:armhf libattr1:armhf libblkid1:armhf libkmod2:armhf libpcre3:armhf libselinux1:armhf libudev1:armhf libuuid1:armhf uuid-runtime
The following packages will be REMOVED:
  udev
The following NEW packages will be installed:
  libacl1:armhf libattr1:armhf libblkid1:armhf libkmod2:armhf libpcre3:armhf libselinux1:armhf libudev1:armhf libuuid1:armhf udev:armhf uuid-runtime
0 upgraded, 10 newly installed, 1 to remove and 0 not upgraded.
Need to get 1611 kB of archives.
After this operation, 1220 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libattr1 armhf 1:2.4.47-2build1 [8312 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libacl1 armhf 2.2.52-3build1 [13.7 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf libuuid1 armhf 2.31.1-0.4ubuntu3.3 [19.5 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf libblkid1 armhf 2.31.1-0.4ubuntu3.3 [112 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf libkmod2 armhf 24-1ubuntu3.2 [34.3 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libpcre3 armhf 2:8.39-9 [209 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports bionic/main armhf libselinux1 armhf 2.7-2build2 [58.9 kB]
Get:8 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf libudev1 armhf 237-3ubuntu10.15 [48.8 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main armhf udev armhf 237-3ubuntu10.15 [1075 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main arm64 uuid-runtime arm64 2.31.1-0.4ubuntu3.3 [31.8 kB]
Fetched 1611 kB in 0s (3285 kB/s)   
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 10.)
debconf: falling back to frontend: Readline
Selecting previously unselected package libattr1:armhf.
(Reading database ... 31118 files and directories currently installed.)
Preparing to unpack .../0-libattr1_1%3a2.4.47-2build1_armhf.deb ...
Unpacking libattr1:armhf (1:2.4.47-2build1) ...
Selecting previously unselected package libacl1:armhf.
Preparing to unpack .../1-libacl1_2.2.52-3build1_armhf.deb ...
Unpacking libacl1:armhf (2.2.52-3build1) ...
Selecting previously unselected package libuuid1:armhf.
Preparing to unpack .../2-libuuid1_2.31.1-0.4ubuntu3.3_armhf.deb ...
Unpacking libuuid1:armhf (2.31.1-0.4ubuntu3.3) ...
Selecting previously unselected package libblkid1:armhf.
Preparing to unpack .../3-libblkid1_2.31.1-0.4ubuntu3.3_armhf.deb ...
Unpacking libblkid1:armhf (2.31.1-0.4ubuntu3.3) ...
Selecting previously unselected package libkmod2:armhf.
Preparing to unpack .../4-libkmod2_24-1ubuntu3.2_armhf.deb ...
Unpacking libkmod2:armhf (24-1ubuntu3.2) ...
Selecting previously unselected package libpcre3:armhf.
Preparing to unpack .../5-libpcre3_2%3a8.39-9_armhf.deb ...
Unpacking libpcre3:armhf (2:8.39-9) ...
Selecting previously unselected package libselinux1:armhf.
Preparing to unpack .../6-libselinux1_2.7-2build2_armhf.deb ...
Unpacking libselinux1:armhf (2.7-2build2) ...
Selecting previously unselected package libudev1:armhf.
Preparing to unpack .../7-libudev1_237-3ubuntu10.15_armhf.deb ...
Unpacking libudev1:armhf (237-3ubuntu10.15) ...
Selecting previously unselected package udev:armhf.
Preparing to unpack .../8-udev_237-3ubuntu10.15_armhf.deb ...
Unpacking udev:armhf (237-3ubuntu10.15) over (237-3ubuntu10.15) ...
Selecting previously unselected package uuid-runtime.
Preparing to unpack .../9-uuid-runtime_2.31.1-0.4ubuntu3.3_arm64.deb ...
Unpacking uuid-runtime (2.31.1-0.4ubuntu3.3) ...
Setting up libudev1:armhf (237-3ubuntu10.15) ...
Setting up libattr1:armhf (1:2.4.47-2build1) ...
Setting up libuuid1:armhf (2.31.1-0.4ubuntu3.3) ...
Setting up libpcre3:armhf (2:8.39-9) ...
Setting up libkmod2:armhf (24-1ubuntu3.2) ...
Setting up libblkid1:armhf (2.31.1-0.4ubuntu3.3) ...
Setting up uuid-runtime (2.31.1-0.4ubuntu3.3) ...
Adding group `uuidd' (GID 114) ...
Done.
Warning: The home dir /run/uuidd you specified can't be accessed: No such file or directory
Adding system user `uuidd' (UID 109) ...
Adding new user `uuidd' (UID 109) with group `uuidd' ...
Not creating home directory `/run/uuidd'.
Created symlink /etc/systemd/system/sockets.target.wants/uuidd.socket → /lib/systemd/system/uuidd.socket.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libselinux1:armhf (2.7-2build2) ...
Processing triggers for systemd (237-3ubuntu10.15) ...
Setting up libacl1:armhf (2.2.52-3build1) ...
Setting up udev:armhf (237-3ubuntu10.15) ...
Job for systemd-udevd.service failed because a fatal signal was delivered to the control process.
See "systemctl status systemd-udevd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript udev, action "restart" failed.
● systemd-udevd.service - udev Kernel Device Manager
   Loaded: loaded (/lib/systemd/system/systemd-udevd.service; static; vendor preset: enabled)
   Active: activating (start) since Sat 2019-03-23 12:49:23 CET; 19ms ago
     Docs: man:systemd-udevd.service(8)
           man:udev(7)
 Main PID: 17256 (systemd-udevd)
    Tasks: 1
   CGroup: /system.slice/systemd-udevd.service
           └─17256 [systemd-udevd]

Mar 23 12:49:23 openhabianpi systemd[1]: Starting udev Kernel Device Manager...
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Main process exited, code=killed, status=31/SYS
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Failed with result 'signal'.
Mar 23 12:49:23 openhabianpi systemd[1]: Failed to start udev Kernel Device Manager.
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Service has no hold-off time, scheduling restart.
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Scheduled restart job, restart counter is at 2.
Mar 23 12:49:23 openhabianpi systemd[1]: Stopped udev Kernel Device Manager.
Mar 23 12:49:23 openhabianpi systemd[1]: Starting udev Kernel Device Manager...
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Main process exited, code=killed, status=31/SYS
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Failed with result 'signal'.
Mar 23 12:49:23 openhabianpi systemd[1]: Failed to start udev Kernel Device Manager.
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Service has no hold-off time, scheduling restart.
Mar 23 12:49:23 openhabianpi systemd[1]: systemd-udevd.service: Scheduled restart job, restart counter is at 3.
Mar 23 12:49:23 openhabianpi systemd[1]: Stopped udev Kernel Device Manager.
Mar 23 12:49:23 openhabianpi systemd[1]: Starting udev Kernel Device Manager...
dpkg: error processing package udev:armhf (--configure):
 installed udev:armhf package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 udev:armhf
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also found a lot of those errors in dmesg:

[65835.838289] “java” (3398) uses deprecated CP15 Barrier instruction at 0xf726c414

Any ideas how to fix this?

Edit: This is the output from systemctl status systemd-udevd.service:

● systemd-udevd.service - udev Kernel Device Manager
   Loaded: loaded (/lib/systemd/system/systemd-udevd.service; static; vendor preset: enabled)
   Active: failed (Result: signal) since Sat 2019-03-23 12:56:42 CET; 1min 5s ago
     Docs: man:systemd-udevd.service(8)
           man:udev(7)
  Process: 17456 ExecStart=/lib/systemd/systemd-udevd (code=killed, signal=SYS)
 Main PID: 17456 (code=killed, signal=SYS)

But if I run sudo /lib/systemd/systemd-udevd I get no errors, very strange.

I did look arround some more about this problem and I guess the problem is that the Ubuntu image comes with the 64 bit version of udev preinstalled (/lib/aarch64-linux-gnu/libudev.so.1) and that the 32 bit version just does not work. But Openhab only runs unter 32 bit Java because of the serial libraries.

Any ideas if this will change in the future and that OH could be running with 64 bit Java?

I think I just found a solution that works! I found this thread that describes the problem in the oshi GitHub project. But installing the udev:armhf package breaks the ubuntu image as we know. So I just replaced this package with libudev1:armhf. After that I created the symlinks as described in the GitHub issue and then the Systeminfo binding did initialize and it seems to work just fine. Here are all commands that I used to get this to work:

sudo apt-get install libudev1:armhf
sudo ln -s /lib/arm-linux-gnueabihf/ /lib/linux-arm
sudo ln -s /lib/linux-arm/libudev.so.1 /lib/linux-arm/libudev.so

Maybe you could implement this into your script?

Edit: I also simply disabled the “uses deprecated CP15 Barrier” messages by adding this line to /etc/sysctl.conf:
abi.cp15_barrier = 2

Script is now updated with requested changes, obviously I don’t have one so can not test it.

If anyone wants to try it, just follow the steps for installing for a Odroid c2 and swap out the necessary lines for the script which is called…
install-openhab-rockpi4.sh

It can be downloaded at this link
http://pcmus.com/openhab/scripts/install-openhab-rockpi4.sh

I’ve just tested the script on a fresh installation and now the Systeminfo binding is working directly after executing the script.

At the moment I’m trying to het the HDMI CEC driver to work because I use this to control my tv. (See this thread)

If this works I will test if ZWave, Zigbee Onewire etc is also working and then I will use this as my main hardware for Openhab and see if everything is stable.

I’ve just noticed that Openhab does not open the files as utf8 as on the Raspberry. I’ve tried adding this to /etc/default/locale

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8

But after a restart Openhab was still having encoding problems with the utf8 files. I’ve added “-Dfile.encoding=UTF-8” to the EXTRA_JAVA_OPTS and that did switch java to utf8. Maybe there is also a better solution for this? But this should also be set by the script in my opinion because it is also the default in Openhabian.

No ideas as I have never had any issues on the Odroid C2. If you work it out just let me know and I can add to the script.

Could you also add curl to the packages? This package is missing by default in the Ubuntu image.

@matt1 I just found this thread. Openhab 2.4 should now should be able to run with 64 bit Java because the serial library was updated. I just did a quick test with the ZigBee binding and this seems to work. Could you please add an option to you script for a 64 bit installation? Also please do not forget to add the curl package and update the Zulu package to the latest version.

Just because it works does not mean it is the recommended or better way. That thread you linked to said the 64bit jvm is 50% slower and the openhab docs still say 32bit recommened to be used.

I wrote the script so you can easily change the java version, give it a try just update the lines at the top of the script.

Thanks for the hint, I didn’t see this comment. I already tried running Openhab in 64 bit mode, but I didn’t notice that the system is any slower yet. Maybe this is a problem that only exists on the Pine64. But I can only say for sure as soon as I the Rock Pi 4 as my main Openhab controller. At the moment I only do some tests with it.

Hi. Sorry for bringing up this old thread, @matt1 , but I’ve just bought a RockPi 4a which I thought I’d move my OH over to and I thought your install script would be a good start. I get a http 404 though. Is it completely gone or do you still have it somewhere?

If your not using a PIx, then you should use Armbian which is covered in the docs here.

Yep, I actually ended up simply installing OH the “normal” way, ie using apt. I was kinda surprised to see that actually everything just worked out of the box. I tried installing OH to an arm64 server a few years back and after days of struggling I gave up and fell back to my 32 bit server…

1 Like

Yes I believe openHAB got accepted as a ‘package/appliance’ around 6 months ago, did not see anyone comment on it here, but it caused a stir over on another jealous home automation forum.

@DanielMalmgren
Since you have a working setup now, you may be interested that I have been updating and splitting the scripts up into smaller files. So if you want frontail installed or the samba shares to be easily setup the same as openhabian, there are separate scripts that can be used on top of a working install (after you backup first of course). They assume it is a clean fresh install and are not smart enough to handle anything other than a clean install so don’t expect the samba script to fix or change a hacked/broken attempt to already install it.

They are found here
www.pcmus.com/openhab/scripts/

The scripts are plain bash commands so you can use them as a guide on what commands to use if you want to do it manually or need to fault find. If you find issues then PM me as it will be a big help next time I go to use them which is why I share :slight_smile:

They are tested under Armbian on a Odroid C2, but I’m making them ready for moving my system onto an Odroid N2+ so they have nothing in them now that are board related.