How To Install OpenRemote Controller on Raspberry Pi

This document explains the steps to install OpenRemote Controller on Raspberry Pi. These instructions are mainly contributed by the OpenRemote user community. We wish to thank everyone who has given their input and feedback. Special mentions for valuable contributions goes to: Jani Kahrama, Nejc Šmid, Sebastian Niepel, Igorius, Bob and Kal Ross.

For additional questions, please use the OpenRemote User Forums or the comments section of this page. If you're interested in making similar contributions to the documentation wiki, please contact us.

1. Install Raspbian Wheezy

You can download Raspbian Wheezy image (or Debian 'soft-float' Wheezy in case you plan to use Oracle Embedded SE for ARM Java virtual machine, see notes below) from http://www.raspberrypi.org/downloads. Follow instructions on that website on how to install image onto SD card.

Soft-float vs. Hard-float

There are two different Debian images floating around (pun intended). One is so called 'soft-float' and the other one is 'hard-float'. There's a difference in how floating point arithmetic is handled between the two: the soft float means floating point arithmetic is handled with software emulation where as 'hard-float' indicates floating point operations can be handled in hardware by the FPU on the chip. The latter usually gives nice performance advantages where floating point operations are required.

Whether a soft-float or hard-float is used is an option in the compiler. This means the binaries used for either platform must be compiled targeting either software emulated or hardware handled floating point operations.

Why is all this relevant?

If you are installing OpenRemote with "Oracle Embedded SE 6 for ARM" (currently recommended for best performance) on Raspberry Pi, please download the the "soft-float" Debian Wheezy image from the Raspberry Pi website. As noted on the download page, the soft-float version is currently required by "Oracle Embedded SE 6" Java virtual machine to work correctly. It does not work with, or does it take advantage of the hardware based 'hard-float' ABI on ARM.

However, some user do report (Thanks Bob and Jani Kahrama) success with latest "Java SE 8 for ARM Early Access" which as the name suggests is compiled for ARM architectures. The "Java SE 8 Early Access for ARM" does work with hardware FPU on ARM so hard-float Rasbian Wheezy distribution is suitable. To make things a little more confusing for you, the Java JDK 8 is the regular Java Standard Edition distribution that is also used on PC desktops, servers, data-centers, etc. This is a different distribution package from the "Oracle Java SE Embedded" targeting devices.

Do note that the "Java SE 8 for ARM Early Access" is not released for production use yet, so your mileage may vary.

For both Oracle Java versions (SE 6 Embedded or full Java SE 8 for ARM) you will need to agree to Oracle's license and terms to download these packages. If you elect to install the open IcedTea6 package instead, you can do so with following command:

$ sudo apt-get install icedtea-6-jre-cacao

3. Check Java installation

Confirm your Java installation was successful by checking the Java VM version and build:

5. Download OpenRemote Controller

6. Install Native Libraries for ARM

While OpenRemote is written in Java to be portable across different operating systems and CPU architectures, there are a few places where we need to reach to the native layers to access serial or USB ports, etc. These steps are only necessary if you plan on using protocols that require serial port access, such as Z-Wave.

By default, these native libraries are compiled for x86 CPU architecture. You will need to update them to ARM binaries when running on Raspberry Pi.

Serial port access from OpenRemote Controller is done with RXTX library. To download and install ARM based binary of RXTX, execute the following commands:

7. Run OpenRemote Controller

Next steps are to start the OpenRemote Controller and verify that it is running correctly. From the terminal, execute the following commands:

$ cd ~/Desktop/OpenRemote-Controller-2.0.2/bin

Make sure the file openremote.sh is executable, if not already:

$ sudo chmod +x openremote.sh

Run the controller:

$ ./openremote.sh run

8. Check Installation

To make sure your controller started up properly, open browser and log onto http://localhost:8080/controller. You should see the default controller management page which allows you to download/synchronize your designs from the OpenRemote Online Designer.

9. Start OpenRemote Automatically at Startup

For quick and easy set up, you can start OpenRemote Controller every time your Raspberry Pi boots up by modifying /etc/rc.local file:

Complete Service Script Example

For a more complete service setup of OpenRemote Controller with proper start/stop/restart functionality, create a script file as shown below (contributed by Kal Ross) and place it in /etc/init.d directory. You can name the script as you wish, just use the script name consistently in the steps that follow. Note: you should modify the first command shown below with the proper path to your OpenRemote Controller installation:

10. Additional Tuning

