Download SMQ Source Code and Libraries


We provide several SMQ source code implementations for various programming languages.

Supported languages:
C and C++, Java/Android, JavaScript, and Lua.

C Code

The C code is designed for microcontrollers and can be used by RTOS and bare-metal (super-loop) systems. The code can also be used on HLOSs such as Windows and Linux. The following porting layers are included in the source code: FreeRTOS+TCP, Microchip Harmony, lwIP-netconn, lwIP-raw, uIP, MQX, ThreadX/NetX, POSIX (Linux), Windows.

Downloads:

Check out the SharkSSL IDE, which includes the secure SMQ client SharkMQ. A simple button-click compiles the C source code and uploads the code to an ESP32. See the tutorial Beginner's Guide to Secure IoT Programming for details.

Compiling and running the SMQ stack and example C code

Online C Compiler:

Initially, you may test our LED example by compiling and running the example code using our online C compiler setup. Run the example as follows:

  1. Navigate to the online SMQ LED page and keep the browser window open.
  2. Navigate to the online C compiler and click the run/compile button (you do not need to sign up).
  3. When the C code runs on the online server, notice the new IP address on the SMQ LED page.
  4. Click the new IP address and control the compiled C code.
  5. You should see printouts in the compiled code's console when you click the LED buttons on the SMQ LED page.

How to run the LED example on your own computer/device:

  1. Download the source code and follow the build instructions provided on GitHub.
  2. Start the LED executable. When the LED example is running, navigate to our public SMQ broker. You should see your IP address in the left tab. Click this IP address to control your simulated device running on your computer.
  3. You may change the broker URL in the LED example code and connect to your own broker. The Mako Server's tutorials include a ready-to-use broker.

Lua Code

The tutorial Your First IoT Project offers a practical and easy-to-follow introduction to using the SMQ Lua client library with an ESP32 microcontroller. It guides you through writing a Lua program that effectively uses SMQ for communication.

Java Code

The Java source code library (JavaSMQ) for standard Java and Android is available on GitHub. We also provide two source code examples, one designed for the Swing UI and one for the Android app. Both examples include the JavaSMQ stack and both examples replicate the functionality found in the JavaScript SMQ LED demo.

Download:

JavaScript Code

SMQ.js is included in the Barracuda App Server and in the Mako Server's resource file mako.zip. You can find SMQ.js in mako.zip/smq.js. The LED demo source code is included in the Mako Server's tutorials, in IoT.zip/smq/index.html.

Broker (Server)

The broker is implemented in Lua using Cosockets and an instance of the broker runs on the Barracuda App Server's Lua runtime engine. The broker is included in the Mako Server's resource file mako.zip. The SMQ broker is in the source file mako.zip/.lua/smqbroker.lua. The broker setup code used by the LED demo is included in the Mako Server's tutorials, in IoT.zip/.preload and in IoT.zip/smq.lsp.

SMQ Tutorials

Tutorials for how to use SMQ, including a tutorial on the SMQ LED demo, can be found at the Mako Server Website.