Xively Libraries

Introducing the Xively embedded IoT Client

Xively provides an embeded C client library for MQTT communiction that is the best in the market for use on all embedded devices.

The library is designed for security and scalability in resource-constrained device environments, where processing capacity and memory may be extremely limited. The Xively C client library incorporates lessons learned from building connected products on a variety of microcontroller families, and continues to evolve with new features including portability and remote administration.

  • Scales from No-OS to RTOS to enterprise operating systems
  • Can operate on a single thread and in non-blocking mode
  • Does not use any CPU power when waiting for operations, so power consumption can be minimized as required
  • Provides a thread-safe event queue and optional thread pool for callbacks
  • Uses coroutines to handle multiple publish and subscribe requests concurrently while returning control to the microcontroller stack for OS requirements
  • Provides an optional TLS stack including TLS1.2, modern cryptographic ciphers providing forward secrecy, and certificate verification with multiple roots of trust to maintain security in the event of CA compromise
  • Implements intelligent networking behavior to optimize device fleet reconnect performance
  • Protocol module supports MQTT for device/broker communication
  • Small footprint with modularity for size optimizations to particular microcontroller environments

Non-blocking communication

The Xively embedded IoT client is the only embedded client on the market that is capable of multitasking while remaining multi-threaded.

This means that unlike all other lightweight embedded clients that use MQTT (like PAHO's embedded MQTT client), it is capable of downloading file updates in the background without having to drop its current subscriptions, interrupt the download to publish a message, or handle user interaction from buttons and interfaces on the device.

Xively embedded IoT Client - Minimum system requirements

In additions to the many platforms that the client is already built for (Like the CC3200 from TI), our client can be ported to anything with the following system requirements:

  • Hardware requirements: Recommended minimum 32-bit processor, with an [ARM or MIPS] architecture
  • Security requirements: Secure TLS communication achieved using any of [Xively’s enhanced security implementation of WolfSSL, ARM’s mbed TLS, or TI’s implementation of WolfSSL]
  • Operating System requirements: Running either [No operating system, or the FreeRTOS embedded operating system]
  • Space requirements: The embedded client is around 26kB without a security layer, and our enhanced security implementation of WolfSSL comes in around 76 kB. Runtime heap requirements: 18.5 kB, runtime stack requirements: 10kB.

Device and server-side libraries

The following are the clients we recommend to clients go on your device to communicate with the Xively cloud.


Embedded C

Our C library is an extremely portable way to interface your embedded product with the Xively API, with support for POSIX as well as real-time operating systems. (See the library's documentation for the latest information).


Create real-time visualizations, interactive websites and GUIs in-browser that connect directly to Xively feeds. We recommend either the JavaScript library from PAHO, or mqtt.js (which facilitates websocket connections for browsers, and native for backends).


Create web app back-ends with Django, tackle research and scientific applications with tool kits like NumPy and Matplotlib, and connect Linux systems to Xively from supercomputers down to the Raspberry Pi and BeagleBone.


A ruby bunding against libMosquitto, which we recommend as the easiest way to get set up in a Ruby environment.


A Clojure Codec for MQTT. Provides a netty encoder and decoder for the MQTT protocol.

Mobile SDKs

Xively provides SDKs for iOS and Android. The SDKs provide classes and methods for interacting with the Xively platform, including MQTT messaging and platform API calls.

iOS (Objective-C)

Create native iPhone, iPad, iPod Touch and Mac OS applications that easily connect to Xively. Build interactive visualizations, dashboards, and bi-directional control into your products with an iOS or OSX app.

Android (Java)

A lightweight library to let you write native Android apps for you or your end user to monitor, control, and interact with Xively data. Conforms to Google's best practices.

Connecting your hardware

For guides on how to connect your device to Xively, see the following sections: