Rhiot Documentation
  • Introduction
  • Gateway
    • Camel Kura router
    • Monitoring
    • Customising
    • Camel components
      • Camel Bluetooth component
      • Camel GPS BU353 component
      • Camel GPSD component
      • Camel TinkerForge component
      • Camel Pi4j component
      • Camel Framebuffer component
      • Camel Webcam component
    • Eclipse Kura support
      • Camel components for Eclipse Kura
        • Camel Kura Wifi component
        • Camel Kura Cloud component
    • Mini gateway
      • Installing
      • GPS
  • Backend
    • Camel Components
      • Camel OpenIMAJ component
      • Camel PubNub component
  • Tooling
  • Performances
  • Steroids
  • Quickstarts
    • Kura Camel quickstart
    • AMQP Cloudlet quickstarts
    • MQTT Cloudlet quickstart
  • Articles, presentations & videos
  • Building
    • Manage Kura Maven dependencies
  • Releases notes
Powered by GitBook
On this page
  • Creating a Kura Camel project
  • Prerequisites
  • Deployment
  • What the quickstart is actually doing?

Was this helpful?

  1. Quickstarts

Kura Camel quickstart

PreviousQuickstartsNextAMQP Cloudlet quickstarts

Last updated 3 years ago

Was this helpful?

The Kura Camel quickstart can be used to create Camel router OSGi bundle project deployable into the gateway. Kura is a widely adopted field gateway software for the IoT solutions. Rhiot supports Kura gateway deployments as a first class citizen and this quickstart is intended to be used as a blueprint for the Camel deployments for Kura. It uses under the hood.

Creating a Kura Camel project

In order to create the Kura Camel project execute the following commands:

git clone git@github.com:rhiot/quickstarts.git
cp -r quickstarts/kura-camel kura-camel
cd kura-camel
mvn install

Prerequisites

We presume that you have Eclipse Kura already installed on your target device. And that you know the IP address of that device. If you happen to deploy to a Raspbian-based device, and you would like to find the IP of that Raspberry Pi device connected to your local network, you can use the Rhiot device scanner, as demonstrated on the snippet below:

docker run --net=host -it rhiot/deploy-gateway scan

The command above will return an output similar to the one presented below:

Scanning local networks for devices...

======================================
Device type        IPv4 address
--------------------------------------
RaspberryPi2        /192.168.1.100

Keep in mind that /opt/eclipse/kura/kura/config.ini file on your target device should have OSGi boot delegation enabled for packages sun.*,com.sun.*. Your /opt/eclipse/kura/kura/config.ini should contain the following line then:

org.osgi.framework.bootdelegation=sun.*,com.sun.*

A boot delegation of sun packages is required to make Camel work smoothly in an Equinox.

Deployment

In order to deploy Camel application to a Kura server, you have to copy necessary Camel jars and a bundle containing your application. Your bundle can be deployed into the target device by executing an scp command. For example:

scp target/rhiot-kura-camel-1.0.0-SNAPSHOT.jar pi@192.168.1.100:/tmp

The command above will copy your bundle to the /tmp/rhiot-kura-camel-1.0.0-SNAPSHOT.jar location on a target device. Use similar scp command to deploy Camel jars required to run your project:

scp ~/.m2/repository/org/apache/camel/camel-core/2.16.0/camel-core-2.16.0.jar pi@192.168.1.100:/tmp
scp ~/.m2/repository/org/apache/camel/camel-core-osgi/2.16.0/camel-core-osgi-2.16.0.jar pi@192.168.1.100:/tmp
scp ~/.m2/repository/org/apache/camel/camel-kura/2.16.0/camel-kura-2.16.0.jar pi@192.168.1.100:/tmp
scp ~/.m2/repository/io/rhiot/camel-kura/0.1.3/camel-kura-0.1.3.jar pi@192.168.1.100:/tmp

Now log into your target device Kura shell using telnet:

telnet localhost 5002

And install the bundles you previously scp-ed:

install file:///tmp/camel-core-2.16.0.jar
install file:///tmp/camel-core-osgi-2.16.0.jar
install file:///tmp/camel-kura-2.16.0.jar
install file:///tmp/rhiot-kura-camel-1.0.0-SNAPSHOT.jar

Finally start your application using the following command:

start <ID_OF_rhiot-kura-camel-1.0.0-SNAPSHOT_BUNDLE)

What the quickstart is actually doing?

Keep in mind that bundles you deployed using the recipe above are not installed permanently and will be reverted after the server restart. Please read Kura documentation for more details regarding .

This quickstart triggers event every second and sends it to the system logger using component. This is fairy simple functionality, but enough to demonstrate the Camel Kura project is actually working and processing messages.

Eclipse Kura
Camel Kura component
permanent deployments
Camel timer
Camel Log