OpenHAB on OpenWrt

1,957 views
Skip to first unread message

pavel.too...@gmail.com

unread,
Apr 7, 2014, 7:24:50 AM4/7/14
to ope...@googlegroups.com
Hello, 

I am trying run OpenHAB on router with OpenWRT operating system (TP-LINK TL-WDR4300, OpenWrt Attitude Adjustment 12.09).

-----------------------------------------------------------------------------------------------------------------------
1) I installed Jamvm + Classpath packages on router and then I tested properly function on Hello World example. This seems to work fine.

root@OpenWrt:/data/jamvm# jamvm -Xbootclasspath:/usr/share/jamvm/classes.zip:/us
r/share/classpath/glibj.zip:. -classpath . -Dgnu.classpath.boot.library.path=/us
r/lib/classpath HelloWorldApp
Hello World!
-----------------------------------------------------------------------------------------------------------------------

2) Then I tried to run OpenHAB. I change the start.sh to run with Jamvm:

#!/bin/sh

cd `dirname $0`

# set path to eclipse folder. If local folder, use '.'; otherwise, use /path/to/eclipse/
eclipsehome="server";

# set ports for HTTP(S) server
HTTP_PORT=8080
HTTPS_PORT=8443

# get path to equinox jar inside $eclipsehome folder
cp=$(find $eclipsehome -name "org.eclipse.equinox.launcher_*.jar" | sort | tail -1);

echo Launching the openHAB runtime...
jamvm -Xms30M -Xmx80M -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djetty.port=$HTTP_PORT -Djetty.port.ssl=$HTTPS_PORT -Djetty.home=. -Dlogback.configurationFile=configurations/logback.xml -Dfelix.fileinstall.dir=addons -Djava.library.path=lib -Djava.security.auth.login.config=./etc/login.conf -Dorg.quartz.properties=./etc/quartz.properties -Dequinox.ds.block_timeout=240000 -Dequinox.scr.waitTimeOnBlock=60000 -Dfelix.fileinstall.active.level=4 -Djava.awt.headless=true -jar $cp $* -console 

-----------------------------------------------------------------------------------------------------------------------

3) Finally I started the OpenHAB and I got this output:

