In-Depth History of libxbee

libxbee started as a little library to help me tinker with Digi's XBee Series 1 radio modules on a Linux PC. Over time it grew, and now (roughly 10 years later) it provides full support for many of the available XBee Series. libxbee has also been ported to Windows, and is also compatible with FreeBSD and OS X.

libxbee v1

As libxbee v1 reached its intended potential with support for only Series 1 modules, I started to recieve requests for better support of the other modules avaliable. Having just cobbled the library together, the internal design of libxbee v1 didn't lend itself at all well to being extended with this extra support, and as a result only simple support was added for Series 2 data Tx/Rx, and transmission status. I used libxbee in this incarnation as a small part of my final year project at uni.

I also developed libxbeed alongside. It consisted of a daemon that shared the XBee's interface over the network, and a library that could use it.

At this point the source of libxbee was all contained within a single 75kB file - api.c - which is basically written as a pair of massive if statements to select the various packet types (see here and here). Scary, I know.

libxbee v2

Having completed my course at uni, I decided that it was time to re-write libxbee, along with some of the home automation systems I had developed alongside it. The active development lifespan of libxbee v2 was short - about 3 months.

I rushed in and started bashing the keyboard, making wild decisions such as "It needs decent support for plugins" and "It needs to have built-in network sharing, like what libxbeed does" without giving much thought to how useful they would actually be, or even how I would implement these features.

I quickly became tangled up, and internal functionality became too specific to a given XBee Series or Operating System. The network server was implemented with a fair amount of success, but the client would have required a significant re-write to implement. As a result of this, I decided to stop work, sit back and plan - a little at least.

libxbee v3

libxbee v3 is beautiful (if I do say so myself). The code base is as close as you can get to Object Oriented within C, and as a result is wonderful to work with. I took many things that I experimented with and learnt from libxbee v2, and did them better in libxbee v3. I have been careful to keep abstraction to a reasonable maximum, while also trying to keep it fast.

Support has been broken into 'modes'. On calling xbee_setup(), you specify which mode you want libxbee to run in. From this point on, almost the only generic parts of libxbee are the fact that you have connections, and they can send and recieve packets.

libxbee v3 has full support for many of the modules available, along with a built-in network server and client. Man page documentation has been written for all of the user-accessible functions, and an HTML version can be found here: I also hope to write nicely formatted HTML documentation that will be displayed on this site.