All Projects → SmingHub → Sming

SmingHub / Sming

Licence: lgpl-3.0
Sming - Open Source framework for high efficiency native ESP8266 development

Projects that are alternatives of or similar to Sming

Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+176.11%)
Mutual labels:  arduino, espressif, iot, esp8266, wifi, internet-of-things, embedded
Pjon
PJON (Padded Jittering Operative Network) is an experimental, arduino-compatible, multi-master, multi-media network protocol.
Stars: ✭ 2,615 (+118.46%)
Mutual labels:  arduino, iot, esp8266, internet-of-things, embedded
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (-80.53%)
Mutual labels:  arduino, espressif, iot, esp8266, wifi
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (-8.52%)
Mutual labels:  arduino, iot, esp8266, wifi, embedded
Platformio Atom Ide
PlatformIO IDE for Atom: The next generation integrated development environment for IoT
Stars: ✭ 475 (-60.32%)
Mutual labels:  arduino, microcontroller, iot, esp8266, embedded
Platformio Core
PlatformIO is a professional collaborative platform for embedded development 👽 A place where Developers and Teams have true Freedom! No more vendor lock-in!
Stars: ✭ 5,539 (+362.74%)
Mutual labels:  arduino, microcontroller, iot, esp8266, embedded
Easyntpclient
Library to read time from Network Time Protocol (NTP) servers.
Stars: ✭ 20 (-98.33%)
Mutual labels:  arduino, espressif, iot, esp8266, embedded
Waterius
Передача показаний воды по Wi-Fi. Watermeter Wi-Fi transmitter.
Stars: ✭ 295 (-75.36%)
Mutual labels:  arduino, iot, esp8266, internet-of-things, embedded
Blynk Server
Blynk is an Internet of Things Platform aimed to simplify building mobile and web applications for the Internet of Things. Easily connect 400+ hardware models like Arduino, ESP8266, ESP32, Raspberry Pi and similar MCUs and drag-n-drop IOT mobile apps for iOS and Android in 5 minutes
Stars: ✭ 8 (-99.33%)
Mutual labels:  arduino, iot, esp8266, internet-of-things
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (-85.88%)
Mutual labels:  arduino, iot, esp8266, wifi
Esp8266 Wifi Relay
simple sketch of using ESP8266WebServer to switch relays on GPIO pins. It serves a simple website with toggle buttons for each relay
Stars: ✭ 13 (-98.91%)
Mutual labels:  arduino, iot, esp8266, wifi
Make
📖📖📖📖📖 写给软件工程师看的硬件编程指南
Stars: ✭ 170 (-85.8%)
Mutual labels:  arduino, iot, esp8266, internet-of-things
Blinker Doc
blinker中文文档
Stars: ✭ 139 (-88.39%)
Mutual labels:  arduino, iot, esp8266, wifi
Platform Espressif8266
Espressif 8266: development platform for PlatformIO
Stars: ✭ 206 (-82.79%)
Mutual labels:  arduino, iot, esp8266, embedded
Awesome Esp
📶 A curated list of awesome ESP8266/32 projects and code
Stars: ✭ 212 (-82.29%)
Mutual labels:  arduino, espressif, iot, esp8266
Esphome Core
🚨 No longer used 🚨 - The C++ framework behind ESPHome
Stars: ✭ 545 (-54.47%)
Mutual labels:  arduino, iot, esp8266, internet-of-things
Swifitch
Swifitch is ESP8266 based relay board that could be used to turn any light or any wall socket into smart one!
Stars: ✭ 117 (-90.23%)
Mutual labels:  arduino, iot, esp8266, wifi
Mycontroller V1 Legacy
The Open Source Controller
Stars: ✭ 135 (-88.72%)
Mutual labels:  arduino, iot, esp8266, internet-of-things
Serial Studio
Multi-purpose serial data visualization & processing program
Stars: ✭ 1,168 (-2.42%)
Mutual labels:  arduino, microcontroller, iot, embedded
Arduinojson
📟 JSON library for Arduino and embedded C++. Simple and efficient.
Stars: ✭ 5,456 (+355.81%)
Mutual labels:  arduino, iot, esp8266, embedded

Sming

Sming is an asynchronous C/C++ framework with superb performance and multiple network features. Sming is open source and is tailored towards embedded devices. It supports multiple architectures as ESP8266 for example.

ESP8266 C++ development framework

Gitter (chat) Backers Sponsors Download Build Codacy Badge Coverity Badge

If you like Sming, give it a star, or fork it and contribute!

GitHub stars GitHub forks

Table of Contents

Please note Version 4 documentation is at sming.readthedocs.io.

Summary

  • Superb performance and memory usage (Sming compiles to native firmware!).
  • Fast and user friendly development.
  • Simple yet powerful hardware API wrappers.
  • Compatible with standard Arduino Libraries - use any popular hardware in few lines of code.
  • Built-in file system: spiffs.
  • Built-in powerful wireless modules.
  • Powerful asynchronous (async) network stack.
    • Async TCP and UDP stack based on LWIP.
    • With clients supporting: HTTP, MQTT, WebSockets and SMTP.
    • And servers for: DNS, FTP, HTTP(+ WebSockets), Telnet.
    • With SSL support for all network clients and servers. Based on axTLS and BearSSL.
    • Out of the box support for OTA over HTTPS.
  • ESP8266 specific features.
    • Integrated boot loader rboot with support for 1MB ROMs, OTA firmware updating and ROM switching.
    • Crash handlers for analyzing/handling system restarts due to fatal errors or WDT resets.
    • PWM support based on Stefan Bruens PWM.
    • Optional custom heap allocation based on Umm Malloc.
    • Based on Espressif NONOS SDK. Officially suppored NON SDK version is >= 3.0.1.
    • Support for a thin No-Wifi-SDK. Helpful when a project does not require WiFi (or networking) and reduces code size and memory usage signficantly.
  • Linux/Windows features
    • Sming has a host emulator that allows libraries and sample applications to be compiled on a Linux/Windows host system and be tested before uploading them to an actual microcontroller.

