This page last changed on Jul 16, 2013 by nwe.

Are there specific linux install instructions for the controller?
I have created a fresh debian install on a laptop and this is my first attempt at using linux.
Neil.


OpenRemote.png (image/png)

Install OpenRemote on Generic x86 Linux Distribution

Follow the steps below. Please send feedback if the steps worked. They have not been verified.

1. Install Java Virtual Machine

Please install Java version 6 for now.

Debian, Ubuntu, etc.

> sudo apt-get install openjdk-6-jdk

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

> su -c "yum install java-1.6.0-openjdk"

2. Check Java installation

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

> which java 
/usr/bin/java 

> java -version 
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Output of the commands above will vary depending which Java VM package you've installed.

3. Set JAVA_HOME environment variable

To be on the safe side, help Java applications find your installed Java virtual machine (many Java applications attempt to locate the Java VM using JAVA_HOME variable although not all require it):

> export JAVA_HOME=/usr

4. Download OpenRemote Controller

Download and unzip the latest OpenRemote controller from http://download.openremote.org. The rest of the examples assume you did unzip it to your /opt directory.

5. 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 /opt/OpenRemote-Controller/bin

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

> sudo chmod +x openremote.sh

Run the controller:

> ./openremote.sh run 

6. 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.

7. Start OpenRemote Automatically at Startup

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:

 
#!/bin/sh 
### BEGIN INIT INFO 
# Provides: openremote 
# Required-Start: $remote_fs $syslog 
# Required-Stop: $remote_fs $syslog 
# Default-Start: 2 3 4 5 
# Default-Stop: 0 1 6 
# Short-Description: Start daemon at boot time 
# Description: Enable service provided by daemon. 
### END INIT INFO 

 # Modify the paths to your OpenRemote Controller installation path 

cd /opt/OpenRemote-Controller/bin

case "$1" in 

stop) 
echo "Stopping OpenRemote Controller..." 
/opt/OpenRemote-Controller/bin/openremote.sh stop > /dev/null 2>&1 & 
;; 

start) 
# start OpenRemote in background mode 
/opt/OpenRemote-Controller/bin/openremote.sh start > /dev/null 2>&1 & 
echo "OpenRemote Controller started..." 
;; 

restart) 
$0 stop 
sleep 5 
$0 start 
;; 
*) 
echo "usage: $0 { start | stop | restart}" >&2 
exit 1 
;; 

esac 

Make sure the script you saved above has its executable bit set:

> sudo chmod +x /etc/init.d/NameOfYourScript

The following command makes the script run at startup:

> sudo update-rc.d NameOfYourScript defaults
Posted by juha at Jul 18, 2013 13:08

hello,
when I started the script, I get bad interpreter

?

Thanks,

Posted by acd at Aug 07, 2013 10:39

I tried to get an init script to work for days and finally gave up before resorting to this on ubuntu 10.04...

@reboot cd /home/tim/OpenRemote-Controller-2.1.0_SNAPSHOT-2013-06-17/bin ; /home/tim/OpenRemote-Controller-2.1.0_SNAPSHOT-2013-06-17/bin//openremote.sh start 2>&1 > /home/tim/Desktop/or_log.txt

This is a reboot crontab line that will restart the controller on any reboot and run it under my desktop login and path. I give up the ability to easily start/stop the controller on the running system but in practice I find that is unnecessary anyway. Hope that helps.

Tim

Posted by timbocephus at Aug 10, 2013 12:21

I've setup your script on Ubuntu installation. Now OpenRemote starts at boot, but when I call "/etc/init.d/openremote stop" the java process is still running. When I start OpenRemote again then there are two java processes running. When I restart again there are 3 processes and so on. I use the OpenRemote-Controller-2.2.0_TTS-Email-Serial.zip version. Could this version cause this problem or is this a general problem of OpenRemote?

Posted by thenetstriker at Oct 21, 2013 22:15

Hi David,

For the openremot.sh stop to work, the CATALINA_PID env variable must be set. This was recently discussed here: KNX-DEBUG.LOG spitting out a lot of data

HTH

– Juha

Posted by juha at Oct 22, 2013 00:07

I progressed all the way through the first part of Step 6. When trying to login, it gave me an authentication error, even though I rechecked the designer uname/pwd online (designer demo), cleared cache, and reloaded the page.

I am using OpenJDK 7, if that matters, and I'm using it for other apps.

What can I be doing wrong, or is there a workaround?

Posted by skyemoor at Oct 24, 2013 21:08

The first mandatory check - make sure you got your username/password combination correct, they are case sensitive.

Posted by juha at Oct 24, 2013 22:33

Hi Juha

I seem to have got the same problem as Will Stewart had. It's not a user name or password problem with me though as the same combination works fine with my 'designer account' (I presume it is also case sensitive?)

