Close
0%
0%

IoT framework for Arduino-esp32/8266

Accelerate IoT application development with ksIotFrameworkLib!

Similar projects worth following
This project is "The Heart" of my all IoT device firmware applications.

Each of my ESP application requires WiFi configuration, MQTT connectivity and some architecture. I've quickly realised that each time starting new project copying of already written code is required. So... why not get this code separated into generic purpose library?

Actively developed since 2020. Recently added PlatformIO support.

TARGET PLATFORMS

  • Arduino Framework / ESP32
  • Arduino Framework / ESP8266

KEY FEATURES

  • Simple non-blocking, application creation pattern.
  • Object oriented, composition based architecture.
  • Simplified memory management by using new C++ features (smart pointers).
  • Built-in WiFi configurator (depends on WiFiManager).
  • Built-in MQTT support (depends on PubSubClient).
  • Built-in MQTT debug commands.
  • PlatformIO support (automatic dependency download).

HOW TO START?

  1. Download Visual Studio Code.
  2. Install PlatformIO.
  3. Install one of ESP boards with Arduino framework.
  4. Create new project.
  5. Add framework library dependency to platformio.ini.
  6. Start development of your application :)

EXAMPLE APPS:

  • Feature: Device web-portal

    h4rdc0der03/04/2024 at 13:39 0 comments

    Device portal brings super-easy configuration to any device using ksIotFrameworkLib. It can be accessed via LAN when connected or via WiFi-AP in configuration mode.

  • Feature: Custom RTTI implementation

    h4rdc0der09/05/2022 at 06:10 0 comments

    To achieve smaller binary size and get rid of function names from binary, I've implemented custom RTTI. Heavily based on Paul Varcholik and Shao Voon Wong implementations.

    Currently all application components must implement KSF_RTTI_DECLARATIONS to be able to prepare downcasting.

    Then user is able to check class type. It's very useful for functions finding objects by class type.


  • Moved to C++17, replaced String with std::string

    h4rdc0der08/24/2022 at 06:26 0 comments

    Due to new amazing features, like string_view in C++ 17 I've decided replace existing String-based implementations to use string and string_view. This should generally improve performance and be more C++ friendly.

    This is breaking change, projects should replace String& with std::string& or std::string_view& respectively. Python configuration script for platformio has been updated to automatically enable new standards.

    Requirements for bare Arduino users:

    Required enabled flags:
    • -std=gnu++17
    • -std=c++17

    Required disabled flags:

    • -fno-rtti
    • -std=gnu++11

  • Latest changes - LittleFS support and more

    h4rdc0der08/11/2022 at 07:05 0 comments

    Recently I've pushed some changes:

    • New filesystem - LittleFS instead of deprecated SPIFFS
    • New predicate functions for component iteration
    • Improvements targeting execution performance
    • Improvements in ksConfigProvider component
    • New "rfcalib" debug command (manually erase RF_CAL data on demand)
    • Other minor improvements...

  • Always erase your chip instead of flashing it first

    h4rdc0der07/18/2022 at 07:42 0 comments

    I've noticed that one of my devices is sometimes losing WiFi connection and is unable to reconnect again. I've updated NONOS core first, but still - same problem. Another ESP8266 based device with same code worked without issues.

    Why?

    Because of... RF_CAL (RF calibration area). This area isn't cleared automatically with every OTA update or serial flash - by flashing various software (with different SDK version) you might end up with incompatibile SDK in context of RF_CAL contents. That's why it's recommended to erase chip.

    Doing full chip erase and then flashing software fixed the problem :)

  • Device online monitoring feature

    h4rdc0der07/09/2022 at 18:46 0 comments

    I've added very simple MQTT-based feature that allows to monitor device connectivity.

    • MQTT connector component will now use %deviceprefix%/connected topic to inform about connection state.
    • Just after establishing MQTT connection, ksIotFrameworkLib will post "1" value to the topic.
    • Last will message feature of MQTT protocol will post "0" value to the %deviceprefix%/connected topic.

    Thanks to my Blynk-MQTT-Bridge I was able to setup uptimerobot easily:

  • PlatformIO core 6.1.0 released + MORE!

    h4rdc0der07/08/2022 at 06:52 0 comments

    Our friends from PlatfiormIO have released 6.1.0 version of PIO core including significant change:

    • Allowed to Import("projenv") in a library extra script (issue #4305)

    This feature removed requirement to manually unflag -fno-rtti, all is now handled by fix_rtti.py script.

    https://docs.platformio.org/en/latest/core/history.html
    https://community.platformio.org/t/force-rtti-from-library/28176

    Another amazing thing, that since I've moved with ksIotFrameworkLib towards PlatformIO, CICD became easy.

    Currently all my three projects based on this framework can be built on github with Github Actions, producing firmware binary file ready to be flashed on the device. This can be done even with mobile phone (as user can trigger Wifi Manager portal and then upload downloaded firmware file).

    Next step is to use CICD features to implement unit tests for framework library :)

View all 7 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates