Arduino and Xbee Thing

First off I am new to Web Things … so forgive me if the question is dumb!

I have an arduino with a ultrasonic sensor attached and an XBee to communicate with the Gateway … I dont want to use Wifi because this sensor is going to be battery powered and outside.

I have seen the example https://github.com/mozilla-iot/webthing-arduino of using Wifi.

Are there any example out there where the communication is using the XBee on the Arduino and the controller XBee on my Raspberry Pi Gateway.

Yours hopefully

Calum

There aren’t any examples that I’m aware of. Although you could setup 2 XBee’s as a transparent serial cable.

If you’re using XBee Series 1 (See https://www.sparkfun.com/pages/xbee_guide for a discussion of the different variations) then you put two XBee’s in transparent mode https://www.digi.com/resources/documentation/digidocs/90001526/tasks/t_configure_2_devices_transparent_mode.htm and they act like a wireless serial cable. Then you can use any of the regular examples for arduino which communicate over serial.

The problem with that approach is that I have four Arduinos I want to register with the Gateway, and I want to keep to a standards-based pattern.

I might have to go look at the Gateway source code and see if I can figure out what it is expecting to receive from a Zigbee device.

You could probably also use one the XBee zigbee devices configured as an end-device. But I’ve never done that and I’m not sure how much work would be needed on the Arduino side to make that happen.

I am also considering setting up an arduino thing via Xbee, but without a guide and being new to this I guess I’ll just have to start with a wifi one. I’ll be interested to know when there is a guide available.