Raspberry Pi is a small computer. It costs just 35$. Five million have been already sold worldwide. The first goal of this project was to provide a low-cost computer for electronic and computer science education. But lots of e-hobbists like me use it for personal use (domotic for example). Camel is an Enterprise Integration Patterns (a.k.a EIP) framework to connect, process and dispatch messages from and to severals technologies.

Apache Camel and Raspberry Pi integration (proof of concept)


Before, coding and wiring, just let’s take a look inside both products. Raspberry Pi is a smart computer with lots of features :

  • Broadcom BCM2835 - ARM1176JZF-S 700 MHz
  • GPIO pin
  • I2C / SPI protocol
  • USB port
  • HDMI port
  • Audio output

Camel is a framework with severals features too :

  • Java framework from The Apache Software Foundation
  • lots of Input/Output protocols
  • HTTP, JMS, AMQP, MQTT, FTP, SSH, IMAP/POP, IRC, SMPP
  • lots of languages
  • groovy, xslt, javascript, python, php, xpath etc...
  • EIP implementation
  • message, wiretap, log, dispatch, broadcast, dead letter, splitter etc...

In this lab, we will build an simple Camel route to accept a button event from GPIO input pin and transfer it to switch a LED on and off via a GPIO output pin. Let’s start and enjoy it ;-)

Prerequisites

For this lab, you will need the following stuff :

  • a Raspberry Pi (Buy one)
    • Tested with : B model
    • Should work with : A, A+, B+, 2B
  • Raspbian OS installed (Download)
  • 1 - LED
  • 1 - Button
  • 1 - 220 Ω (ohms) Resistor
  • 4 - Wires
  • 1 - Breadboard

Setup your Raspberry Pi

Be carefull with your device, please shutdown power before wiring. Check twice before powering on or you could damage your device.

Follow wiring:

Wire

You can test your wiring with wiringpi library

Install Pi4j library

First, let’s install Pi4J library.

Currently only 1.0-RC version is available directly for RaspberryPi

$> ssh ${PI_USER}@${PI_HOST}
pi@rbpi> curl -s get.pi4j.com | sudo bash

Info

you should use a Public/Private key authentication for a faster connection to your RaspberryPi.

More information about installation here

Compile Raspberry Component

Component is still under developpement. Please feel free to test and send your feed back. Some stuff could change anytime (URI for example).

The better place to build camel-raspberry component is on your personal computer. RaspberryPi is be too slow to compile.

Checkout code and build it :

$> git clone https://github.com/camel-labs/camel-labs.git
$> cd camel-labs/iot/components/camel-raspberrypi
$> mvn package -Praspberry -Dmaven.test.skip=true

Info

Camel-raspberrypi can’t be merged into Camel master branch.

You need to compile Main (tester) program

package com.github.camellabs.component.pi4j;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A simple application to run RaspberryPi Camel
 */
public final class CamelMain {

    private static final Logger LOG = LoggerFactory.getLogger(CamelMain.class);

    private CamelMain() {
    }

    public static class CommandLineRouteBuilder extends RouteBuilder {

        String[] args;

        CommandLineRouteBuilder(String[] args) {
            this.args = args;
        }

        @Override
        public void configure() throws Exception {
            from(args[0]).id("raspberrypi-route").to(Pi4jConstants.LOG_COMPONENT).to(args[1]);
        }
    }

    public static void main(String[] args) throws Exception {
        LOG.info("main");

        for (int i = 0; i < args.length; i++) {
            LOG.info("args[" + i + "] =" + args[i]);
        }

        CamelContext context = new DefaultCamelContext();

        context.addRoutes(new CommandLineRouteBuilder(args));

        context.start();
        Thread.sleep(600000);
        context.stop();
        System.exit(0);
    }

}

It needs some Camel dependencies (via Maven) to run. We have to activate raspberry maven profile and copy all dependencies to Raspberry Pi.

Copy jar and dependencies files to your Raspberry Pi

