OpenHAB on odroid n2+ install

I want start with openHAB on my odroid n2+.
How to install correctly on this HW ?
Thank you

Welcome to the community. The documentation is the best place to start to understand openHAB concepts, and covers Linux installation. Note the Java requirements, as that can trip people up when they’re getting started.

It is very simple with that hardware, you can install openHAB by using the Armbian built in scripts, but this does not install frontail, samba and the other stuff that is handy to have to the same that openhabian uses to make support easier.

Your welcome to use the scripts I used to setup mine which will install this extra stuff
 The only change I have made is to switch to a 64bit java and have not yet gotten around to updating the script with this 1 change, which can be done after the script finishes and the openhabian scripts can be used to update the java with very easily. This script will install the openhabian script if you want it to


Guide: How to Install openHAB 3 under Armbian - Development - openHAB Community

1 Like

Thank you for your reply. At this moment I have empty eMMC without operating system. So first of all I must install any operation system distribution and then openHab. Make sense which one operating system I will install ? Is any better for odroid n2+ ?

For pure simplicity, I like the www.DietPi.com OS.

It’s built from Debian with a great menu system for installing software

dietpi-software

All the instructions are on the website.


However, are you sure the eMMC is empty?

Odroid normally ship the cards with a vanilla OS.
Normally Ubuntu or Android.
Which one did you order?

yes, it was delivered with OS (Ubuntu MATE), but I did a error and complete eMMC was deleted.

I was in contact with seller and he will send me a image of the ubuntu mate. So I will search for step by step guide how to install on that system or is there any image with complete system with openhab ?

Ubuntu Mate is an overkill for running openHAB etc.

I’m not sure why your reseller is going to send you a copy, all the info and download links are on the Odroid wiki page

https://wiki.odroid.com/odroid-n2/odroid-n2

(Read it all before you do anything, don’t rush)

Unless you intend to use the desktop environment, I would recommend a “headless” system.

This just uses a command line environment, which is fairly easy to get your head around as most of the time you’ll be accessing the machine from a a bigger computer anyway.
WinSCP / FileZilla etc.

(You might want to add a Samba server to DietPi and setup folder shares, if you want to access the N2 like a network connected device, easy to do, but please search for instructions, there are plenty.

)

I would recommend you download an OS image and flash it onto the eMMC.

Check out www.DietPi.com , it’s very easy to deploy.

There are plenty of others to choose from, I just find DietPi to be really straightforward.

(I assume you have the eMMC to SD or USB adapter?)

Follow these instructions if you’re unsure how to “flash an image to an eMMC”

Once you’ve flashed the OS image to the eMMC, put the eMMC into the N2.
Connect a keyboard and monitor, add an ethernet cable and power it up.

On first boot, the OS will unpack itself and expand to use all of the eMMC card.

Login is

root

Password is dietpi

It will prompt you to change the password, my advice would be not to until you’re really comfortable with what you’re doing, as there is no way to get access if you forget the new password.
(Do change it when you’re happy)

Run these commands

dietpi-update

Follow the on screen instructions.

dietpi-software

Look for “search software” and look for Java

Add a star (press Space bar) to Java

Go back to the main menu and choose “install”

When that’s finished, choose “exit”

Back at the command prompt, follow the instructions from this webpage to install openHAB (stable) for a DEB / Debian
“Apt based system”.

Which basically is a few lines

You’ll have to type these in, unless you suddenly decide that you’re happier to use something like puTTY or a MAC / Windows / Linux command line on your main computer and can then use cut & paste. (Paste in a terminal is either a right click / shift & insert / from the window menu)

curl -fsSL "https://openhab.jfrog.io/artifactory/api/gpg/key/public" | gpg --dearmor > openhab.gpg
sudo mkdir /usr/share/keyrings
sudo mv openhab.gpg /usr/share/keyrings
sudo chmod u=rw,g=r,o=r /usr/share/keyrings/openhab.gpg

Once you have added the above, you’re ready to install openHAB

This line will tell the computer that you want to use the stable version

echo 'deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' | sudo tee /etc/apt/sources.list.d/openhab.list

Now you need to tell the computer / N2 to update it’s list of available software.

apt update

Then you have the last command to install openHAB

apt install openhab -y

