A couple of easy steps on how to set up a Raspberry Pi with ioBroker to use it as a home automation server.

Setting up the headless Raspberry Pi

  1. Get the OS Download Raspberry Pi OS from here. I chose the Raspberry Pi OS (64-Bit) lite version.
  2. Downloasd Flashing Tool Use a flashing tool to write the Raspberry Pi OS image to a SD card. The balneaEtcher is nice. But Raspberry’s own flasher, the Raspberry Pi Imager allows you to set a couple of options like setting a hostname, enabling SSH, configuring WIFI, and a couple of more options. I, thus, highly recommend to use the Pi Imager. If you, for some strange reason, prefer to do all this “by hand” (like I did) then just follow along the next steps.
  3. Flash When flashing is done, re-insert the SD card to mount it. Then open your favorite file browser and go to the root directory of your SD card (boot).
  4. Enable SSH Put an empty file called ssh (yes, without suffix) into this directory. This is necessary to enable ssh so you will be able to connect to the Pi from another computer.
  5. Configure WIFI Put a file called wpa_supplicant.conf with the following contents in the same directory. You will have to change the country code for your country. For Germany it’s DE. For other countries: ask Google. Enter the name of your WIFI and your password. Save the file.
    country=DE
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
           ssid="name-of-wifi"
           psk="wlan-password"
           key_mgmt=WPA-PSK
    }
    
  6. Username and Password As of April 2022 there is no standard user and password anymore in the Raspberry Pi OS image. The standard username used to be “pi” and the standard password “raspberry”. To create a username and password for the headless installation you can either write a file with the credentials in the root directory or you can use the Raspberry Pi Imager. Since you came here as a real command line nerd we will, of course, create that file. It has to be named either userconf or userconf.txt and contains just this one line:
    username:password

    Please consult your favorite search engine on how to create an according password. A pretty easy way is to use the following line “as is”…

    pi:$6$6jHfJHU59JxxUfOS$k9natRNnu0AaeS/S9/IeVgSkwkYAjwJfGuYfnwsUoBxlNocOn.5yIdLRdSeHRiw8EWbbfwNSgx9/vUhu0NqF50

    …which sets the username to “pi” and the password to “raspberry”. As soon as you are able to log into the Pi you will be able to change the password to a more secure one using the passwd command.

Optional steps.

  1. Static IP Out-of-the-box, your Pi will receive a dynamic IP address via DHCP. I prefer to have a static IP address. Boot the Pi and log in. Since this is a headless install, you have to log in from another computer. Use the following command to edit the dhcpcd.conf file:
    sudo nano /etc/dhcpcd.conf
    Go to the section that looks similar to the following lines…

    interface wlan0
    static ip_address=<your_desired_ip_address>
    static routers=<ip_address_from_your_router>
    static domain_name_servers=8.8.4.4 8.8.8.8
    

    …and enter your desired IP address, your router’s IP address, and, optionally, your preferred domain name server(s). The ones above are the Google DNSs. Save your changes, then reboot the Pi using sudo reboot.

  2. Full upgrade It is usually a good idea to do a full upgrade of all applications after a fresh install by issuing the following command on your terminal.
    sudo apt update && sudo apt full-upgrade -y
    

    This process can take quite some time depending on the number of packages that need to be updated.

Installing ioBroker

Installing ioBroker is fairly easy: log in to your Pi and enter the following command on the command line. Brew some coffee. Patience required.

curl -sLf https://iobroker.net/install.sh | bash -

After the installation finished successfully you should see a message like this

ioBroker was installed successfully
Open http://<ip-address>:8081 in a browser and start configuring!

Open your favorite Web Browser and enter the above URL replacing <ip-address> with the IP address of your Pi. If your Pi uses a dynamic IP address you can find it out, e.g., with your router’s network list (list of devices that are connected to your router). If you have assigned a static IP to your Pi, as in the first optional step above, then use this one. Don’t forget to attach the port number “:8081”.

You should be greeted with ioBroker’s installation wizard welcome screen.

Enjoy!

backitup adaptor: Can’t access a NAS using CIFS (Samba)?

If you want to use the backitup adaptor to back up your iobroker installation on a network attached storage (NAS) via Samba (SMB) you may see an error message indicating that CIFS is not supported. In this case you need to install SMB support using.

sudo apt-get install smbclient

Do a

sudo reboot now

after installation and you should be good to go.

Leave a Reply

Your email address will not be published. Required fields are marked *