Tuesday, December 17, 2013

Installing openhab on Android TV-stick

Picture of Convert Android TV stick to home automation server
If you don't need the I/O pins of the raspberry pi, an Android TV stick gives you much more bang for the buck. The device used here is a MK809iii with 1.6 GHz quad core RK3188 CPU, 2GB RAM and 8GB built in storage.

This guide is for the reasonably tech-savvy reader simply because the application, Openhab home automation, is fairly advanced. In other words, you should not be a person to shy away from flashing devices and you should know your way around the Linux command line.

The guide is actually longer than it seems. I refer to other public guides instead of repeating the information.

Step 1: Say goodbye to the green robot

The first order of business in order to use the device as a server is to flash small Linux distribution thus replacing the stock Android. If you think you will ever want to go back to Android, make sure you have a copy of the stock rom.

Disclaimer - Please don't sue me if you brick your device!

Flash PicUntu: http://liliputing.com/2013/10/picuntu-4-5-installer-loads-ubuntu-onto-rockchip-rk3188-devices.html

Before proceeding, make sure you have an active network connection on your new picuntu server.

Step 2: Install Java

I recommend using Oracle JDK even though it is more cumbersome to install than OpenJVM. I tried OpenJVM but it core dumped.
Download Oracle Java JDK (Linux ARM v6/v7 Hard Float ABI) from http://www.oracle.com/technetwork/java/javase/downloads and place it in /home/picuntu
Unpack JDK:
picuntu@g8picuntu:/usr/local$ sudo mkdir java
picuntu@g8picuntu:/usr/local$ cd java
picuntu@g8picuntu:/usr/local/java$ sudo tar xvfz /home/picuntu/jdk-7u45-linux-arm-vfp-hflt.gz

Follow this guide from step 8: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

Step 3: Install home automation software (Openhab)

For full instructions, please refer to http://www.openhab.org/. The below steps will get you openhab and the demo project.

Download latest openhab files from: https://code.google.com/p/openhab/downloads/list as in example below. Make sure you wget the latest files.
picuntu@g8picuntu:~$ cd
picuntu@g8picuntu:~$ wget https://openhab.googlecode.com/files/openhab-runtime-1.3.1.zip
picuntu@g8picuntu:~$ wget https://openhab.googlecode.com/files/openhab-addons-1.3.1.zip
picuntu@g8picuntu:~$ wget https://openhab.googlecode.com/files/openhab-demo-configuration-1.3.1.zip
picuntu@g8picuntu:~$ sudo mkdir /opt/openhab
picuntu@g8picuntu:~$ cd /opt/openhab/
picuntu@g8picuntu:/opt/openhab$ sudo unzip /home/picuntu/openhab-runtime-1.3.1.zip
picuntu@g8picuntu:/opt/openhab$ sudo unzip /home/picuntu/openhab-addons-1.3.1.zip -d addons
picuntu@g8picuntu:/opt/openhab$ sudo unzip /home/picuntu/openhab-demo-configuration-1.3.1.zip
picuntu@g8picuntu:/opt/openhab$ sudo cp openhab_default.cfg openhab.cfg
picuntu@g8picuntu:/opt/openhab$ sudo ./start.sh

Step 4: Done!

You should now have a working demo installation at http://g8picuntu:8080/openhab.app?sitemap=demo

Please go to the openhab wiki for further information, e. g. how to make openhab start on boot and how to get started on setting up your own home automation system on tiny hardware.

Get started and add rules, layouts, items and bindings for all your favorite intranet of things!

1 comment:

  1. Hi Martin,
    What do you think, would it be possible to make the openHAB server running on a Minix X8-H under Android KitKat? It would be great to have this device as the openHAB server at your home.

    ReplyDelete