deployment of openHAB on embedded linux device and new binding...

681 views
Skip to first unread message

dcand...@gmail.com

unread,
Aug 12, 2013, 3:10:48 PM8/12/13
to ope...@googlegroups.com
Hi all,
i'm new on openHAB forum.

I'd like to deploy openHAB on an ARM powered device with linux embedded.
This device, named HomePLC.Linux, is a domotic PLC and its domotic network
is based on rs485 bus and on a proprietary protocol named XComm++.

My intention is to exploit directly the home automation system provided by the
device
and use it as the basis for integration with other technologies
.

HomePLC.Linux comes with the native library to access the PLC memory and the
interfacing
(JNI) Java Class.
Currently I have made ​​my own system to read data from the sensors,  execute
commands
to
actuators and an event generator based on changes of registers.

I tried to start openHAB on the device but not all bundles were active, many
resolved and many
starting, ending with... (sorry for the long list that will follow)
I saw the error "UnknownHostException" and i'm trying to solve it.

I'm trying to
create a binding for HomePLC but I have many problems currently
and I have a lot to study because it isn't all clear to me.
I was wondering if i can use a reduced/minimal version of openHab to test the proper
initialization
of the system.


Thanks.
Danilo

...
...
19:52:52,651 |-ERROR in ch.qos.logback.core.util.ContextUtil@199ebae - Failed to get local hostname java.net.UnknownHostException: (none): (none)
    at java.net.UnknownHostException: (none): (none)
    at     at java.net.InetAddress.getLocalHost(InetAddress.java:1438)
...
...
19:53:05.534 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime has been started (v1.2.0).
19:53:55.921 WARN  javax.jmdns.impl.HostInfo[:96] - Could not intialize the host network interface on nullbecause of an error: (none): (none)
java.net.UnknownHostException: (none): (none)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1438)
Caused by: java.net.UnknownHostException: (none)
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
19:53:56.092 INFO  o.o.i.s.i.DiscoveryServiceImpl[:92] - mDNS service has been started
19:54:13.156 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
19:54:19.031 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at /openhab.app

