Getting Started

Development System Installation

Choose your preferred development environment for how to install the needed development software and toolchain(s):

You can also try Sming without installing anything locally. We have an interactive tutorial that can be run directly from your browser.


In addition to our online documentation, you can also generate a complete documentation locally by following these instructions.


The examples are a great way to learn the API and brush up your C/C++ knowledge.

Further documentation about the Sample Projects is available too.

Simple GPIO input/output

#define LED_PIN 2 // GPIO2
digitalWrite(LED_PIN, HIGH);

For a complete example take a look at the Basic Blink sample.

Start Serial communication

Serial.println("Hello Sming! Let's do smart things.");

Connect to WiFi

WifiStation.config("LOCAL-NETWORK", "123456789087"); // Put your SSID and password here

Read DHT22 sensor

#include <Libraries/DHTesp/DHTesp.h> // This is just a popular Arduino library!

#define DHT_PIN 0 // GPIO0
DHTesp dht;

void init()
  dht.setup(DHT_PIN, DHTesp::DHT22);

  float h = dht.getHumidity();
  float t = dht.getTemperature();

Take a look at the code of the DHT22 Humidity Sensor sample.

HTTP client

HttpClient thingSpeak;
thingSpeak.downloadString("" + String(sensorValue), onDataSent);

void onDataSent(HttpClient& client, bool successful)
  if (successful) {
  else {

For more examples take a look at the HTTP Client, HttpClient Instapush and ThingSpeak Http Client samples.

OTA application update

void doUpgrade()
  // need a clean object, otherwise if run before and failed will not run again
  if(otaUpdater) {
      delete otaUpdater;
  otaUpdater = new Ota::Network::HttpUpgrader();

  // select rom partition to flash
  auto part = ota.getNextBootPartition();

  // The content located on ROM_0_URL will be stored to the new partition
  otaUpdater->addItem(ROM_0_URL, part);

  // and/or set a callback (called on failure or success without switching requested)

  // start update

For a complete example take a look at the Basic Ota sample.

Embedded HTTP Web Server

server.paths.set("/", onIndex);
server.paths.set("/hello", onHello);

Serial.println("=== WEB SERVER STARTED ===");


void onIndex(HttpRequest &request, HttpResponse &response)
  TemplateFileStream *tmpl = new TemplateFileStream("index.html");
  auto &vars = tmpl->variables();
  vars["counter"] = String(counter);
  vars["IP"] = WifiStation.getIP().toString();
  vars["MAC"] = WifiStation.getMacAddress().toString();

void onFile(HttpRequest &request, HttpResponse &response)
  String file = request.getPath();
  if (file[0] == '/')
    file = file.substring(1);

  response.setCache(86400, true);

For more examples take a look at the HttpServer Config Network, Bootstrap Http Server, HttpServer Websockets and AJAX Http Server samples.

Email client

SmtpClient emailClient;


MailMessage* mail = new MailMessage();
mail->from = "developers@sming";
mail->to = "iot-developers@world";
mail->subject = "Greetings from Sming";

FileStream* file= new FileStream("image.png");



int onMailSent(SmtpClient& client, int code, char* status)
    MailMessage* mail = client.getCurrentMessage();


    if(client.countPending() == 0) {

    return 0;

See the SMTP Client sample for details.

Live Debugging

Applications based on Sming Framework that are flashed and running on an ESP8266 device can be debugged using interactive debuggers. In order to debug an application it has to be re-compiled with the ENABLE_GDB=1 directive. And then flashed on the device. As shown below:

cd $SMING_HOME/../samples/LiveDebug
make clean
make flashapp # <-- this will update only the application firmware.

Once the debuggable application is flashed on the device the developers have to run GDB. The easiest way to run the command-line GDB is to execute the following command:

make gdb

Developers using Eclipse CDT can have debugging sessions like the one below:

See Live Debug sample for details.