When it’s all finished, you just need to start openHAB.

This following line will not only start openHAB, but will start it every time the N2 boots

systemctl enable openhab --now

About 5 minutes later, you can swap to your bigger computer and access openHAB via a web browser

If you’re unsure of the IP address of the N2, just look at the header on screen of the N2 when you boot it.

If you need more information, just read the installation instructions carefully or search this forum.

Good luck

3 Likes

WOW, WOW, WOW
Thank you a lot for this excelent guide. Simple to understand.
Thank you once more

2 Likes

I have one additional question. For communication with one device I want use one USB/RS485 dongle on the port /dev/ttyUSB0. Via this port I want send a HEX instructions and receive HEX answers for next processing. Is it necessary give some special admin rights for this port or when I will plug this dongle, all will work ?

Second device which I want use is eBus device. Here I also expect that I will use “any” eBus adapter into USB port. Hope also not any special configuration is necessary.

May I suggest you get openHAB up and running first.

Then start a new topic to address the TTY / RS485 / RS422 / RS232 question.

(I’m curious how you will switch a RS485 from Transmit to Listen and back again
)

OK, I will do. RS485 isn’t problem. When I will send instruction to /dev/ttyUSB0, external device will send a answer. It’s working like serial communication.

Correct, you can choose any OS you wish to use. I prefer Armbian because one of the devs of Armbian is an openHAB user and the installation of openHAB is built into every image, plus it has all the packages I like/used to, already installed ready to go. All you need to do is type in sudo armbian-config and then goto SOFTWARE>SOFTY>and choose openHAB. Very simple.

Armbian | openHAB

You can also try using the openhabian install script to install openHAB on top of any OS image you prefer to use, however they do zero testing on anything that is not a PI so expect issues especially if you start using a highly stripped down OS like the dietPI. An install script may assume you have X package installed which you may not have and that will cause it to fail.

  1. DietPI or Armbian then use my install script
  2. Armbian Image and then sudo armbian-config
  3. Armbian with openHABian installed on top
  4. MDAR’s method with dietPI

One of them will get you going, but option 2 is by far the most easy way and supports a ton of hardware that is not PI based.

I recommend you ask this in a new thread. You have marked this thread as odroid n2+ so only people interested in this more obscure hardware device will click and read. But first please do a search on the forum to look for a thread that already exists.

It is easier to just call this a COM/serial port you will find more people will already know the answer and help as that is what the rs485 shows up in linux/openHAB as, I have done it a long time ago and there are some posts already on the forum with some info.

2 Likes

so I tried do it as you wrote.
after image flash was system started and dietpi update a dietpi software was done automaticaly.
there was some question regarding data share (i canceled) and uart if i want switch off (i added no). Then I istalled java jdk (there was also othe java). After install I placed requested instruction and on the end also systemctl enble openhab --now.
But sw did not started. Also on the ip adress is error, page doesn’t exist :frowning:
After odroid restart I can see a dietpi login page

ok, there must be a port 8080. Now I can see a login page :slight_smile:

1 Like

:confetti_ball:
Congratulations

Not only have you managed to install everything

You’ve also done your own fault finding.

Let’s hope your openHAB journey continues in this style.

I will do my best, but as a first I want test serial communication with heating unit. At the moment I’m little bit lost, :-(. I created a serial binding, but now I’m searching how to send a command, how to receive a answer and how to processing received data. But hard to find a simple video guide for openhab3.

openHAB has recently changed from V2 to V3 and video guides are pretty rare as people tend to hold off until any new UI stops changing as much before investing in doing a video. We tend to rely on making sure our official documentation is correct and then use the forum as a backup to the docs.

  1. check the docs
  2. search the forum
  3. create a new thread in the forum asking, showing you have done the 2 things above first and what you have already tried.

Also you are trying to swim in the deep end of the pool. Try to do a simple light switch first and follow the main new user guide to getting started in openHAB, then trying doing the advanced stuff of sending a hex code and parsing a reply in a rule.

Search results for ‘send hex serial binding’ - openHAB Community

1 Like

I know that’s not easy fior the start, but this device Will send me information about temperatur in each room and also temperature can be regulated via this device.
Next what I have Is PV Victron with ve.dirrect/modbus.
This two devices are main point And important for implementation.