Skip to content

Painless installation of OpenHAB on a Raspberry Pi

License

Notifications You must be signed in to change notification settings

xxthunder/MyOpenHAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyOpenHAB

Goal

  • Latest openHAB release running on a Raspberry Pi 4 as a docker container.
  • Automated installation out of this repository.

Parts list

  • Raspberry Pi 4 B, 4x 1,5 GHz, 4 GB RAM, WLAN, BT
  • Raspberry 4596 Pi - official power supply for Raspberry Pi 4 Model B, USB-C, 5.1V, 3A
  • RPI CASE ALU08 (got it from here)
  • JSAUX USB 3.0 SATA Adapter (got it from here, found it on this list)
  • Some Micro SD card
  • Some SATA SSD disk, e.g. 128 GBytes (optional in case of booting from USB)

Initial Commissioning

  • Follow the official description to get Raspberry OS Lite onto the SD card and configure it according to your needs (user account, ssh, WiFi, etc.)
  • Boot the Raspberry Pi and login.

Boot from SSD disk (Optional step)

  • For robustness I choose a SSD SATA disk with an USB 3.0 adapter to boot from. Therefore the following steps are necessary:
    • Start raspi-config:
    sudo raspi-config
    • Inside raspi-config:
      • 8 Update
      • 6 (Advanced Options) → A7(Bootloader Version) → E2(Default)
      • 6 (Advanced Options) → A6(BootOrder) → B2(USB Boot)
    • Shutdown:
    sudo shutdown -h now
    • Remove SD card.
    • Get Raspberry OS Lite onto the SSD (as before with the SD card).
    • Connect SSD and boot.

Ansible and Docker

My goal was to automate any further installation, configuration and updating. Ansible seems to be the right tool for that job.

  • Install Ansible on your control host. I use the Pi itself for this, so I need these packages:
sudo apt update
sudo apt upgrade
sudo apt install ansible git python3-docker build-essential cargo python3-pip
sudo reboot
  • Clone this repo to install openHAB:
git clone --recurse-submodules git@github.com:xxthunder/MyOpenHAB.git
cd MyOpenHAB
  • Adapt the inventory.yml file to your needs (hostname, piuser, etc.). The variable piuser defines the user running openHAB, in my case it is the default user created during disk creation above.
ansible-playbook main.yml"
  • After successful installation openHAB incl. frontail services are running:
    • http://<your_pi_hostname>:8080/
    • http://<your_pi_hostname>:9001/

Sources, References and Ideas

Releases

No releases published

Packages

No packages published