Home Smart Home Install openHAB on Android TV Box

Install openHAB on Android TV Box

1.6k views

openHAB is one in every of the foremost notable and oldest names in Home Automation. OpenHAB was created in 2010 by Kai Kreuzer, developed in Java and based mostly totally on Eclipse’s SmartHome framework.

To install openHAB on android Box TV, you would like to use the acceptable version of Armbian Ubuntu. as a result of running on Java, Java should be put in before putting in openHAB.

Note: the examples in this article are done with the configuration for the mini TX3. You need to change a few places in this guide to suit the device you are using

Prepare

Hardware

Prepare the following:

  • An Android box tv using ARM chips supported by Armbian
  • A USB or microSD memory card with a capacity of 8GB or more
  • A RJ45 cable to connect Android Box to the wifi router

Software

  • SD Memory Card Formatter is used to format the USB or memory card stably to avoid damaging the device.
  • balenaEtcher is used to flash Armbian onto USB or memory card.
  • The latest Armbian Ubuntu bionic is suitable for the chip in use.
  • Advanced IP Scanner to scan IP devices in LAN, find openHAB IP server.
  • PuTTY to access SSH into Android box
  • WinSCP to browse openHAB files via SFTP without having to install add-ons like FTP or Samba share to save system resources

Flash Armbian onto memory card

  • Once you’ve chosen the correct version of Armbian Ubuntu bionic above and downloaded successfully, you extract a file with a .img extension of about 1.3GB.
  • Next format the USB or memory card with SD Memory Card Formatter software to ensure the USB or memory card is in the best condition.
  • Open balenaEtcher, select the extracted .img file above to proceed to flash on USB or memory card.
  • when balenaEtcher reports finished Flash, remove the USB stick or memory card from the USB port and then reinsert the computer to the BOOT partition on the USB flash drive.
  • Access BOOT partition, find the file uEnv.ini, correct dtb_name with the device you are using.
dtb_name=/dtb/meson-gxl-s905w-tx3-mini.dtb
  • In the BOOT partition, look for the extlinux directory, find the extlinux.conf file and correct the dtb in that file to match the device you are using. Remember to remove the “#” before the line
FDT /dtb/meson-gxl-s905w-tx3-mini.dtb

The name dtb_name can be found below

  • Eject USB or memory card from the computer

Install Armbian on the Android box

  • Plug the Android RJ45 cable into the wifi router
  • Insert the USB or memory card into the USB port on the Android box, hold the reset button and power the Android box, after 5 seconds release the reset button to Android Armbian USB boot box or memory card
  • Open Advanced IP Scanner to find the IP of the Android box
  • Use PuTTY to SSH into Armbian using the newly scanned IP above with port 22

Login default account

user: root
password: 1234

When logging in successfully, proceed to change the default password and create an additional account as instructed by Armbian

At this point, you can go straight through the steps of installing Java and openHAB. If not, you can do the lower part to let Armbian boot from eMMC, take advantage of the 16GB NAND drive available in Android box for faster speed, cooler, more stable, without using memory card / usb

Transfer Armbian from the memory card to Android eMMC box

This part may occur risks, resulting in irreparable errors. Therefore you have to think carefully before doing

Back up all available eMMC so that when there’s a problem, come back. Use the “ddbr” command and follow the onscreen instructions to backup

ddbr

When the backup is completed, use WinSCP to make SFTP copy the backup file to your computer and save it

Using the “/root/install.sh” command to run the partition script, copy the OS from the memory card to the NAND. By the time the Complete newspaper is finished

/root/install.sh

Install Java Platform

openHAB runs on Java 8 (openHAB doesn't work on Java 9 and 10, doesn't work on 64bit versions), install Java before installing openHAB

OpenJDK is unstable on ARM devices, so there are only two options: Oracle Java and Zulu. Zulu is a Java SE fully licensed opensource, optimized for devices running ARM chips. Zulu will be the most appropriate and simple option.

To install Zulu Embeded 8, SSH into Armbian with PuTTY and copy the below commands
Copy 1 line at a time. (right click to Paste)

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
sudo apt-get update
sudo apt-get install zulu-embedded-8

install zulu embedded 8 successfully, check it again by command

java -version

Install openHAB

Install the latest Milestone version using the following commands

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
sudo apt-get install apt-transport-https
echo 'deb https://dl.bintray.com/openhab/apt-repo2 testing main' | sudo tee /etc/apt/sources.list.d/openhab2.list
sudo apt-get update && sudo apt-get install openhab2

start openHAB

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab2.service
sudo /bin/systemctl start openhab2.service

Open the web browser and access the address

http://<ip-openhab-server>:8080

Select Standard and wait for openHAB to run some more settings needed to use it

5/5 - (1 vote)

Related Tips And Tricks

Leave a Comment

Tips and Tricks

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept