Raspberry Pi (raspberrypi) Component

Available as of Camel 2.16+ on Camel-extra-repository (in progress, see code source paragraph below)

The rbpi: component provides Raspberry Pi based endpoints for consuming GPIO Event. It can generates GPIO output event
The component uses the pi4j library.

Maven users will need to add the following dependency to their pom.xml for this component:

 

 

 

URI format

The URI format to configure and manage PIN

 

Raspberry Option

 

NameTypeRequiredEnum ValuesDescription
idjava.lang.Stringtrue To configure the pin id (Pi4j index)
statecom.pi4j.io.gpio.PinState LOW
HIGH

To configure pin state :

if DIGITAL_INPUT then it is the event trigger state

if DIGITAL_OUTPUT then started state

modecom.pi4j.io.gpio.PinModetrue

DIGITAL_OUTPUT

DIGITAL_INPUT

PWM_OUTPUT

ANALOG_OUTPUT

ANALOG_INPUT

To configure GPIO pin mode

Check Pi4j library for more details

actionorg.apache.camel.component.raspberrypi.PinAction 

TOGGLE

BUZZ

HIGH

LOW

HEADER

Default : use Body to if Action for ouput Pin (TOGGLE, BUZZ, HIGH, LOW for digital only) (HEADER digital and analog TODO)
valuedouble 0

To configure the started value

shutdownExportboolean trueTo configure the pin shutdown behavior
shutdownStatecom.pi4j.io.gpio.PinState LOW
HIGH
To configure the pin state value before exit
shutdownResistancecom.pi4j.io.gpio.PinPullResistance OFF
PULL_DOWN
PULL_UP
To configure the pin resistance before exit
pullResistancecom.pi4j.io.gpio.PinPullResistance OFF
PULL_DOWN
PULL_UP

To configure the input pull resistance,

Avoid strange value for info http://en.wikipedia.org/wiki/Pull-up_resistor

typeorg.apache.camel.component.raspberrypi.RaspberryTypetrue

pin

i2c

spi

serial

pin : GPIO pi4j and wiringpi mapping,

i2c, spi, serial not yet available

 

Example :

Simple button w/ LED mode

Plug an button on GPIO 1, and LED on GPIO 2 (with Resistor) and code a route like this

Source Code

Camel-raspberrypi component uses pi4j and wiringpi. These librairies are LGPL licensed and cannot be include to the official camel repository.

Code source is available at camel-iot-labs repository

 

 

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram