Structure-MQTT-device (community library)


Name Value
Name Structure-MQTT-device
Version 0.0.2
Installs 770
License MIT
Author Charif Mahmoudi
Download .tar.gz
All Versions 0.0.2, 0.0.1

Enabling an MQTT comunicating object dedicated to the integration to Structure platform broker -

Example Build Testing

Device OS Version:

This table is generated from an automated build. Success only indicates that the code compiled successfully.

Library Read Me

This content is provided by the library maintainer and has not been validated or approved.


A Particle Builder library for integration with Losant


This library serves as a wrapper for the MQTT library for the integration with Losant Broker. It offers simplified methodes and an Device object to comunicate with Losant

Getting started

A getting started tutorial is availible at

This getting started tutorial describes all the steps needed to integrates the library in your project.


This library depends on the SPARKJSON library that is availible as community library in the Particle Builder v2 update Library is added as depecdency using the new particle Libraries v2 feature


The getstructure-particle library offers multiples cool features:

The callback method support directly JSon object. so you do not have to deal with boring char * and convert them by yourself.

// Callback for Structure subscriptions.
// Receive Your JsonObject from
void myCallback(JsonObject& command) {
// If the command's name is "toggle", flip the LED.
if(String(command["name"].asString()).equals(String("toggle"))) {
ledValue = !ledValue;
digitalWrite(LED, ledValue ? HIGH : LOW);

Device Object that associate a photon to the Device at Structure

Is a wrapper for all the MQTT communication. It provides simply an object GetStructure::Device that you deal with. and it represents the devices on Structure application.

// The initialization of your device

Just create your Json object and it send it for your to Structure application.

StaticJsonBuffer<100> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
//Publish directly your JsonObject !!!

Simplified Json-based push methode and callback


Thanks to Brandon Cannaday @TheReddest for his Blog Article

Thanks to team for their free kits :D

Questions ?

Send me a tweet to @CharifUs :)


SparkJson missing
Structure-MQTT-device/Structure-MQTT-device.h:38:33: fatal error: SparkJson/SparkJson.h: No such file or directory
#include "SparkJson/SparkJson.h"

You need to add SPARKJSON library also from the community libraries to your project.

Browse Library Files