Getting Started

I've had quite a few people getting in contact asking for support with the initial setup and configuration of libxbee. As a result, I felt that it would be worthwhile writing this guide. libxbee is very straight forward, once you understand the principals involved.

Contents

  1. Is there anything I should know before I dive in?
  2. How do I get the source code?
  3. Can I download compiled binaries?
  4. How do I get it running on my OS?
  5. Which modules should I use?
  6. How should my modules be configured?
  7. Creating connections
  8. Using connections
  9. Advanced connections
  10. Running some samples

Other Resources

How do I get it running on my OS?

Linux Windows FreeBSD OS X

libxbee has not been developed for use on bare metal systems. Arduino and PIC are bare metal systems.

libxbee supports the most popular operating systems - Linux, Windows, FreeBSD and now OS X too! My operating system of choice is Linux, meaning that it will likely be the most stable and best supported. At the opposite end of the spectrum is OS X, which without the generosity of the community, I have no access to.

Setting up on Linux Linux

Compiling the library

I make use of drone.io to ensure that the latest code from the public repository compiles cleanly. drone.io is a Linux-based service, and I've configured it to keep a copy latest build. If you just want to get libxbee running quickly, you could look at using this build (it varies between x86 and x86_64). It can be found here: libxbee3 downloads on drone.io. Please feel free to do this, but I won't directly support or document this approach.

First of all you should ensure that you have the required tools to build the library. The following list contains the bare minimum.

  • GNU Make (make)
  • Toolchain (e.g: gcc, g++, ld, ar, objcopy)
    • libpthread and librt
  • optionally: man2html

Next, you'll need to get a copy of the source code. Please see this page for more information on how to get the source code.

Now that you have the source code, you can proceed with compiling libxbee. This happens in a few steps, but should generally be a painless operation.

  1. Run make configure. If this completes successfully, then you should see that a file (config.mk) has appeared in the base directory.
  2. Review config.mk. If you are cross-compiling, would like to strip the library down to the mode(s) that you want to use, or would like to enable more debugging information, then this is where you should do it.
    • The MODELIST variable will determine which modes are built into the library. If you leave it commented, then the default list containing all of the modes will be used.
    • If you are cross-compiling, then the CROSS_COMPILE variable should be set to your toolchain's prefix (see make/default/arm920t.mk for an example cross-compile configuration).
    • Additional debugging information can be enabled by uncommenting the XBEE_LOG_RX and XBEE_LOG_TX lines.
    • If you are not using hardware flow control (some interfaces don't provide it), then you should uncomment the XBEE_NO_RTSCTS line.
  3. Run make to build the library. This should complete without any issues.
  4. If you are building libxbee for this system, then you can also install it by running make install with any required priviledge escalation (e.g: sudo).