{"id":13418600,"url":"https://github.com/SmingHub/Sming","last_synced_at":"2025-03-15T03:31:29.401Z","repository":{"id":28749227,"uuid":"32271212","full_name":"SmingHub/Sming","owner":"SmingHub","description":"Sming - powerful  open source framework simplifying the creation of embedded C++ applications.","archived":false,"fork":false,"pushed_at":"2024-10-28T10:15:17.000Z","size":98656,"stargazers_count":1479,"open_issues_count":85,"forks_count":348,"subscribers_count":111,"default_branch":"develop","last_synced_at":"2024-10-29T17:12:07.170Z","etag":null,"topics":["arduino","async","c-plus-plus","embedded","esp32","esp8266","espressif","framework","internet-of-things","iot","microcontroller","rboot","rp2040","sming","ssl-support","upnp","wifi"],"latest_commit_sha":null,"homepage":"https://sming.readthedocs.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmingHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":"Sming","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2015-03-15T16:36:22.000Z","updated_at":"2024-10-28T10:15:22.000Z","dependencies_parsed_at":"2023-02-18T15:31:04.905Z","dependency_job_id":"2dd72d60-6fb9-4c8e-aa33-420d7df5565d","html_url":"https://github.com/SmingHub/Sming","commit_stats":{"total_commits":1940,"total_committers":110,"mean_commits":"17.636363636363637","dds":0.6355670103092783,"last_synced_commit":"c34d7472b43f5c8cd45320da1ecbe7e3d3860d99"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmingHub%2FSming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmingHub%2FSming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmingHub%2FSming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmingHub%2FSming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmingHub","download_url":"https://codeload.github.com/SmingHub/Sming/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243672751,"owners_count":20328812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","async","c-plus-plus","embedded","esp32","esp8266","espressif","framework","internet-of-things","iot","microcontroller","rboot","rp2040","sming","ssl-support","upnp","wifi"],"created_at":"2024-07-30T22:01:04.332Z","updated_at":"2025-03-15T03:31:29.391Z","avatar_url":"https://github.com/SmingHub.png","language":"C++","readme":"# Sming\n\nSming is an asynchronous embedded C++ framework with superb performance and multiple network features.\nSming is [open source](LICENSE), modular and supports [multiple architectures](https://sming.readthedocs.io/en/latest/features.html) including ESP8266, ESP32 and Raspberry Pi Pico (both RP2040 and RP2350).\n\n[![Examples](https://github.com/SmingHub/Sming/wiki/images/small/combine.png)](https://github.com/SmingHub/Sming/wiki/examples)\n\n[![Gitter (chat)](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/SmingHub/Sming?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Backers](https://opencollective.com/Sming/backers/badge.svg)](#financial-contributions)\n[![Sponsors](https://opencollective.com/Sming/sponsors/badge.svg)](#financial-contributions)\n[![Download](https://img.shields.io/badge/download-~1.7M-orange.svg)](https://github.com/SmingHub/Sming/releases/latest)\n[![Build](https://github.com/SmingHub/Sming/actions/workflows/ci.yml/badge.svg)](https://github.com/SmingHub/Sming/actions/workflows/ci.yml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/23ff16f8d550440787125b0d25ba7ada)](https://www.codacy.com/gh/SmingHub/Sming/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=SmingHub/Sming\u0026amp;utm_campaign=Badge_Grade)\n[![Coverity Badge](https://img.shields.io/coverity/scan/12007.svg)](https://scan.coverity.com/projects/sminghub-sming)\n\nIf you like **Sming**, give it a star, or fork it and [contribute](#contribute)!\n\n[![GitHub stars](https://img.shields.io/github/stars/SmingHub/Sming.svg?style=social\u0026label=Star)](https://github.com/SmingHub/Sming/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/SmingHub/Sming.svg?style=social\u0026label=Fork)](https://github.com/SmingHub/Sming/network)\n\n## Getting Started\n\nSming supports multiple architectures and has a [plethora of features](https://sming.readthedocs.io/en/latest/index.html#summary).\nChoose the architecture of your choice to [install the needed development software](https://sming.readthedocs.io/en/latest/getting-started).\n\nYou can also try Sming without installing anything locally. We have an [interactive tutorial](https://killercoda.com/slaff/scenario/sming-host-emulator) that can be run directly from your browser.\n\n## Documentation\n\nThe purpose of Sming is to simplify the creation of embedded applications. The documentation will help you get started in no time.\n\n- [**Documentation for version 6.0.0**](https://sming.readthedocs.io/en/stable) - current stable version.\n- [Documentation for latest](https://sming.readthedocs.io/en/latest) - development version.\n\n## Releases\n\n### Stable\n\n- [Sming V6.0.0](https://github.com/SmingHub/Sming/releases/tag/6.0.0) - great new features, performance and stability improvements.\n\n### Development\n\nTo follow the latest development you will need to clone our `develop` branch:\n\n```bash\ngit clone https://github.com/SmingHub/Sming.git\n```\n\n\n## Examples\n\nThe examples are a great way to learn the API and brush up your C++ knowledge.\nOnce you have completed the installation of the development tools, you can get the latest source code:\n\n```bash\ngit clone https://github.com/SmingHub/Sming.git\n```\n\nAnd check some of the examples:\n\n- [Basic Blink](#basic-blink)\n- [Simple GPIO input/output](#simple-gpio-inputoutput)\n- [Start Serial communication](#start-serial-communication)\n- [Connect to WiFi](#connect-to-wifi)\n- [Read DHT22 sensor](#read-dht22-sensor)\n- [HTTP Client](#http-client)\n- [OTA Application Update](#ota-application-update)\n- [HTTP Server](#http-server)\n- [Email Client](#email-client)\n\n### Basic Blink\n\nBlinking is something like the \"Hello World\" example for the embedded world. You can check it using the commands below:\n\n```bash\ncd Sming/samples\ncd Basic_Blink\nmake # -- compiles the application\nmake flash # -- tries to upload the application to your ESP8266 device.\n```\n\nMore information at **[Sample Projects](https://sming.readthedocs.io/en/latest/samples.html)** page.\n\n### Simple GPIO Input/Output\n\n```c++\n#define LED_PIN 2 // GPIO2\n...\npinMode(LED_PIN, OUTPUT);\ndigitalWrite(LED_PIN, HIGH);\n```\n\nFor a complete example take a look at the [Basic_Blink](samples/Basic_Blink/app/application.cpp) sample.\n\n### Start Serial Communication\n\n```c++\nSerial.begin(9600);\nSerial.println(\"Hello Sming! Let's do smart things.\");\n```\n\n### Connect to WiFi\n\n```c++\nWifiStation.enable(true);\nWifiStation.config(\"LOCAL-NETWORK\", \"123456789087\"); // Put your SSID and password here\n```\n\n### Read DHT22 sensor\n\n```c++\n#include \u003cLibraries/DHTesp/DHTesp.h\u003e // This is just a popular Arduino library!\n\n#define DHT_PIN 0 // GPIO0\nDHTesp dht;\n\nvoid init()\n{\n  dht.setup(DHT_PIN, DHTesp::DHT22);\n\n  float h = dht.getHumidity();\n  float t = dht.getTemperature();\n}\n```\n\nTake a look at the code of the [Humidity_DHT22](samples/Humidity_DHT22/app/application.cpp) sample.\n\n### HTTP Client\n\n```c++\nHttpClient thingSpeak;\n...\nthingSpeak.downloadString(\"http://api.thingspeak.com/update?key=XXXXXXX\u0026field1=\" + String(sensorValue), onDataSent);\n\nvoid onDataSent(HttpClient\u0026 client, bool successful)\n{\n  if (successful) {\n    Serial.println(\"Successful!\");\n  }\n  else {\n    Serial.println(\"Failed\");\n  }\n}\n```\n\nFor more examples take a look at the [HttpClient](samples/HttpClient/app/application.cpp), [HttpClient_Instapush](samples/HttpClient_Instapush/app/application.cpp) and [HttpClient_ThingSpeak](samples/HttpClient_ThingSpeak/app/application.cpp) samples.\n\n### OTA Application Update\n\n```c++\nvoid doUpgrade()\n{\n  // need a clean object, otherwise if run before and failed will not run again\n  if(otaUpdater) {\n      delete otaUpdater;\n  }\n  otaUpdater = new Ota::Network::HttpUpgrader();\n\n  // select rom partition to flash\n  auto part = ota.getNextBootPartition();\n\n  // The content located on ROM_0_URL will be stored to the new partition\n  otaUpdater-\u003eaddItem(ROM_0_URL, part);\n\n  // and/or set a callback (called on failure or success without switching requested)\n  otaUpdater-\u003esetCallback(upgradeCallback);\n\n  // start update\n  otaUpdater-\u003estart();\n}\n```\n\nFor a complete example take a look at the [Basic_Ota](samples/Basic_Ota/app/application.cpp) sample.\n\n### HTTP Server\n\n```c++\nserver.listen(80);\nserver.paths.set(\"/\", onIndex);\nserver.paths.set(\"/hello\", onHello);\nserver.paths.setDefault(onFile);\n\nSerial.println(\"=== WEB SERVER STARTED ===\");\nSerial.println(WifiStation.getIP());\n\n...\n\nvoid onIndex(HttpRequest \u0026request, HttpResponse \u0026response)\n{\n  TemplateFileStream *tmpl = new TemplateFileStream(\"index.html\");\n  auto \u0026vars = tmpl-\u003evariables();\n  vars[\"counter\"] = String(counter);\n  vars[\"IP\"] = WifiStation.getIP().toString();\n  vars[\"MAC\"] = WifiStation.getMAC();\n  response.sendTemplate(tmpl);\n}\n\nvoid onFile(HttpRequest \u0026request, HttpResponse \u0026response)\n{\n  String file = request.getPath();\n  if (file[0] == '/')\n    file = file.substring(1);\n\n  response.setCache(86400, true);\n  response.sendFile(file);\n}\n```\n\nFor more examples take a look at the [HttpServer_ConfigNetwork](samples/HttpServer_ConfigNetwork/app/application.cpp), [HttpServer_Bootstrap](samples/HttpServer_Bootstrap/app/application.cpp), [HttpServer_WebSockets](samples/HttpServer_WebSockets/app/application.cpp) and [HttpServer_AJAX](samples/HttpServer_AJAX/app/application.cpp) samples.\n\n### Email Client\n\n```c++\nSmtpClient emailClient;\n\nemailClient.connect(Url(\"smtp://user:password@domain.com\"));\n\nMailMessage* mail = new MailMessage();\nmail-\u003efrom = \"developers@sming\";\nmail-\u003eto = \"iot-developers@world\";\nmail-\u003esubject = \"Greetings from Sming\";\nmail-\u003esetBody(\"Hello\");\n\nFileStream* file= new FileStream(\"image.png\");\nmail-\u003eaddAttachment(file);\n\nemailClient.onMessageSent(onMailSent);\nemailClient.send(mail);\n\n...\n\nint onMailSent(SmtpClient\u0026 client, int code, char* status)\n{\n    MailMessage* mail = client.getCurrentMessage();\n\n    ...\n\n    if(!client.countPending()) {\n        client.quit();\n    }\n\n    return 0;\n}\n\n```\n\nSee the [SmtpClient sample](samples/SmtpClient/app/application.cpp) for details.\n\n## Live Debugging\n\nApplications based on Sming Framework that are flashed and running on an ESP8266 device can be debugged using interactive debuggers.\nIn 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:\n\n```bash\ncd $SMING_HOME/../samples/LiveDebug\nmake clean\nmake ENABLE_GDB=1\nmake flashapp # \u003c-- this will update only the application firmware.\n```\n\nOnce 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:\n\n```bash\nmake gdb\n```\n\nDevelopers using Eclipse CDT can have debugging sessions like the one below:\n![Debugging Session in Eclipse CDT](https://raw.githubusercontent.com/SmingHub/Sming/gh-pages/images/eclipse-debug-session.png)\n\nSee [LiveDebug sample](samples/LiveDebug/) for details.\n\n\n## Contribute\n\nYou can contribute to Sming by:\n\n- Providing Pull Requests with new features, bug fixes, new ideas, etc. See [Contributing](https://smingdev.readthedocs.io/en/latest/contribute/index.html) for details.\n- Testing our latest source code and reporting issues.\n- Supporting us financially to acquire hardware for testing and implementing or out of gratitude\n\n### Financial contributions\n\nWe welcome financial contributions in full transparency on our [open collective](https://opencollective.com/Sming) page.\nThey help us improve the project and the community around it. If you would like to support us you can [become a backer](https://opencollective.com/Sming#backer) or [a sponsor](https://opencollective.com/Sming#sponsor).\n\nIn 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.\n\n\n#### Backers and sponsors\n\nThank you to all the people who have backed Sming\n\u003ca href=\"https://opencollective.com/Sming#backers\" target=\"_blank\"\u003e\n\u003cimg src=\"https://opencollective.com/Sming/backers.svg?width=890\" alt=\"backer\"\u003e\u003c/a\u003e\n\nor sponsored it.\n\n\u003ca href=\"https://opencollective.com/Sming/sponsor/0/website\" target=\"_blank\"\u003e\n\u003cimg src=\"https://opencollective.com/Sming/sponsor/0/avatar.svg\" alt=\"sponsor\"\u003e\u003c/a\u003e\n","funding_links":["https://opencollective.com/Sming"],"categories":["C++","Firmware","一、开发框架（Framework）","Framework","MCU programming"],"sub_categories":["常用框架","ESP8266"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmingHub%2FSming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSmingHub%2FSming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSmingHub%2FSming/lists"}