Giter Site home page Giter Site logo

smarthome-packaging-sample's Introduction

Eclipse SmartHome Packaging Sample

concierge osgi

This repo contains a sample of how to create a small working runtime package that uses the Eclipse SmartHome framework. You can use this example to build an own minimal distribution with a very optimized memory footprint.

More information about concierge: https://www.eclipse.org/concierge/index.php

  1. Prerequisites - Install Maven ================ Please use the instructions on main project's readme to install maven: https://github.com/eclipse/smarthome#1-prerequisites
  • Make sure mvn command is available on your path.
  • Make sure you're using a JDK 8.
  1. Checkout ================ Checkout the source code from GitHub, e.g. by running:
git clone https://github.com/eclipse/smarthome-packaging-sample.git
  1. Build the distribution ================ Run
mvn clean install

The maven build will create an ZIP file with all required components like

  • the concierge runtime
  • Eclipse SmartHome bundles
  • 3rd party bundles
  • start scripts

You can find the created distribution under /target/smarthome-packaging-sample-[version].zip

The directory structure of the distribution

  • addons: Folder for hotdeployment of bundles
  • runtime: Contains the runtime
  • concierge: Contains the conciege osgi runtime
    • bundles: Additional concierge bundles
    • framework: The Framework
    • system: Contains commons and 3rd party bundles
      • org.eclipse.jetty: All jetty bundles
      • org.eclipse.smarthome: All SmartHome bundles
  • etc: Quartz configuration, Jetty configuration, keystore
  • userdata: This folder is created during the first startup and contains persistent userdata and the osgi storage.
  1. Start runtime ================ Extract the distribution zip file and start the runtime:
unzip smarthome-packaging-sample-[version].zip
./start.sh
  1. Using the UI ================ The distribution already includes the PaperUI. Goto: http://your-host:8080/ you will be redirected to /ui/index.html

Also included is the Apache Felix Web Console. The Apache Felix Web Console is a simple tool to inspect and manage OSGi framework Goto: http://your-host:8080/system/console/

Customize the distribution

Concierge configuration with XARGS file

The .xargs file can contain both runtime properties for configuring the framework, as well as a set of framework commands. Properties are declared as -Dkey=value. The following commands are allowed:

  • -install <bundle URL> : installs a bundle from a given bundle URL
  • -start <bundle URL> : starts a bundle that was previously installed from the given bundle URL
  • -istart <bundle URL> : install and starts a bundle from a given bundle URL
  • -all <file directory> : install and start all .jar files in a given directory
  • -initlevel <level> : sets the startlevel that will be used for all next bundles to be installed
  • -skip : skips the remainder of the .xargs file (handy for debugging)

See for more details: https://www.eclipse.org/concierge/documentation.php#basic

How to add further bundles?

  1. Add your bundle as dependecy in the pom.xml. For example:
  <!-- Eclipse SmartHome dependencies - Bindings -->
        <dependency>
            <groupId>org.eclipse.smarthome.binding</groupId>
            <artifactId>org.eclipse.smarthome.binding.wemo</artifactId>
            <version>${esh.version}</version>
        </dependency>
  1. Add the install and startup command to XARGS file. For example:
# Eclipse SmartHome Bindings. Start all bindings here
-istart ${esh.dir}/org.eclipse.smarthome.binding.wemo-${esh.version}*.jar

The bundle couldn't be started? Please check the following conditions:

  • Is the JAR file included in the assembled ZIP? Check the /src/assemble/concierge.xml which defines the included file sets of the assembly.
  • Maybe the required import-packages are not satisfied. Add another bundle which exports the required packages.

Change the OSGi Shell

The sample does already include two versions of osgi shell implementations:

  • Concierge Shell (default)
  • Apache Felix GoGo

If you want using Apache Felix GoGo simple uncomment the GoGo bundles and remove startup of concierge shell like:

# -istart ${concierge.dir}/org.eclipse.concierge.shell-${concierge.version}*.jar
-istart ${system.dir}/org.apache.felix.gogo.runtime-0.*.jar
-istart ${system.dir}/org.apache.felix.gogo.command-0.*.jar
-istart ${system.dir}/org.apache.felix.gogo.shell-0.*.jar

At next startup you will see the g! prompt instead of concierge>

Passing own options to JVM

You can use JAVA_OPTS for passing own parameter to JVM e.g. the Java Heap size etc.

Limitations

It's not possible to run XText under concierge due to dependencies on equinox runtime. For this reason all modeling packages have been removed from this distribution. There are no .items, .rule, .thing, etc. files. Try to use new generation rule engine to manage rules.

smarthome-packaging-sample's People

Contributors

chrisschauer avatar kaikreuzer avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.