Posts

Build responsibly. A new case from an old bottle.

Xbee module case

Xbee module case


My Xbee sensor project is picking up steam. The PIC part of API module is finished, the host part is close to completion. Since Python is new to me, the development is not as fast as I would like it to be, but I’m getting there. In the meantime, I started thinking about converting my coordinator setup, consisting of bare USB board with Xbee module, to something more permanent and professionally looking.

Picture on the right shows the materials. The idea is very simple: drill a 1/4″ hole in the cap, fasten Xbee to the cap using RP-SMA connector, cut another hole in the side of a bottle for the USB cable and screw things together. The whole project was completed in 15 minutes. The all-new Zigbee coordinator is waiting.

Oleg.

Playing Xbee. Part 4 – API.

Setting serial speed on Xbee module

Setting serial speed on Xbee module


Xbee module supports two modes of operation – transparent mode and API mode. To create simple point-to-point links, Xbee works nicely in transparent mode without much coding. However, if your goal is to build a network consisting of more than two devices, AT mode becomes too difficult to bear. You will spend almost all the time switching in and out of command mode, wasting time and draining batteries in the process. On the other hand, in API mode commands and data travel in specially formatted frames and no switching is necessary. Another advantage of API mode is that serial speed on transmitters doesn’t have to match – one can be configured for 115200bps, another for 2400bps, third left with default 9600bps. There is another nice feature called remote command; you can remotely request the state of Xbee module pins, for example, or change an output pin level. It means that for simple measuring and control applications no MCU is even necessary at the sensor.

API mode requires re-flashing module firmware and some extra coding on both sides of the link. I started with upgrading the firmware. Picture on the right shows X-CTU screen with serial speed drop-down expanded – along with loading API firmware I’m changing the speed of coordinator Xbee to 115200.


Continue reading Playing Xbee. Part 4 – API.