root@OpenWrt:/data/openhab-1.4.0# sh start.sh
Launching the openHAB runtime...
osgi> 13:25:26,766 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Fou                                                 nd resource [configurations/logback.xml] at [file:/data/openhab-1.4.0/configurat                                                 ions/logback.xml]
13:25:28,247 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction -                                                  debug attribute not set
13:25:28,425 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will sca                                                 n for changes in [[/data/openhab-1.4.0/configurations/logback.xml]] every 60 sec                                                 onds.
13:25:28,425 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction -                                                  Adding ReconfigureOnChangeFilter as a turbo filter
13:25:28,447 |-ERROR in ch.qos.logback.core.util.ContextUtil@739a5050 - Failed t                                                 o get local hostname java.net.UnknownHostException: OpenWrt
        at java.net.UnknownHostException: OpenWrt
        at      at java.net.VMInetAddress.getHostByName(Native Method)
        at      at java.net.ResolverCache.getHostByName(ResolverCache.java:162)
        at      at java.net.InetAddress.getAllByName(InetAddress.java:590)
        at      at java.net.InetAddress.getByName(InetAddress.java:550)
        at      at java.net.InetAddress.getLocalHost(InetAddress.java:615)
        at      at ch.qos.logback.core.util.ContextUtil.getLocalHostName(Context                                                 Util.java:32)
        at      at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(Co                                                 ntextUtil.java:41)
        at      at ch.qos.logback.classic.joran.action.ConfigurationAction.begin                                                 (ConfigurationAction.java:56)
        at      at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Int                                                 erpreter.java:276)
        at      at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interp                                                 reter.java:148)
        at      at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interp                                                 reter.java:130)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.ja                                                 va:50)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Gen                                                 ericConfigurator.java:157)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Gen                                                 ericConfigurator.java:143)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Gen                                                 ericConfigurator.java:106)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(Gen                                                 ericConfigurator.java:56)
        at      at ch.qos.logback.classic.util.ContextInitializer.configureByRes                                                 ource(ContextInitializer.java:75)
        at      at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Con                                                 textInitializer.java:148)
        at      at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.jav                                                 a:84)
        at      at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder                                                 .java:54)
        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at      at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.j                                                 ava:107)
        at      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:                                                 295)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        at      at org.openhab.config.core.ConfigDispatcher.<clinit>(ConfigDispa                                                 tcher.java:75)
        at      at java.lang.reflect.VMConstructor.construct(Native Method)
        at      at java.lang.reflect.Constructor.newInstance(Constructor.java:31                                                 9)
        at      at java.lang.Class.newInstance(Class.java:1154)
        at      at org.eclipse.equinox.internal.ds.model.ServiceComponent.create                                                 Instance(ServiceComponent.java:493)
        at      at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.cr                                                 eateInstance(ServiceComponentProp.java:270)
        at      at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bu                                                 ild(ServiceComponentProp.java:331)
        at      at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponen                                                 t(InstanceProcess.java:620)
        at      at org.eclipse.equinox.internal.ds.ServiceReg.getService(Service                                                 Reg.java:53)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(Se                                                 rviceUse.java:141)
        at      at java.security.AccessController.doPrivileged(AccessController.                                                 java:96)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceUse.getServi                                                 ce(ServiceUse.java:139)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistration                                                 Impl.getService(ServiceRegistrationImpl.java:468)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.get                                                 Service(ServiceRegistry.java:467)
        at      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.ge                                                 tService(BundleContextImpl.java:594)
        at      at org.eclipse.equinox.internal.cm.ManagedServiceTracker.addingS                                                 ervice(ManagedServiceTracker.java:65)
        at      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding                                                 (ServiceTracker.java:932)
        at      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding                                                 (ServiceTracker.java:1)
        at      at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTra                                                 cked.java:256)
        at      at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.j                                                 ava:229)
        at      at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(S                                                 erviceTracker.java:894)
        at      at org.eclipse.osgi.internal.serviceregistry.FilteredServiceList                                                 ener.serviceChanged(FilteredServiceListener.java:107)
        at      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.di                                                 spatchEvent(BundleContextImpl.java:861)
        at      at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEven                                                 t(EventManager.java:230)
        at      at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEve                                                 ntSynchronous(ListenerQueue.java:148)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pub                                                 lishServiceEventPrivileged(ServiceRegistry.java:819)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.pub                                                 lishServiceEvent(ServiceRegistry.java:771)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistration                                                 Impl.register(ServiceRegistrationImpl.java:130)
        at      at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.reg                                                 isterService(ServiceRegistry.java:214)
        at      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.re                                                 gisterService(BundleContextImpl.java:433)
        at      at org.eclipse.equinox.internal.ds.InstanceProcess.registerServi                                                 ce(InstanceProcess.java:536)
        at      at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponen                                                 ts(InstanceProcess.java:260)
        at      at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(                                                 Resolver.java:473)
        at      at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Res                                                 olver.java:217)
        at      at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRMan                                                 ager.java:816)
        at      at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch                                                 (SCRManager.java:783)
        at      at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.jav                                                 a:89)
        at      at org.eclipse.equinox.internal.util.impl.tpt.threadpool.Executo                                                 r.run(Executor.java:70)
