Apache Camel or Spring Integration

46 views
Skip to first unread message

martin

unread,
Feb 6, 2012, 6:04:58 PM2/6/12
to xbee-api
Hi,

has anyone tried to use the xbee-api with a Java integration framework
like Apache Camel or Spring Integration?

Regards
Martin

Matt Pinner

unread,
Feb 6, 2012, 7:33:29 PM2/6/12
to xbee...@googlegroups.com
i cannot imagine why it wouldn't work.
--matt

> --
> You received this message because you are subscribed to the Google Groups "xbee-api" group.
> To post to this group, send email to xbee...@googlegroups.com.
> To unsubscribe from this group, send email to xbee-api+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xbee-api?hl=en.
>

Benjamin Zaitlen

unread,
Feb 6, 2012, 8:05:17 PM2/6/12
to xbee...@googlegroups.com
Andrew Rapp added support as a test in version 0.2.1
(http://xbee-arduino.googlecode.com/files/xbee-arduino-0.2.1.zip).
I've used the library and have had success but seems to not have
continued implementing SoftSerial support in later version. (Note:
0.2.1 is not compatible with Arduino 1.0)

If you do decide to use it this should help you get started:
NewSoftSerial nss(ssRX, ssTX);

void setup() {
xbee.begin(9600);
nss.begin(9600);
xbee.setNss(nss);
}

Now all XBee communication will be issued through ssTx and ssRx.

Hope that helps,
--Ben

Benjamin Zaitlen

unread,
Feb 6, 2012, 8:06:26 PM2/6/12
to xbee...@googlegroups.com
Sorry, wrong topic!.

--Ben

andrew

unread,
Feb 8, 2012, 2:12:58 PM2/8/12
to xbee-api
Hi Martin,

What problem are you trying to solve? I have an xmpp project that
allows remote communication with an XBee radio. It also works over
firewalls (no need to forward ports).

Andrew

Martin Jarvis

unread,
Feb 8, 2012, 4:34:31 PM2/8/12
to xbee...@googlegroups.com
Andrew,

I am envisaging having a number of sensors connected over Zigbee. Depending on data received from one or more sensors, I want various actions to happen. 

For my first attempt I used your xbee-api with an MQTT message broker. Any data received by the zigbee coordinator was published to a suitable topic on MQTT, depending on which device sent the data. Next step was to write some code to subscribe to the relevant topic and then process and act on the message. That way I decouple the message collection from the message processing. However, I soon realised that the more I go down this architectural path the more "plumbing" code I was starting to write. 

I did a bit of googling and found that this problem has already been solved, and by cleverer people than me.  Spring Integration and Apache Camel are both frameworks for defining loosely coupled integration processes. Both also provide a large library of pre-built connectors (known as "Components" in Camel) that make it easy to interface with all manner of external system. 

I have made some pretty good progress with Apache Camel, I have built a basic XBee Component for Camel that collects data from the Zigbee Coordinator using your xbee-api. I need to do a bit of refactoring and a lot more testing, but I'll be happy to share this component when I'm done.

Have you considered publishing your API to the central Maven repository? Both these frameworks rely heavily on Maven and it would certainly make using xbee-api with them much easier. 

Regards

Martin




Reply all
Reply to author
Forward
0 new messages