Preparing Orange Pi Zero 2 for OpenHAB and Ubuntu Installation

Andy Haluza

JS developer, tech geek
1
2
  • #home-lab
  • #home-automations
  • #IoT
  • #micro-pc
5m read

Theory. 

Let's start preparing for installations of the operating system and of course OpenHAB. Firstly we need to define which OS would be compatible with our hardware, as you remember from my previous post I'm building a system based on Orange Pi Zero 2. Before going down on the installation process, I need to clarify some requirements, which should be complied with. First of all, it’s the power supply (in my case with Orange Pi Zero 2) that needs to be used with low voltage 5V 3A, otherwise, it can harm the microcircuit (it would burn).

The second one, need to use a micro SD card with 10+ class, because needed to provide a fast read\write possibility for the OS and also the minimal capacity: I’m using 32Gb, the minimum is 8Gb, and recommended is 16Gb.

So finally let's define which OS would be compatible with it, running ahead I will tell you that I’m using Ubuntu. Here is a link with pre-built OSs for Orange Pi, there is also placed documentation for each version of the micro PC and some basic office utilities. Officially supported images for Orange Pi Zero 2 are: Android Source Code, Android Image, Linux Source code, Ubuntu Image, Debian Image, and OpenWrt. I’m using Ubuntu without a visual interface for servers (Orangepizero2_2.1.6_ubuntu_bionic_server_linux4.9.170), cause I’m familiar with this OS and it will perfectly fit for implementation of Smart Home with any customization.  

For the first time I tried to install OS through basic Linux ISO burn utility, but it doesn't work properly, micro PC wouldn't run and not shows signs of life except for LAN indicators, which are starting to shine with green and orange LEDs after plugging a cable to rj45 port. 

After some research, I’ve discovered that usually for installing OS on Raspberry Pi used Etcher and it would work for Orange Pi, but with one exception - at the end of the writing process on your micro-sd card you would see an error after the validation step, we'll ignore her and we go further, as it wouldn't affect on usage for us. I also tried to write down for luck the OpenHAB distribution images from the official download resource (https://www.openhab.org/download/) for Raspberry Pi and Linux, but the attempt failed. Let’s move to the next practice block with the installation of OpenHAB.

Hardware.

 Now let’s briefly go through all things, which we’ll use in this topic:

  1. Orange Pi Zero 2
  2. Power supply 5v 3A type-c. I’m using a power supply from an old smartphone with a type-c cable
  3. Micro SD card class 10+ and capacity 8+Gb
  4. (Optionally) Plastic case for board
  5. (Optionally) Alluminium heat sink. I’ve used 2pc. on core chip and RAM
  6. (Optionally) Micro HDMI - for connecting display monitor, instead of connecting to Pi via a network (ssh)

Practice.

  1. Download the image for installed OS Orangepizero2_2.1.6_ubuntu_bionic_server_linux4.9.170
  2. Download and install Etcher for burning OS into a micro SD card.
  3. Burn OS image into Micro SD using Etcher, simple 2 steps with GUI (Graphical user interface) - select path of image and drive
  4. Plug Micro SD, LAN cable, and power supply in the same sequence. (Take sure that LAN cable led light are shine in connected mode)

After the previous step, Pi would start launching and the red led light would flash for a while and after it would finally launch red led would be replaced by green, which indicates the system is working. As I’m using a server version of OS - there is no GUI as a disadvantage, but otherwise gives more resources available for Smart Home system needs, and not taking resources for rendering and processing GUI.

For connection via SSH to Pi, you need to define his IP. The easiest way is to go to your router Panel (usually it’s http://192.168.0.1) and check the DHCP clients list. Afterward, we’re able to connect to the Pi server via SSH. The credentials for the default user are Orangepi for username and password. I’m using Linux based system so I’m able natively to connect to ssh with the command in the terminal:

!$0$!

In case you’re not able to connect via the command line use PuTTY, it’s a free software with GUI, where you’re able to connect to other PC with SSH, with just simply ppassingass credentials and IP with port (default SSH port is 22)

Now we’re able to set up wifi settings. I’ll use screenshots from official documentation to show up the whole process.

Run Network Manager UI

!$1$!

You would seen UI of Network Manager, afterwards go to “Activate a connection” menu using arrows and `Enter` as an action button:

Pass a password

Done, wifi is connected, you’ll see asterisk (*) in the start of the line

After successfully passing all these steps we’re able to connect to Pi with wifi (2.4/5Hz) and the LAN cable can be unplugged.

Installing OpenHAB

Now we’re able to install OpenHAB. Just follow all steps from official documentation of OpenHAB - there would be definitive instructions for each OS.

I’m for Linux (APT) so I’ve used such flow:

!$2$!

After all of these steps, you're finally able to open OpenHAB. It will be hosted locally on your OrangePi IP on the 8080 port by default. As it’s for no, for now,w runs only locally you need to be on the same network with the device you tried to connect to. 

Try to open it n the browser:

http://192.168.0.XXX:8080/

After first opening,ing you start the initializing process with a few setup steps. It’s just setting up admin credentials, geo-location (optional, but you can use some automation with it), and installing add-ons (optional).

For now, that’s all, keep in touch with the next posts.

 

Watch on Youtube now!

Written by:

Andy Haluza

Author bio: JS developer, tech geek

Comments (2)

loading...
  • ЯД
    Ян Дацюк

    Hi! Interesting article!

    I didn't get how exactly you've installed the OS. Did you follow the instructions?: http://www.orangepi.org/Docs/SDcardinstallation.html

  • Andy Haluza

    Ян, hi and thank you, so much! Yes, first time I've tried via linux `dd` command it successfully burn image, but as a result Orange Pi wasn't launched after plug in micro SD card. So for me work solution was use Etcher, as described in 1st paragraph in Practice chapter