13:25:28,447 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About t                                                 o instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:25:28,535 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming                                                  appender as [STDOUT]
13:25:28,723 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA                                                  - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] fo                                                 r [encoder] property
13:25:31,468 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About t                                                 o instantiate appender of type [ch.qos.logback.core.FileAppender]
13:25:31,492 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming                                                  appender as [FILE]
13:25:31,554 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA                                                  - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] fo                                                 r [encoder] property
13:25:33,097 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is                                                  set to [logs/openhab.log]
13:25:33,156 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About t                                                 o instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
13:25:33,180 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming                                                  appender as [EVENTFILE]
13:25:34,655 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip                                                  compression
13:25:36,443 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the                                                  pattern logs/events-%d{yyyy-ww}.log for the active file
13:25:48,911 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggerin                                                 gPolicy - The date pattern is 'yyyy-ww' from file name pattern 'logs/events-%d{y                                                 yyy-ww}.log.zip'.
13:25:48,911 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggerin                                                 gPolicy - Rollover at the start of week.
13:25:52,048 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggerin                                                 gPolicy - Setting initial period to Thu Mar 27 09:12:05 GMT 2014
13:25:52,092 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA                                                  - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] fo                                                 r [encoder] property
13:25:53,803 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[EVENTFILE                                                 ] - Active log file name: logs/events.log
13:25:53,803 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[EVENTFILE                                                 ] - File property is set to [logs/events.log]
13:25:53,835 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Settin                                                 g level of logger [runtime.busevents] to INFO
13:25:53,836 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Settin                                                 g additivity of logger [runtime.busevents] to false
13:25:53,838 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Atta                                                 ching appender named [EVENTFILE] to Logger[runtime.busevents]
13:25:53,867 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Atta                                                 ching appender named [STDOUT] to Logger[runtime.busevents]
13:25:53,869 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Settin                                                 g level of logger [org.openhab] to INFO
13:25:53,872 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Settin                                                 g level of logger [org.atmosphere.cpr.AtmosphereFramework] to ERROR
13:25:53,874 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Settin                                                 g level of logger [OSGi] to OFF
13:25:53,876 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Se                                                 tting level of ROOT logger to WARN
13:25:53,877 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Atta                                                 ching appender named [FILE] to Logger[ROOT]
13:25:53,879 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Atta                                                 ching appender named [STDOUT] to Logger[ROOT]
13:25:53,879 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction -                                                  End of configuration.
13:25:53,934 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@73154c00 -                                                  Registering current configuration as safe fallback point

13:26:29.959 WARN  o.o.c.core.ConfigDispatcher[:172] - Main openHAB configuratio                                                 n file 'configurations/openhab.cfg' does not exist.
13:26:30.551 INFO  o.o.c.internal.CoreActivator[:61] - openHAB runtime has been                                                  started (v1.4.0).

osgi> ss
"Framework is launched."


id      State       Bundle
0       ACTIVE      org.eclipse.osgi_3.8.2.v20130124-134944
                    Fragments=1
1       RESOLVED    javax.transaction_1.1.1.v201105210645
                    Master=0
2       ACTIVE      org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612
3       RESOLVED    ch.qos.logback.classic_1.0.7.v20121108-1250
4       RESOLVED    ch.qos.logback.core_1.0.7.v20121108-1250
5       RESOLVED    ch.qos.logback.slf4j_1.0.7.v20121108-1250
                    Master=215
6       RESOLVED    com.google.guava_10.0.1.v201203051515
7       RESOLVED    com.google.inject_3.0.0.v201203062045
9       STARTING    com.ibm.icu.base_50.1.1.v201304230130
10      RESOLVED    javax.activation_1.1.0.v201211130549
11      RESOLVED    javax.annotation_1.1.0.v201209060031
12      RESOLVED    javax.inject_1.0.0.v20091030
13      RESOLVED    javax.mail_1.4.0.v201005080615
14      INSTALLED   javax.servlet_3.0.0.v201112011016
15      RESOLVED    javax.xml_1.3.4.v201005080400
16      RESOLVED    javax.xml.bind_2.2.0.v201105210648
17      RESOLVED    javax.xml.stream_1.0.1.v201004272200
18      RESOLVED    org.antlr.runtime_3.2.0.v201101311130
19      RESOLVED    org.apache.ant_1.8.3.v201301120609
...
222     INSTALLED   org.openhab.persistence.rrd4j_1.4.0
223     INSTALLED   org.openhab.persistence.logging_1.4.0
224     INSTALLED   org.openhab.io.multimedia.tts.freetts_1.4.0
225     INSTALLED   org.openhab.binding.ntp_1.4.0
226     INSTALLED   org.openhab.persistence.exec_1.4.0
227     INSTALLED   org.openhab.binding.http_1.4.0

-----------------------------------------------------------------------------------------------------------------------

Now I am confusing where is the mistake. I know, that Jamvm is working (Hello World works). Output of osgi > ss command is "Framework is launched." I don't know, why OpenHAB runtime don't load the demo configuration.

I also created image of OpenWRT router in VirtualBox but the results are the same (I was thinking about insufficient HW parameters of my router (128MB RAM) but this seems it is not the problem).

There is link to video on youtube where is captured running OpenHAB on OpenWrt (virtualized on VirtualBox): http://goo.gl/9Kyia6

I would appreciate some help. Thank you.

Best regards

Pavel
Reply all
Reply to author
Forward
0 new messages