START LEVEL 6
   ID|State      |Level|Name
    0|Active     |    0|OSGi System Bundle (3.8.2.v20130124-134944)
    1|Resolved   |    4|geronimo Javax Transaction API 1.1.1 spec (1.1.1.v201105210645)
    2|Active     |    1|Simple Configurator (1.0.301.v20120914-163612)
    3|Resolved   |    4|Logback Classic Module (1.0.0.v20111214-2030)
    4|Resolved   |    4|Logback Core Module (1.0.0.v20111214-2030)
    5|Resolved   |    1|Logback Native SLF4J Logger Module (1.0.0.v20120123-1500)
    6|Resolved   |    4|Guava: Google Core Libraries for Java 1.5 (10.0.1.v201203051515)
    7|Resolved   |    4|Google Guice (No AOP) (3.0.0.v201203062045)
    9|Starting   |    4|International Components for Unicode for Java (ICU4J) Replacement plug-in (4.4.2.v20110831)
   10|Resolved   |    4|Apache Geronimo Activation Plug-in (1.1.0.v201108011116)
   11|Resolved   |    4|javax.annotation Bundle (1.1.0.v201108011116)
   12|Resolved   |    4|Atinject Dependency Injection Annotations (1.0.0.v20091030)
   13|Resolved   |    4|Javax Mail Plug-in (1.4.0.v201005080615)
   14|Resolved   |    4|Servlet API Bundle (3.0.0.v201112011016)
   15|Resolved   |    4|JAXP XML (1.3.4.v201005080400)
   16|Resolved   |    4|XML Binding for Java (2.2.0.v201105210648)
   17|Resolved   |    4|Java XML Streaming API (1.0.1.v201004272200)
   18|Resolved   |    4|ANTLR Runtime (3.2.0.v201101311130)
   19|Resolved   |    4|Apache Ant (1.8.3.v201301120609)
   20|Resolved   |    4|Apache Batik CSS (1.6.0.v201011041432)
   21|Resolved   |    4|Apache Batik Utilities (1.6.0.v201011041432)
   22|Resolved   |    4|Apache Batik GUI Utilities (1.6.0.v201011041432)
   23|Resolved   |    4|Apache Commons CLI (1.2.0.v201105210650)
   24|Resolved   |    4|Apache Commons Codec Plug-in (1.3.0.v201101211617)
   25|Resolved   |    4|Apache Commons Collections (3.2.0.v201005080500)
   26|Resolved   |    4|Apache Commons Httpclient (3.1.0.v201012070820)
   27|Resolved   |    4|Apache Commons IO (2.0.1.v201105210651)
   28|Resolved   |    4|Apache Commons Lang (2.6.0.v201205030909)
   29|Resolved   |    4|Apache Commons Logging Plug-in (1.0.4.v201101211617)
   30|Resolved   |    4|Apache Commons Net (3.1.0.v201205071737)
   31|Active     |    3|Apache Felix File Install (3.1.10)
   32|Active     |    4|Apache Felix Gogo Command (0.8.0.v201108120515)
   33|Active     |    4|Apache Felix Gogo Runtime (0.8.0.v201108120515)
   34|Active     |    4|Apache Felix Gogo Shell (0.8.0.v201110170705)
   35|Resolved   |    4|Apache HttpClient OSGi bundle (4.1.0.v201103311320)
   36|Resolved   |    4|Apache HttpComponents HttpCore (4.1.0.v201101201700)
   39|Resolved   |    4|Commands (3.6.2.v20130123-162658)
   40|Active     |    4|Eclipse Content Mechanism (3.4.200.v20120523-2004)
   41|Starting   |    4|JFace Data Binding (1.4.1.v20120912-132807)
   42|Starting   |    4|JFace Data Binding Observables (1.4.1.v20120521-2329)
   43|Starting   |    4|JFace Data Binding (1.4.100.v20120523-1955)
   44|Starting   |    4|Expression Language (3.4.401.v20120912-155018)
   45|Starting   |    4|File Buffers (3.5.200.v20120523-1310)
   46|Active     |    4|Core File Systems (1.3.200.v20130115-145044)
   47|Active     |    4|Eclipse Jobs Mechanism (3.5.300.v20120912-155018)
   48|Active     |    4|Core Resource Management (3.8.1.v20121114-124432)
   49|Active     |    4|Core Runtime (3.8.0.v20120912-155025)
   50|Starting   |    4|Core Variables (3.2.600.v20120521-2012)
   53|Starting   |    4|Eclipse e4 core commands (0.10.1.v20120523-1955)
   54|Starting   |    4|Eclipse Contexts (1.2.0.v20121221-192508)
   55|Starting   |    4|Eclipse Dependency Injection (1.2.0.v20121024-173149)
   56|Starting   |    4|Eclipse Dependency Injection Extensions (0.11.100.v20121024-182359)
   57|Starting   |    4|Eclipse Application Services (1.0.0.v20120521-2346)
   71|Starting   |    4|ECF Core API (3.1.300.v20120610-1946)
   72|Starting   |    4|ECF Filetransfer API (5.0.0.v20120610-1946)
   73|Starting   |    4|ECF Core Identity API (3.1.200.v20120610-1946)
   74|Starting   |    4|ECF Filetransfer Provider (3.2.0.v20120610-1946)
   75|Starting   |    4|ECF HttpClient Filetransfer Provider (4.0.200.v20120610-1946)
   76|Resolved   |    1|ECF HttpClient Filetransfer Provider (1.0.0.v20120610-1946)
   77|Resolved   |    1|ECF Filetransfer Provider (1.0.0.v20120610-1946)
   78|Resolved   |    1|ECF Core API (1.0.100.v20120610-1946)
   79|Installed  |    4|EMF Code Generation (2.8.0.v20130125-0826)
   80|Installed  |    4|EMF Ecore Code Generator (2.8.2.v20130125-0826)
   81|Active     |    4|EMF Common (2.8.0.v20130125-0546)
   82|Active     |    4|EMF Ecore (2.8.3.v20130125-0546)
   83|Starting   |    4|EMF Change Model (2.8.0.v20130125-0546)
   84|Active     |    4|EMF XML/XMI Persistence (2.8.1.v20130125-0546)
   85|Starting   |    4|MWE Core (1.2.1.v201206110920)
   86|Resolved   |    4|MWE Utilities  (1.2.1.v201206110920)
   87|Starting   |    4|Modeling Workflow Engine 2 Language (2.3.0.v201206120758)
   88|Resolved   |    4|Modeling Workflow Engine 2 Launch (2.3.0.v201206120758)
   89|Resolved   |    4|MWE2 Lib (2.3.0.v201206110920)
   90|Resolved   |    4|Modeling Workflow Engine 2 Runtime (2.3.0.v201206110920)
   91|Active     |    4|Equinox Application Container (1.3.100.v20120522-1841)
   92|Active     |    3|Configuration Admin (1.0.400.v20120522-1841)
   93|Active     |    2|Common Eclipse Runtime (3.6.100.v20120522-1841)
   94|Starting   |    4|Equinox Concurrent API (1.0.300.v20120912-130548)
   95|Active     |    4|Console plug-in (1.0.0.v20120522-1841)
   96|Active     |    2|Declarative Services (1.4.1.v20120926-201320)
   97|Active     |    2|Event Admin (1.2.200.v20120522-2049)
   98|Starting   |    4|Equinox Framework Admin (2.0.100.v20120913-155515)
   99|Active     |    3|Equinox Framework Admin for Equinox (1.0.400.v20120913-155709)
  100|Resolved   |    4|Http Service Registry Extensions (1.1.200.v20120912-130548)
  101|Active     |    4|Http Services Servlet (1.1.300.v20120522-1841)
  102|Resolved   |    4|Equinox Launcher (1.3.0.v20120522-1813)
  103|Starting   |    4|Equinox Provisioning Artifact Repository Support (1.1.200.v20120430-1959)
  104|Active     |    3|Equinox Provisioning Console (1.0.300.v20120429-0125)
  105|Active     |    4|Equinox Provisioning Core (2.2.0.v20120430-0525)
  106|Starting   |    4|Equinox Provisioning Director (2.2.0.v20120524-0542)
  107|Starting   |    4|Equinox Provisioning Engine (2.2.0.v20130121-021919)
  108|Starting   |    4|Equinox Provisioning Garbage Collector (1.0.200.v20110808-1657)
  109|Resolved   |    4|Equinox Provisioning JAR Processor (1.0.200.v20110808-1657)
  110|Active     |    4|Equinox Provisioning Metadata (2.1.0.v20120430-2001)
  111|Starting   |    4|Equinox Provisioning Metadata Repository (1.2.100.v20120524-1717)
  112|Starting   |    4|Equinox Provisioning p2 query language (2.0.100.v20110808-1657)
  113|Active     |    4|Equinox Provisioning Repository (2.2.0.v20120524-1945)
  114|Starting   |    4|Equinox Provisioning Eclipse Touchpoint (2.1.100.v20120428-0117)
  115|Starting   |    4|Equinox Provisioning Native Touchpoint (1.1.0.v20130121-021919)
  116|Starting   |    4|Equinox Provisioning ECF based Transport (1.0.100.v20120913-155635)
  117|Active     |    4|Eclipse Preferences Mechanism (3.5.1.v20121031-182809)
  118|Active     |    4|Extension Registry Support (3.5.200.v20120522-1841)
  119|Starting   |    4|Equinox Java Authentication and Authorization Service (JAAS) (1.1.100.v20120522-1841)
  120|Active     |    3|Simple Configurator Manipulator (2.0.0.v20110808-1657)
  121|Active     |    4|Equinox Util Bundle (1.0.400.v20120917-192807)
  126|Installed  |    4|JDI Debug Model (3.7.101.v20120913-153601)
  130|Resolved   |    4|Jetty :: Asynchronous HTTP Client (8.1.3.v20120522)
  131|Resolved   |    4|Jetty :: Continuation (8.1.3.v20120522)
  132|Resolved   |    4|Jetty :: Deployers (8.1.3.v20120522)
  133|Resolved   |    4|Jetty :: Http Utility (8.1.3.v20120522)
  134|Resolved   |    4|Jetty :: IO Utility (8.1.3.v20120522)
  135|Resolved   |    4|Jetty :: JMX Management (8.1.3.v20120522)
  136|Resolved   |    4|Jetty :: JNDI Naming (8.1.3.v20120522)
  137|Active     |    4|Jetty :: OSGi :: Boot (8.1.3.v20120522)
  138|Resolved   |    4|Support for rfc66 war url scheme (8.1.3.qualifier)
  139|Active     |    4|OSGi HttpService provided by equinox HttpServiceServlet deployed on jetty (8.1.3.qualifier)
  140|Resolved   |    4|Jetty :: Plus (8.1.3.v20120522)
  141|Resolved   |    4|Jetty :: Rewrite Handler (8.1.3.v20120522)
  142|Resolved   |    4|Jetty :: Security (8.1.3.v20120522)
  143|Active     |    4|Jetty :: Server Core (8.1.3.v20120522)
  144|Resolved   |    4|Jetty :: Servlet Handling (8.1.3.v20120522)
  145|Resolved   |    4|Jetty :: Utility Servlets and Filters (8.1.3.v20120522)
  146|Resolved   |    4|Jetty :: Utilities (8.1.3.v20120522)
  147|Resolved   |    4|Jetty :: Webapp Application Support (8.1.3.v20120522)
  148|Resolved   |    4|Jetty :: Websocket (8.1.3.v20120522)
  149|Resolved   |    4|Jetty :: XML utilities (8.1.3.v20120522)
  153|Starting   |    4|Refactoring Core (3.6.0.v20120523-1543)
  155|Resolved   |    4|OSGi Release 4.2.0 Services (3.3.100.v20120522-1822)
  157|Resolved   |    4|Standard Widget Toolkit (3.100.1.v4236b)
  160|Resolved   |    4|Text (3.5.200.v20120523-1310)
  172|Resolved   |    4|Xpand Core  (1.2.0.v201206110941)
  173|Resolved   |    4|Xtend Core  (1.2.0.v201206110941)
  174|Resolved   |    4|Xtend Runtime Library (2.3.0.v201206120633)
  175|Resolved   |    4|Xtend EMF Typesystem  (1.2.0.v201206110941)
  176|Active     |    4|Xtext  (2.3.0.v201206120633)
  177|Active     |    4|Xtext Common Types (2.3.0.v201206120633)
  178|Starting   |    4|Xtext Ecore Support  (2.3.0.v201206120633)
  179|Starting   |    4|Xtext Generator  (2.3.0.v201206120633)
  180|Resolved   |    4|JSR-45 Smap installer (2.3.0.v201206120633)
  181|Resolved   |    4|Xtext Utility  (2.3.0.v201206120633)
  182|Active     |    4|Xbase Model  (2.3.0.v201206120633)
  183|Resolved   |    4|Xbase Runtime Library (2.3.0.v201206120633)
  184|Active     |    4|openHAB Config Core (1.2.0.201304141051)
  185|Active     |    4|openHAB Core (1.2.0.201304141051)
  186|Active     |    4|openHAB AutoUpdate Binding (1.2.0.201304141051)
  187|Active     |    4|openHAB Core Library (1.2.0.201304141051)
  188|Active     |    4|openHAB Core Persistence (1.2.0.201304141051)
  189|Active     |    4|openHAB Scheduler Service (1.2.0.201304141051)
  190|Resolved   |    4|openHAB Script Engine (1.2.0.201304141051)
  191|Active     |    4|openHAB Transformation Service (1.2.0.201304141051)
  192|Active     |    4|openHAB Console (1.2.0.201304141051)
  193|Active     |    4|openHAB Google Calendar (1.2.0.201304141051)
  194|Active     |    4|openHAB Monitor (1.2.0.201304141051)
  195|Active     |    4|openHAB Multimedia I/O Bundle (1.2.0.201304141051)
  196|Active     |    4|openHAB Net I/O Bundle (1.2.0.201304141051)
  197|Active     |    4|openHAB REST Interface Bundle (1.2.0.201304141051)
  198|Active     |    4|openHAB Bonjour/MDS Service Discovery Bundle (1.2.0.201304141051)
  199|Resolved   |    4|openHAB Serial Transport Bundle (1.2.0.201304141051)
  200|Active     |    4|openHAB Addon Library Telephony (1.2.0.201304141051)
  201|Active     |    4|openHAB Model Core (1.2.0.201304141051)
  202|Active     |    4|openHAB Item Model (1.2.0.201304141051)
  203|Active     |    4|openHAB Persistence Model (1.2.0.201304141051)
  204|Active     |    5|openHAB Rule Model (1.2.0.201304141051)
  205|Active     |    4|openHAB Script (1.2.0.201304141051)
  206|Active     |    4|openHAB Sitemap Model (1.2.0.201304141051)
  207|Active     |    4|openHAB UI (1.2.0.201304141051)
  208|Active     |    4|openHAB WebApp UI (1.2.0.201304141051)
  209|Resolved   |    4|SAT4J Core (2.3.0.v20110329)
  210|Resolved   |    4|SAT4J Pseudo (2.3.0.v20110329)
  211|Resolved   |    4|SLF4J API (1.6.4.v20120130-2120)
  212|Resolved   |    4|SLF4J JCL 1.1.1 implementation over SLF4J (1.6.4.v20120130-2120)
  213|Resolved   |    4|SLF4J java.util.logging Bridge (1.6.4.v20120130-2120)
  214|Resolved   |    4|SLF4J Log4j implemented over SLF4J (1.6.4.v20120130-2120)
  215|Resolved   |    4|W3C CSS SAC (1.3.1.v200903091627)
  216|Resolved   |    4|W3C SMIL DOM (1.0.0.v200806040011)
  217|Resolved   |    4|W3C SVG DOM (1.1.0.v201011041433)