Here's the read out from my terminal (where there are square brackets I've added spaces inside to prevent Wiki Markup from displaying as links (not sure which 'escape characters' I should be using?)) :

>>>>>>>>>>> TERMINAL START 1

adrian@adrian-laptop:~$ export JAVA_HOME=/usr
adrian@adrian-laptop:~$ cd opt/OpenRemote-Controller/bin
adrian@adrian-laptop:/opt/OpenRemote-Controller/bin$ ./openremote.sh run
Using CATALINA_BASE: /opt/OpenRemote-Controller
Using CATALINA_HOME: /opt/OpenRemote-Controller
Using CATALINA_TMPDIR: /opt/OpenRemote-Controller/temp
Using JRE_HOME: /usr

---- Logging ----------------------------------------------------------

Console (stdout) threshold [ CONTROLLER_CONSOLE_THRESHOLD ]: INFO

System logs:

  • Controller startup log [ CONTROLLER_STARTUP_LOG_LEVEL ]: DEBUG

-----------------------------------------------------------------------
10-Nov-2013 22:43:14 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/OpenRemote-Controller/webapps/controller/WEB-INF/lib/native
10-Nov-2013 22:43:14 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
10-Nov-2013 22:43:14 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 440 ms
10-Nov-2013 22:43:14 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
10-Nov-2013 22:43:14 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
10-Nov-2013 22:43:14 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive webconsole.war
10-Nov-2013 22:43:15 org.openremote.controller.bootstrap.Startup redirectJULtoLog4j
INFO: Initialized JUL to LOG4J Redirector.
INFO 2013-11-10 22:43:16,181 :

********************************************************************************

Controller definition was not found in this OpenRemote Controller instance.

If you are starting the controller for the first time, please use your web
browser to connect to the controller home page and synchronize it with your
online account.

********************************************************************************

Could not find a controller definition to load at path '../webapps/controller/controller.xml' (for version 2.0)
INFO 2013-11-10 22:43:16,182 : Controller Definition File Watcher for Default Deployer started.
10-Nov-2013 22:43:16 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
10-Nov-2013 22:43:16 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2114 ms

>>>>>>>> TERMINAL END

At this point I attempt to login at http://localhost:8080/controller/ The page displays fine, but my login gets the error message : "Authentication failed, please check your username and password."
The terminal output then continues:

>>>>>>>>> TERMINAL START 2

ERROR 2013-11-10 22:43:47,025 : Synchronizing controller with online account failed : Authentication failed, please check your username and password.
org.openremote.controller.exception.ConnectionException: Authentication failed, please check your username and password.
at org.openremote.controller.service.Deployer$BeehiveConnection.downloadZip(Deployer.java:1492)
at org.openremote.controller.service.Deployer$BeehiveConnection.access$200(Deployer.java:1385)
at org.openremote.controller.service.Deployer.deployFromOnline(Deployer.java:536)
at org.openremote.controller.action.ConfigManageController.syncOnline(ConfigManageController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:806)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:736)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.openremote.controller.rest.support.json.JSONCallbackFilter.doFilter(JSONCallbackFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:354)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
ERROR [ HTTP-Thread-1 ]: Synchronizing controller with online account failed : Authentication failed, please check your username and password.
org.openremote.controller.exception.ConnectionException: Authentication failed, please check your username and password.
at org.openremote.controller.service.Deployer$BeehiveConnection.downloadZip(Deployer.java:1492)
at org.openremote.controller.service.Deployer$BeehiveConnection.access$200(Deployer.java:1385)
at org.openremote.controller.service.Deployer.deployFromOnline(Deployer.java:536)
at org.openremote.controller.action.ConfigManageController.syncOnline(ConfigManageController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:434)
at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:372)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:806)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:736)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:360)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.openremote.controller.rest.support.json.JSONCallbackFilter.doFilter(JSONCallbackFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:354)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

>>>>>>>>>>>>>>>>>>>>>> TERMINAL END 2

Java infos are:

>>>>>>>>>>>>>>>>>>>>>>>>>
adrian@adrian-laptop:~$ which java
/usr/bin/java
adrian@adrian-laptop:~$ java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.04.2)
OpenJDK Server VM (build 20.0-b12, mixed mode)
>>>>>>>>>>>>>>>>>>>>>>>>>>>

Any thoughts appreciated!

Posted by adrianp at Nov 11, 2013 00:25

That init script worked for me on RPi running Raspian.

Posted by atamariya at Nov 11, 2013 03:33

I made the controller start on boot by editing rc.local the same way prescribed for voyage linux. Is there a benefit to running this script instead?

Posted by prlarsen at Feb 25, 2014 03:03
Document generated by Confluence on Jun 05, 2016 09:41