You might want to give your Raspberry Pi a static IP address. This way you ensure that the IP address configured in your OpenRemote panels (iOS, Android) remain valid and you don't need to reconfigure them if the network IP address of your Raspberry Pi changes.

Do note that the OpenRemote Controller startup still takes quite some time on Raspberry Pi. When you restart the RPi, there can be a delay of several minutes before your iPhone will detect the OpenRemote controller.

Thanks for the feedback everyone. Have updated the document by downgrading it to...

Thanks for the feedback everyone. Have updated the document by downgrading it to Java6 which is what we currently use for testing, included a note about proprietary Oracle VM with JIT for extra performance and updated the startup script to include cd'ing to bin directory before starting the controller to avoid issues with paths.

I'd like to suggest updating the page to include mention of the Java SE 8 (with ...

I'd like to suggest updating the page to include mention of the Java SE 8 (with JavaFX) Developer Preview for ARM, just as Bob, I've been running it for months without issues, scheduling macros included.

I have been using Java SE 8 (with JavaFX) Developer Preview for ARM for the past...

I have been using Java SE 8 (with JavaFX) Developer Preview for ARM for the past couple of weeks without issue (Mea Culpa: I'm not actually knowledgeable enough to know how an issue would present itself though). As I understand it, JDK 8 supports hard float and JIT processing. When I intially installed OpenRemote on my RPi I used Iced Tea and then later switched to JDK 8. My impression was that OpenRemote ran more smoothly and started up quicker.

Hi - I'd like to add something that may be useful to others when trying to insta...

Hi - I'd like to add something that may be useful to others when trying to install any of the Oracle versions of Java. When I followed the instructions at the links provided above on the Oracle site, I found I had to perform a few additional steps. These are mainly required if you intend to use the start up service script.

On a fresh install of Debian wheezy for the PI, the instructions given leave you at a point where Java 6 is installed in directory called /home/pi/java . This is fine when you intend to run any Java jars by providing the full path to the JVM
(example /home/pi/java/ejre1.6.0_38/bin/java -jar testjavaprogram.jar)
However, init scripts run as root on boot up, and seems to expect the JVM executable to be in /usr/bin/java

Then, I also added the following to the file /etc/environment
JAVA_HOME="/home/pi/java/ejre1.6.0_38"

And finally, I added the following to /home/pi/.bashrc
export JAVA_HOME="/home/pi/java/ejre1.6.0_38"
export PATH=$PATH:$JAVA_HOME/bin

Now everything works fine for me. Open-remote and three of my other java apps all now run correctly on start-up. I was using Java 6 above, but i'm sure if the file paths are altered for any of the other java versions, this should also work. You can even install all the JVMs and use the 'alternative' method to switch between them for comparison.

Perhaps I missed an instruction somewhere already and maybe you wont need to do the above, but as it took me a little while to figure it out, I thought i'd share my experience...

As a new user to open remote, I just wanted to thank the guys for creating it, Its an amazing product to give away for free! Thanks guys!

The only working Java edition for a Raspberry Pi that works together with OpenRe...

The only working Java edition for a Raspberry Pi that works together with OpenRemote and with the RaZberyy ZWave platform is OpenJDK (IcedTea6 Zero VM).
The RaZberry software requires a hard-float installation which excludes the Oracle SE 6 VM (only available for soft float configuration).
Oracle SE 7 is incompatible with the Drools rule engine 5.1.1 that is currently used by OpenControl 2.0, 2.1 (and soon 2.2).
Also Java SE 8 has problem with the Drools rule engine 5.1.1, even if this may not be immediately visible. But rules that are reading sensor values are not working (it has me taken multiple evenings to figure out this!):

OpenJDK (IcedTea6 Zero VM) is slower than Oracle Java, but it is available for hard float installation and the Drools rule engine 5.1.1 works.
I hope OpenRemote will be soon updated to Drools 5.5 that should again be compatible with Oracle Java 8.

When I found out about Openremote I decided to try it by installing the controll...

When I found out about Openremote I decided to try it by installing the controller on a Mac. I was very positively surpised by all what openremote offers, and I am decided to use it for a small home automation project. Then I decided to buy a Raspberry Pi and install the controller on it, but I was a little bit scared by all the issues related to Java versions and Hard vs. Soft Float described in this section. Fortunately it ended up being much easier than I expected.

The Raspbian image that comes with NOOBS image of November 2nd, is hard float and comes with Oracle Java 7 already installed. With it, insallation of the controller in the Raspberry Pi has been as easy as in the Mac. So far I haven't stressed it too much, but it's running smoothly and reliably.

Hello,
I'm trying to use the RP with OR and I have a problem with the webconso...

Hello,

I'm trying to use the RP with OR and I have a problem with the webconsole. It is not working with chromium, midori, iceweasel, konqueror, ... The buttons for "Search", "Add" and "Settings" are displayed, but it is not possible to select them.
The only way to select the controller is the access from another PC from the same network. However I want to use a display from chalkboard together with the RP.

I tried java 6, 7 and 8 but it is no difference. The server is always starting (Upload and Sync is possible), but I can not select the controller in the webconsole. With Windows and Firefox it is working.

Hi,
I assume you are running the browsers on the RPi as well? If you are then i...

Hi,

I assume you are running the browsers on the RPi as well? If you are then it sounds like the useragent is making the webconsole assume it is a mobile device and so it starts automatically in fullscreen mode with no sliding toolbar on the left hand side of the screen. In mobile mode the webconsole expects touch events not click events.

Unfortunately some browsers report touch and click events so the decision was made to only listen for one or the other; I will look to see if there is a reliable way to determine what is supported.

Can you post the useragent strings that the browsers are reporting by visiting and copying the top part: -

Yes, the browsers are running on the RP as well as the server. I think you are r...

Yes, the browsers are running on the RP as well as the server. I think you are right with the mobile device, because of the fullscreen mode and the missing toolbar. I have connected a touch display from chalkboard, but neither the touch nor the mouse is working correctly, together or alone. If I connect the system to another screen without touch it is also not working.

Yes the "armv" string will be identifying the browsers as mobile; I suspect that...

Yes the "armv" string will be identifying the browsers as mobile; I suspect that none of those browsers support touch events irrespective of what hardware you have connected, I've made a slight change to the webconsole which will hopefully not mark your browser as being a mobile device, you can download this at: -

Hi I have just installed openremote on my new Raspberry Pi overclock to 800Mhz, ...

Hi I have just installed openremote on my new Raspberry Pi overclock to 800Mhz, I used java 1.8.0_20 and i don't use Rules.

The install was fine, and openremote is working ok, abit slow.
The sync to the beehive takes some minuts, and when I open the app on my Ipad, it takes about 10sec, it's not the best, but I hope it gets better in futere releases.

The problem is when the app is loaded it comes with an error: "Warning - Occured unknown error, satus code is 0 Using cached content."

Totally agreed on the need for update. Short version of the current state is tha...

Totally agreed on the need for update. Short version of the current state is that OR loads and runs well on the latest with very little effort. Whatever issues had been with Oracle Java 8 seem to be gone. And an RPi2 seems like a very nice platform. Next up, I'm setting it up as a full local server (beehive, designer, etc), so we'll see how that goes. A full article on that would be nice to have.

Perhaps worth adding: the latest version of Wheezy (as of Feb, 2015) is ready to...

Perhaps worth adding: the latest version of Wheezy (as of Feb, 2015) is ready to add Java without any gymnastics. Just sudo apt-get install oracle-java7-jdk. It's not the beta; and it's version 8; but it seems to work great with OR on RPi2.

If you're going down this road, here's the basics I've documented to get rolling on a fresh SD after firing up Wheezy:

1. Expand the card

from raspi-config

use "sudo raspi-config" if you don't see it by default anymore

reboot
2. Do updates (this is all the various versions of "update" I found - so I did them all)

sudo rpi-update

sudo reboot

sudo apt-get update

sudo apt-get upgrade

sudo apt-get dist-upgrade

sudo apt-get install raspberrypi-ui-mods
3. Then add Java

sudo apt-get install oracle-java8-jdk

4. I also like to be able to "RDP" to the box for testing stuff, so

sudo apt-get install xrdp

5. I downloaded OR from the browser inside the RPi and moved it from Download folder to Desktop and tested it. All worked great from command-line (./openremote.sh run) but, of course, my devices weren't set up yet. Stopped it (Ctrl-C)

6. Set up Russound and ISY by editing ~/Desktop/openremote/webapps/controller/WEB-INF/classes/config.properties then restarted. Devices work.

7. Moved the folder into /opt/ (seems like a better place than the Pi Desktop)

sudo cp ~/Desktop/openremote /opt/openremote

sudo chown -R pi /opt/openremote

restarted it and all worked again

8. set up the script as above in last section and rebooted. All works.