$> cd components/camel-raspberrypi
$> ssh ${PI_USER}@${PI_HOST} 'mkdir -p /home/pi/camel'
$> scp target/*.jar ${PI_USER}@${PI_HOST}:/home/pi/camel

Install program Camel Program to your Raspberry Pi

Copy log4.properties to ${PI_HOST}:/home/pi/camel directory

#
# The logging properties used
#
log4j.rootLogger=INFO, out

# uncomment the following line to turn on Camel debugging
#log4j.logger.org.apache.camel=DEBUG
log4j.logger.org.pi4j=ALL
log4j.logger.com.github.camellabs.component.raspberrypi=ALL

# CONSOLE appender not used by default
log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{ISO8601} [%30.30t] %-30.30c{1} %-5p %m%n
#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n

1st Prototype : timer + LED

The first prototype is to setup an Timer component for sending a message every second. When message is received, the RaspberryPi endpoint Producer toggles the LED via GPIO output pin.

The command line

$> ssh ${PI_USER}@${PI_HOST}
pi@rbpi> pi4j -r com.github.camellabs.component.raspberrypi.CamelMain  \
        "timer://foo?fixedRate=true&repeatCount=60"  \
        "raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true"

Video Raspberry + LED (>20s)

Video command line

/dev/out

pi@rbpi7 ~/camel $ pi4j -r  com.github.camellabs.component.raspberrypi.CamelMain  "timer://foo?fixedRate=true&repeatCount=600" "raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true"
+ sudo java -classpath '.:classes:*:classes:/opt/pi4j/lib/*' org.apache.camel.component.raspberrypi.CamelMain 'timer://foo?fixedRate=true&repeatCount=600' 'raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true'
2015-03-31 19:53:51,863 [                          main] CamelMain                      INFO  main
2015-03-31 19:53:51,881 [                          main] CamelMain                      INFO  args[0] =timer://foo?fixedRate=true&repeatCount=600
2015-03-31 19:53:51,882 [                          main] CamelMain                      INFO  args[1] =raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true
2015-03-31 19:53:55,306 [                          main] DefaultCamelContext            INFO  Apache Camel 2.16-SNAPSHOT (CamelContext: camel-1) is starting
2015-03-31 19:53:55,329 [                          main] ManagedManagementStrategy      INFO  JMX is enabled
2015-03-31 19:54:00,329 [                          main] DefaultTypeConverter           INFO  Loaded 185 type converters
2015-03-31 19:54:04,078 [                          main] DefaultCamelContext            INFO  AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2015-03-31 19:54:04,080 [                          main] DefaultCamelContext            INFO  StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2015-03-31 19:54:04,462 [                          main] RaspberryPiEndpoint            DEBUG Endpoint[raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true]
2015-03-31 19:54:04,472 [                          main] RaspberryPiEndpoint            DEBUG  Pin Id > 2
2015-03-31 19:54:04,818 [                          main] RaspberryPiProducer            DEBUG Starting producer: Producer[raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true]
2015-03-31 19:54:05,811 [                          main] DefaultCamelContext            INFO  Route: raspberry-pi started and consuming from: Endpoint[timer://foo?fixedRate=true&repeatCount=600]
2015-03-31 19:54:05,872 [                          main] DefaultCamelContext            INFO  Total 1 routes, of which 1 is started.
2015-03-31 19:54:05,936 [                          main] DefaultCamelContext            INFO  Apache Camel 2.16-SNAPSHOT (CamelContext: camel-1) started in 10.612 seconds
2015-03-31 19:54:07,212 [mel-1) thread #0 - timer://foo] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-45066-1427831633096-0-2
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 19:54:06 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelTimerCounter=1, CamelTimerFiredTime=Tue Mar 31 19:54:06 UTC 2015, CamelTimerName=foo, CamelTimerPeriod=1000, CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-45066-1427831633096-0-1, firedTime=Tue Mar 31 19:54:06 UTC 2015}
, BodyType: null
, Body: [Body is null]
, Out: null:
]
2015-03-31 19:54:07,283 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            DEBUG Exchange[Message: [Body is null]]
2015-03-31 19:54:07,285 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 19:54:07,886 [mel-1) thread #0 - timer://foo] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-45066-1427831633096-0-4
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 19:54:07 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelTimerCounter=2, CamelTimerFiredTime=Tue Mar 31 19:54:07 UTC 2015, CamelTimerName=foo, CamelTimerPeriod=1000, CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-45066-1427831633096-0-3, firedTime=Tue Mar 31 19:54:07 UTC 2015}
, BodyType: null
, Body: [Body is null]
, Out: null:
]
2015-03-31 19:54:07,890 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            DEBUG Exchange[Message: [Body is null]]
2015-03-31 19:54:07,891 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 19:54:08,895 [mel-1) thread #0 - timer://foo] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-45066-1427831633096-0-6
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 19:54:08 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelTimerCounter=3, CamelTimerFiredTime=Tue Mar 31 19:54:08 UTC 2015, CamelTimerName=foo, CamelTimerPeriod=1000, CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-45066-1427831633096-0-5, firedTime=Tue Mar 31 19:54:08 UTC 2015}
, BodyType: null
, Body: [Body is null]
, Out: null:
]
2015-03-31 19:54:08,899 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            DEBUG Exchange[Message: [Body is null]]
2015-03-31 19:54:08,901 [mel-1) thread #0 - timer://foo] RaspberryPiProducer            TRACE action= TOGGLE

2nd Prototype : Button + LED

The second prototype is like the first one, but we remove timer endpoint to replace it with button for sending a message when pushed (HIGH state event*). When message is received, the RaspberryPi endpoint Producer toggles the LED via GPIO output pin.

The command line

$> ssh ${PI_USER}@${PI_HOST}
pi@rbpi> pi4j -r com.github.camellabs.component.raspberrypi.CamelMain  \
        "raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH" \
        "raspberrypi-gpio://2?action=TOGGLE"

Video Raspberry + LED

Video command line

/dev/out

pi@rbpi7 ~/camel $ pi4j -r  com.github.camellabs.component.raspberrypi.CamelMain  "raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH" "raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true"
+ sudo java -classpath '.:classes:*:classes:/opt/pi4j/lib/*' org.apache.camel.component.raspberrypi.CamelMain 'raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH' 'raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true'
2015-03-31 20:08:58,096 [                          main] CamelMain                      INFO  main
2015-03-31 20:08:58,112 [                          main] CamelMain                      INFO  args[0] =raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH
2015-03-31 20:08:58,115 [                          main] CamelMain                      INFO  args[1] =raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true
2015-03-31 20:09:01,619 [                          main] DefaultCamelContext            INFO  Apache Camel 2.16-SNAPSHOT (CamelContext: camel-1) is starting
2015-03-31 20:09:01,642 [                          main] ManagedManagementStrategy      INFO  JMX is enabled
2015-03-31 20:09:06,678 [                          main] DefaultTypeConverter           INFO  Loaded 185 type converters
2015-03-31 20:09:10,264 [                          main] DefaultCamelContext            INFO  AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
2015-03-31 20:09:10,266 [                          main] DefaultCamelContext            INFO  StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2015-03-31 20:09:10,416 [                          main] RaspberryPiEndpoint            DEBUG Endpoint[raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH]
2015-03-31 20:09:10,426 [                          main] RaspberryPiEndpoint            DEBUG  Pin Id > 1
2015-03-31 20:09:10,922 [                          main] RaspberryPiEndpoint            DEBUG Endpoint[raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true]
2015-03-31 20:09:10,924 [                          main] RaspberryPiEndpoint            DEBUG  Pin Id > 2
2015-03-31 20:09:10,998 [                          main] RaspberryPiProducer            DEBUG Starting producer: Producer[raspberrypi-gpio://2?action=TOGGLE&shutdownExport=true]
2015-03-31 20:09:11,990 [                          main] RaspberryPiConsumer            TRACE Start Listening GPIO 1
2015-03-31 20:09:11,997 [                          main] DefaultCamelContext            INFO  Route: raspberry-pi started and consuming from: Endpoint[raspberrypi-gpio://1?mode=DIGITAL_INPUT&state=HIGH]
2015-03-31 20:09:12,004 [                          main] DefaultCamelContext            INFO  Total 1 routes, of which 1 is started.
2015-03-31 20:09:12,123 [                          main] DefaultCamelContext            INFO  Apache Camel 2.16-SNAPSHOT (CamelContext: camel-1) started in 10.430 seconds
2015-03-31 20:09:15,483 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state LOW
2015-03-31 20:09:15,485 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG Consumer state HIGH != LOW Event state --> ignore Event
2015-03-31 20:09:15,667 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state HIGH
2015-03-31 20:09:16,089 [               pool-1-thread-1] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-46433-1427832539336-0-2
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 20:09:15 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-46433-1427832539336-0-1, CamelPi4j.pin="GPIO 1" <GPIO 1>, CamelPi4j.pinState=HIGH, CamelPi4j.pinType=DIGITAL_STATE_CHANGE}
, BodyType: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent
, Body: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]
, Out: null:
]
2015-03-31 20:09:16,152 [               pool-1-thread-1] RaspberryPiProducer            DEBUG Exchange[Message: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]]
2015-03-31 20:09:16,153 [               pool-1-thread-1] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 20:09:17,916 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state LOW
2015-03-31 20:09:17,918 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG Consumer state HIGH != LOW Event state --> ignore Event
2015-03-31 20:09:18,130 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state HIGH
2015-03-31 20:09:18,153 [               pool-1-thread-1] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-46433-1427832539336-0-4
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 20:09:18 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-46433-1427832539336-0-3, CamelPi4j.pin="GPIO 1" <GPIO 1>, CamelPi4j.pinState=HIGH, CamelPi4j.pinType=DIGITAL_STATE_CHANGE}
, BodyType: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent
, Body: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]
, Out: null:
]
2015-03-31 20:09:18,164 [               pool-1-thread-1] RaspberryPiProducer            DEBUG Exchange[Message: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]]
2015-03-31 20:09:18,179 [               pool-1-thread-1] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 20:09:20,447 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state LOW
2015-03-31 20:09:20,448 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG Consumer state HIGH != LOW Event state --> ignore Event
2015-03-31 20:09:20,672 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state HIGH
2015-03-31 20:09:20,694 [               pool-1-thread-1] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-46433-1427832539336-0-6
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 20:09:20 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-46433-1427832539336-0-5, CamelPi4j.pin="GPIO 1" <GPIO 1>, CamelPi4j.pinState=HIGH, CamelPi4j.pinType=DIGITAL_STATE_CHANGE}
, BodyType: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent
, Body: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]
, Out: null:
]
2015-03-31 20:09:20,703 [               pool-1-thread-1] RaspberryPiProducer            DEBUG Exchange[Message: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]]
2015-03-31 20:09:20,709 [               pool-1-thread-1] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 20:09:25,036 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state LOW
2015-03-31 20:09:25,038 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG Consumer state HIGH != LOW Event state --> ignore Event
2015-03-31 20:09:25,248 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state HIGH
2015-03-31 20:09:25,278 [               pool-1-thread-1] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-46433-1427832539336-0-8
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 20:09:25 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-46433-1427832539336-0-7, CamelPi4j.pin="GPIO 1" <GPIO 1>, CamelPi4j.pinState=HIGH, CamelPi4j.pinType=DIGITAL_STATE_CHANGE}
, BodyType: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent
, Body: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]
, Out: null:
]
2015-03-31 20:09:25,284 [               pool-1-thread-1] RaspberryPiProducer            DEBUG Exchange[Message: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]]
2015-03-31 20:09:25,285 [               pool-1-thread-1] RaspberryPiProducer            TRACE action= TOGGLE
2015-03-31 20:09:31,155 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state LOW
2015-03-31 20:09:31,157 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG Consumer state HIGH != LOW Event state --> ignore Event
2015-03-31 20:09:31,351 [               pool-1-thread-1] RaspberryPiConsumer            DEBUG GpioEvent pin GPIO 1, event DIGITAL_STATE_CHANGE, state HIGH
2015-03-31 20:09:31,365 [               pool-1-thread-1] raspberrypi                    INFO  Exchange[
, Id: ID-rbpi7-46433-1427832539336-0-10
, ExchangePattern: InOnly
, Properties: {CamelCreatedTimestamp=Tue Mar 31 20:09:31 UTC 2015, CamelMessageHistory=[DefaultMessageHistory[routeId=raspberry-pi, node=to1]], CamelToEndpoint=log://org.apache.camel.component.raspberrypi?multiline=true&showAll=true}
, Headers: {breadcrumbId=ID-rbpi7-46433-1427832539336-0-9, CamelPi4j.pin="GPIO 1" <GPIO 1>, CamelPi4j.pinState=HIGH, CamelPi4j.pinType=DIGITAL_STATE_CHANGE}
, BodyType: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent
, Body: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]
, Out: null:
]
2015-03-31 20:09:31,370 [               pool-1-thread-1] RaspberryPiProducer            DEBUG Exchange[Message: com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent[source=com.pi4j.io.gpio.RaspiGpioProvider@aa952c]]
2015-03-31 20:09:31,371 [               pool-1-thread-1] RaspberryPiProducer            TRACE action= TOGGLE

Conclusion

As you can see, integration Pi4j in Camel technology was really easy. With Camel technology you can communicate with lots of other devices or servers which use HTTP, AMQP, EMAIL, MQTT etc… Raspberry Pi can integrate and assemble severals electronics protocols like i2c or SPI (coming soon into camel-raspberrypi component). RaspberryPi and Apache Camel can really rock !!!