Introduction
Here’s a quick guide to getting OH3 up and running on a Raspberry Pi 4 with OpenSUSE Leap 15.3.
If you are not using a Raspberry Pi or another ARM-based device, in theory most of these instructions should still be applicable, except for the installation Java SDK method – x86_64 platforms have RPMs available so you would add the relevant repository (e.g., by first installing the
zulu-repo
package) and then usezypper install
to download the SDK. I have not tried this.
This is based on my installation notes and may be missing a step or two but should get you most of the way there. This is current as of 2023-04-26. Mind the natural evolution of all the relevant bits.
Install OpenSUSE
Clear and concise instructions are given on the OpenSUSE site itself.
The only thing to keep in mind is that the links given in that page may lead to a 404 in between rebuilds as the new versions propagate through the mirrors – in that case, do follow the advice to ‘please check the general download directory for the images.’
As a general comment, getting OpenSUSE up and running on the Pi is super easy. Just burn the image into an SD card, pop it into the Pi and off you go.
Gather the bits
You will need the Java 11 version recommended by OpenHAB, plus the OpenHAB binaries themselves. There is also a minor bit of faffing with permissions and some easy configuration changes to do.
Install Azul Zulu Java JDK
Unless otherwise implied by the presence of an
su
command, all the instructions below assume the root user.
Get the latest *.tar.gz for ARM-64 from here: Java Download | Java 7, Java 8, Java 11, Java 13, Java 15, Java 17, Java 19 - Linux, Windows and macOS
cd /tmp
wget "https://cdn.azul.com/zulu-embedded/bin/zulu11.64.19-ca-jdk11.0.19-linux_aarch64.tar.gz"
su
cd /opt
tar -xzvf /tmp/zulu11.64.19-ca-jdk11.0.19-linux_aarch64.tar.gz
# Cleanup
rm /tmp/zulu11.64.19-ca-jdk11.0.19-linux_aarch64.tar.gz
# This lets OpenSUSE find Java
ln -s /opt/zulu11.64.19-ca-jdk11.0.19-linux_aarch64 /usr/java
Add the OpenHAB repository
There are ways and ways to do this, but:
cat <<EOF >openhab.repo
[openHAB-Stable]
name=openHAB Stable
baseurl=https://openhab.jfrog.io/artifactory/openhab-linuxpkg-rpm/stable
gpgcheck=1
gpgkey=https://openhab.jfrog.io/artifactory/api/gpg/key/public
enabled=1
autorefresh=1
EOF
zypper ar ./openhab.repo
zypper refresh
# Cleanup
rm ./openhab.repo
Install packages
Calling directly for openhab-addons
will drag openhab
itself as a dependency.
zypper install openhab-addons
Just to be sure: fontconfig
If you will be displaying charts in your sitemaps, better make sure that the fontconfig
package is installed. Chances are it will be if you have gone for a full graphical installation and chances are it will be not if you have chosen a server (aka JEOS – Just Enough Operating System – install). In any case and just to be sure:
zypper install fontconfig
Optional: ffmpeg
Consider also installing ffmpeg
if you will be adding an IP camera.
If you want to use the full set of codecs, including possibly patent-encumbered ones, see the OpenSUSE site for the latest instructions to adding the Packman repos. If you’re happy with fully open codecs, proceed straight on.
zypper install ffmpeg
Tidy things up
Add the user openhab
to the lock
group
If you will be using RFXCOM or anything else serial-looking, the openhab
user should be a member of dialout
– the installer should have taken care of this – but also a member of lock
so that it can write to /run/lock
.
The command line for that is:
usermod -a -G lock openhab
Note: I actually use Yast2 for almost all configuration and admin. This is in my opinion what sets OpenSUSE apart from anything else out there, so might as well take advantage of it.
This will be under
Security and Users
→User and Group Management
,Set Filter
toSystem Users
, selectopenhab
,Edit
→Details
→Additional Groups
.Yes, it is a lot of clicking, but probably quicker than reading the
man
page forusermod
, the corresponding command-line instruction, for an operation I have to do once every couple of years.
Tell OpenHAB where to find Java
There might be a better way to do this, for instance by making Java available at a location other than /usr/java
, but what I’ve done is edit /etc/default/openhab
and somewhere in there I added:
JAVA_HOME=/usr/java
If you will be using serial-based Things, you might have come across instructions on the Internet that advise to also edit EXTRA_JAVA_OPTS
in that file. In fact, that should not be necessary as OpenHAB will look for common patterns automatically.
Enable and start the service
/bin/systemctl daemon-reload
/bin/systemctl enable openhab.service
/bin/systemctl start openhab.service
Connect to your newest OpenHAB installation
If all went well, now you should be able to connect to your OpenHAB via HTTP on port 8080 and follow the rest of the instructions in the tutorial.
Acknowledgements
With many thanks to:
- @rlkoshak for pointing out that specifically Java 11 is required, and not a later version.
- @Kai for administrative help.
-
@Benjy for feedback and the advice not to populate
EXTRA_JAVA_OPTS
. - @rpwong for pointing out that the instructions could be generalised to non-ARM platforms.