Does Openhab run on Rock Pi 4?

(David Masshardt) #1

Does anyone have experience running Openhan on Rock Pi 4? (http://rockpi.org) My Raspberry Pi 3 is getting to it’s limits regarding ram, so I’m looking for alternatives.

0 Likes

Running Openhabian on Pine H64 Modell B
(Skinah) #2

If you can find a working linux image and install Java on it then I don’t see why it would not work, it is just a matter of how hard you will find this to be. I am an Odroid fan because they release working linux images, give support to users and opensource projects and have a great community.

I use the Odroid C2 which has 2gb ram and it works great and is very easy to get linux and openhab running on it with my script as openhabian does/did not work with getting ARM64 Java running , see here for script…

If you have some linux skills or willing to learn then consider this faster 4gb ram Odroid N2. Bench marks to compare the these two options to a raspberry Pi are in this thread.
https://forum.odroid.com/viewtopic.php?f=176&t=33781

BEWARE any arm board that uses big.little processors needs special attention (The C2 and H2 do not use big.little), see this thread…

Lastly there is a new X86 based board that can run at 4 watts IDLE power draw and has 2 SATA, usb3 and M2 NVME support. You can upgrade the ram up to 32gb but it is not included in the price. Since this is x86 and not arm based it will work great. Due to the 2 sata ports you can set it up as a NAS and use docker images to run Openhab in.

https://www.phoronix.com/scan.php?page=news_item&px=Intel-ODROID-H2-Benchmarks

0 Likes

(Skinah) #3

I had a quick look and I see two issues which should be able to be overcome, see my previous reply for details and links…

  1. It is ARM64
  2. It uses big.little processors. “Dual Cortex-A72, freqency 1.8Ghz with quad Cortex-A53, frequency 1.4Ghz”
0 Likes

(.) #4

I’m also interested in this. Bought this board and did some testing. It’s fantastic and performance is outstanding. Linux is available for this board: https://wiki.radxa.com/Rockpi4/downloads

Want to port openhabian on it and hope to provide you soon an image.

0 Likes

(David Masshardt) #5

Which OS will you prefer? Ubuntu server or Debian Desktop? (I guess on Debian Desktop the desktop could just be deactivated to get a “server” version.)

0 Likes

(David Masshardt) #6

I just tried your script on the Rock Pi 4. In the Ubuntu image was some problem with the udev:armhf service. After the script the system did not boot anymore.

In the Debian image it worked better. Openhab is starting and I can also boot the system without problem. I think there are still some problems with the script, but the basics are running now. I need to test some more to see if everything is working.

0 Likes

(Skinah) #7

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…

0 Likes

(Skinah) #8

@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.

0 Likes

(David Masshardt) #9

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?

0 Likes

(Skinah) #10
0 Likes

(David Masshardt) #11

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.

0 Likes

(David Masshardt) #12

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?

0 Likes

(David Masshardt) #13

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

0 Likes

(Skinah) #14

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

0 Likes

(David Masshardt) #15

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.

0 Likes

(David Masshardt) #16

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.

0 Likes

(Skinah) #17

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.

0 Likes

(David Masshardt) #18

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

0 Likes

(David Masshardt) #19

@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.

0 Likes

(Skinah) #20

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.

0 Likes