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 2024-06-13. 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 17 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 8, 11, 17, 21, 22 Download for Linux, Windows and macOS
cd /tmp
wget "https://cdn.azul.com/zulu/bin/zulu17.50.19-ca-jdk17.0.11-linux_aarch64.tar.gz"
su
cd /opt
tar -xzvf /tmp/zulu17.50.19-ca-jdk17.0.11-linux_aarch64.tar.gz
# Cleanup
rm /tmp/zulu17.50.19-ca-jdk17.0.11-linux_aarch64.tar.gz
# This lets OpenSUSE find Java
ln -s /opt/zulu17.50.19-ca-jdk17.0.11-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
Check that the openhab
user is a member of the lock
and dialout
groups.
This used to be done by hand but recent installers take care of this. As root, type:
groups openhab
to check if the groups are correct. It should return something like:
openhab : openhab lock tty audio dialout
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.