dcand...@gmail.com

unread,
Aug 14, 2013, 10:07:42 AM8/14/13
to ope...@googlegroups.com

Hi, i solved my UnknownHostException error and i'm now able to
connect to the demo with browser.
Actually
the following bundles remain in the state Resolved

  192|Resolved   |    4|openHAB Script Engine (1.3.0.201308140307)
  201|Resolved   |    4|openHAB Serial Transport Bundle (1.3.0.201308140307)
  223|Resolved   |    1|openHAB RRD4j Persistence Bundle (1.3.0.201308140307)

in fact, I get the following  runtime errors

15:47:47.790 ERROR o.o.p.r.internal.RRD4jService[:252] - Could not create rrd4j database file '/openhab/etc/rrd4j/Heating_GF_Toilet.rrd': Invalid argument
15:47:48.112 ERROR o.o.p.r.internal.RRD4jService[:252] - Could not create rrd4j database file '/openhab/etc/rrd4j/Window_GF_Toilet.rrd': Invalid argument
15:47:48.175 ERROR o.o.p.r.internal.RRD4jService[:252] - Could not create rrd4j database file '/openhab/etc/rrd4j/Heating_GF_Living.rrd': Invalid argument
etc...etc...

Many other bundles remain in Starting/Resolved state.
Do i really need them? I don't have so much space available on my embedded device.
I'd like to preserve it.

