Because of its low price, its small form factor and the low energy consumption, the Raspberry Pi is a quite popular platform for openHAB. It is favored amongst existing users and a recommended choice for newcomers.
If you want to learn more about the possibilities of the Raspberry Pi and Linux in general, many tutorials can be found on the internet. These including the official raspberrypi.org help articles or the in-detail articles at eLinux.org.
Recommendations for a “headless” hardware setup:
- Raspberry Pi 2 or newer, compare your existing device here if you are unsure.
- SD card (16GB or more to support wear-leveling)
- Steady power supply
- Ethernet connection
- No connected display or keyboard needed
We are proud to provide a preconfigured image for the Raspberry Pi, with the latest build of openHAB 2 and many useful software components (like Samba, Grafana or Mosquitto) as optional setup steps. The image provided by the openHABian projects is based on Raspbian and under constant improvement.
Check out more details about openHABian, the hassle-free openHAB setup.
If you want or need to set up openHAB on a Raspberry Pi by yourself, please follow these recommendations. For the beginning, we recommend to download and install the latest Raspbian SD card image. You may choose the “Lite” version.
Attention: As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. For headless setup, SSH can be enabled by placing a file named “ssh”, without any extension, onto the boot partition of the SD card.
Connecting: Get your SD card and network cable plugged in and power up. Booting up takes up to 10 minutes. To connect with an SSH client (like Putty), you need to know the IP address or hostname of your device. A standard Raspbian setup should be reachable either by the hostname “raspberrypi” or though the local domain name “raspberrypi.local”. If you are not able to connect, check your routers web frontend for newly connected devices.
Connected via SSH, execute the Raspbian configuration menu by running
Go through the following steps:
- Expand the file system
- Change your password
- (Change the host name if you wish, e.g. “openhabpi”)
- From the advanced menu, change the memory split for the GPU to “16”
As a good practice, run a full upgrade and install packages you like or need (a set of helpful packages is given as an example):
sudo apt-get update sudo apt-get upgrade sudo apt-get install screen mc vim git htop
Note on Java: Raspbian in the latest full version already includes Oracle Java 8. However, at the time of this writing, the installed revision is lower than the recommended. Raspbian Lite comes without Java to begin with.
Please refer to the Linux article for instructions on how to install the latest Java 8 revision.
Installation: Finally install openHAB on your Raspberry Pi, just as it is described in the openHAB 2 on Linux article: