Skip to content
SMQ is an easy to use IoT pub/sub protocol designed and optimized for embedded systems
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Update m2m-led.c Feb 27, 2019
src Cygwin fix Mar 9, 2019
Makefile Adding build files Dec 6, 2018

SMQ C Client Library

SMQ C client library for microcontrollers. The library includes porting layers for many RTOS environments, including bare metal.

SMQ, based on the publish - subscribe pattern, provides features similar to other pub/sub protocols such as MQTT. However, SMQ extends the pub/sub pattern with additional features such as one-to-one messaging and sender's address, features typically required in device management.

See the SMQ home page for details

TL;DR; IoT Quickstart

Setup your own IoT solution as follows:

  1. Download and compile the example code "as is". The example, when run, connects to the online test broker.
  2. Familiarize yourself with how the example works.
  3. Follow the Setting up a Low Cost SMQ IoT Broker for how to setup your own IoT solution.
  4. Modify the example code (examples/m2m-led.c) and change the domain URL (SMQ_DOMAIN). The URL should be set to your own IoT server.


The source code is released under the Eclipse Public License - V 2.0:

You may compile a Program licensed under the EPL without modification and commercially license the result in accordance with the terms of the EPL.

This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License, version 2.



The build includes the SMQ library and a LED demonstration program. The LED demonstration program connects to the online public test broker. Initially, you may want to test the LED example by compiling and running the example code using the ready-to-use online C compiler setup. See the following video for details on using the online compiler.

Compile SMQ

Build instructions for Windows, Linux, and Mac

The VcMake directory contains Visual Studio build files. The included Makefile compiles the library and the example program on any Linux/Mac computer. If you are using Windows and if you do not have Visual Studio installed, you may download the batch file DownloadAndCompileSMQ.bat. This batch file downloads the SMQ C code from GitHub, downloads the Tiny C Compiler (TCC), compiles the SMQ code using TCC, and starts the SMQ LED example.

Build instructions for embedded systems

The example code m2m-led.c requires porting to your embedded board's LED(s). See the tutorial Interfacing LED Demo Programs to Hardware for details.

See the src/arch directory for cross compiling details.

Build instructions for ESP8266

Download the ESP8266 IDE. The IDE includes the SMQ C client and a pre-configured esp-open-rtos bundled with an easy to use web-based C source code IDE.

You can’t perform that action at this time.