Thanks.
Danilo

Kai Kreuzer

unread,
Aug 17, 2013, 3:10:28 PM8/17/13
to ope...@googlegroups.com
Hi Danilo,

You won't really need all bundles that are included in the runtime, but I do not have any details of what you could possibly remove.
I actually planned to reduce the set of bundles to the absolutely minimum with issue https://code.google.com/p/openhab/issues/detail?id=138.
This should make openHAB more optimized for embedded hardware like the RaspPi (what it currently isn't).

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

dcand...@gmail.com

unread,
Aug 19, 2013, 6:08:25 PM8/19/13
to ope...@googlegroups.com
Hi all,
I made a mistake
adding an answer sending to Kai a private message
so
I post below his reply.


Thanks again Kai.
Danilo

Hi Danilo,

There is a programmatic way to define items, rules, etc… ?

Yes, there are different options:
1. As the models are EMF models, you can use EMF in a programmatic way to add new models in the model repository
2. You can implement things like ItemProvider and SitemapProvider and directly add your own items or sitemaps to the system.

Regards,
Kai

Am Aug 18, 2013 um 1:16 PM schrieb ********@gmail.com:

Hi Kai,
thanks for your reply and... great project!!!

Fortunately I was able to deploy all 1.3.0.SNAPSHOT with demo bundles (without TTS - it doesn't fit).
My device has also an external sd memory (not for system startup) so i'm planning to route logging
and persistence on it... when I will be able to understand how :-)

I'm also trying to take confidence with xText, xBase but i'm new to them.
if I understand correctly all model bundles bridge from dsl to java.
There is a programmatic way to define items, rules, etc... ?

Thanks again.
Danilo

pavel.too...@gmail.com

unread,
Mar 26, 2014, 1:45:41 PM3/26/14
to ope...@googlegroups.com
Hi Danilo,

I try to run OpenHAB on OpenWrt on my TP-LINK TL-WDR4300 (which run on OpenWrt Attitude Adjustment 12.09). I got also error message about UnknownHostException

ERROR in ch.qos.logback.core.util.ContextUtil@732627d0 - Failed to get local hostname java.net.UnknownHostException: OpenWrt
at java.net.UnknownHostException


I wonder how did you fix this error. Can you please send me how fix this problem?

Dne středa, 14. srpna 2013 16:07:42 UTC+2 Danilo Candiotti napsal(a):

Danilo Candiotti

unread,
May 15, 2014, 7:03:39 PM5/15/14
to ope...@googlegroups.com
Wow... a lot of time from my first attempt.
I don't remember well how i solved but i'll try to recreate it.

You already solved?

Reply all
Reply to author
Forward
0 new messages