Compatibility

GCC compiler >= 8

Your GCC compiler should be version 8 or newer! See the different architectures for details. Newer compilers

  • contain bugfixes
  • produce smaller and better code
  • have features which facilitate code quality, ease of use, etc.

Architecture: ESP8266

OS/SDK Linux Mac OS X Windows FreeBSD-current
UDK (v1.5)     n/a   n/a         Build status           n/a        
esp-open-sdk (v1.5.x **, v2.0.0 **, v3.0.x) ☀️   ☀️ n/a ☀️
  • OS = Operating System.
  • SDK = Software Development Kit.
  • n/a = The selected SDK is not available on that OS.
  • ** = not supported officially. Samples and library should compile and run but we recommend using version >= 3.0.3.

Architecture: Host

Linux and Windows OSes with gcc compilers are supported. Clang is NOT supported.

Architecture: ESP32 (Experimental)

Supported SDK: ESP-IDF v4.1

Releases

Stable

  • Sming V4.2.0 - great new features, performance and stability improvements.

Long Term Support (LTS)

  • Sming V4.2.x is our LTS version which will be supported until the end of 2021.

Development

To follow the latest development you will need to clone our develop branch:

git clone https://github.com/SmingHub/Sming.git

Getting Started

Sming supports multiple architectures. Choose the architecture of your choice 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.

Documentation

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

Examples

The examples are a great way to learn the API and brush up your C/C++ knowledge. Once you have completed the installation of the development tools, you can get the latest source code.

git clone https://github.com/SmingHub/Sming.git

And check some of the examples.

Basic Blink

Blinking is something like the "Hello World" example for the embedded world. You can check it using the commands below:

cd Sming/samples
cd Basic_Blink
make # -- compiles the application
make flash # -- tries to upload the application to your ESP8266 device.

More information at Wiki Examples page.

Simple GPIO Input/Output

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

For a complete example take a look at the Basic_Blink sample.

Start Serial Communication

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

Connect to WiFi

WifiStation.enable(true);
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 Humidity_DHT22 sample.

HTTP Client

HttpClient thingSpeak;
...
thingSpeak.downloadString("http://api.thingspeak.com/update?key=XXXXXXX&field1=" + String(sensorValue), onDataSent);

void onDataSent(HttpClient& client, bool successful)
{
  if (successful) {
    Serial.println("Successful!");
  }
  else {
    Serial.println("Failed");
  }
}

For more examples take a look at the HttpClient, HttpClient_Instapush and HttpClient_ThingSpeak samples.

OTA Application Update Based on rBoot

void OtaUpdate()
{
  uint8 slot;
  rboot_config bootconf;

  Serial.println("Updating...");

  // need a clean object, otherwise if run before and failed will not run again
  if (otaUpdater) {
    delete otaUpdater;
  }

  otaUpdater = new RbootHttpUpdater();

  // select rom slot to flash
  bootconf = rboot_get_config();
  slot = bootconf.current_rom;
  if (slot == 0) {
    slot = 1;
  }
  else {
    slot = 0;
  }

  // flash rom to position indicated in the rBoot config rom table
  otaUpdater->addItem(bootconf.roms[slot], ROM_0_URL);

  // and/or set a callback (called on failure or success without switching requested)
  otaUpdater->setCallback(OtaUpdate_CallBack);

  // start update
  otaUpdater->start();
}

For a complete example take a look at the Basic_rBoot sample.

HTTP Server

server.listen(80);
server.paths.set("/", onIndex);
server.paths.set("/hello", onHello);
server.paths.setDefault(onFile);

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

...

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.getMAC();
  response.sendTemplate(tmpl);
}

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

  response.setCache(86400, true);
  response.sendFile(file);
}

For more examples take a look at the HttpServer_ConfigNetwork, HttpServer_Bootstrap, HttpServer_WebSockets and HttpServer_AJAX samples.

Email Client

SmtpClient emailClient;

emailClient.connect(Url("smtp://user:[email protected]"));

MailMessage* mail = new MailMessage();
mail->from = "[email protected]";
mail->to = "[email protected]";
mail->subject = "Greetings from Sming";
mail->setBody("Hello");

FileStream* file= new FileStream("image.png");
mail->addAttachment(file);

emailClient.onMessageSent(onMailSent);
emailClient.send(mail);

...

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

    ...

    if(!client.countPending()) {
        client.quit();
    }

    return 0;
}

See the SmtpClient 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 ENABLE_GDB=1
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: Debugging Session in Eclipse CDT

See LiveDebug sample for details.

Contribute

You can contribute to Sming by

  • Providing Pull Requests with new features, bug fixes, new ideas, etc. See Contributing for details.
  • Testing our latest source code and reporting issues.
  • Supporting us financially to acquire hardware for testing and implementing or out of gratitude

Financial contributions

We welcome financial contributions in full transparency on our open collective page. They help us improve the project and the community around it. If you would like to support us you can become a backer or a sponsor.

In addition to that anyone who is helping this project can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.

Backers and sponsors

Thank you to all the people who have backed Sming

or sponsored it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].