Close
0%
0%

ksIotFrameworkLib

Accelerate IoT application development with ksIotFrameworkLib!

Similar projects worth following
Arduino Library for ESP32/ESP8266 - a composition-oriented Internet of Things framework that provides a simple and extendable architecture, handles device setup (WiFi setup, MQTT and application-specific configuration), network connectivity, MQTT telemetry protocol, and more...

🚀 Introduction

ksIotFrameworkLib is an Arduino-based C++ framework designed for ESP32 and ESP8266 microcontrollers.

The library handles the typical IoT boilerplate for you - from initial Wi-Fi provisioning via a captive portal to MQTT connectivity with a robust reconnection mechanism. It also includes a built-in LAN-accessible web portal for device configuration, over-the-air firmware updates, live status monitoring, and terminal access.

The terminal, a special feature of the web portal, lets you view real-time application logs and define your own commands.

By handling these repetitive foundations, ksIotFrameworkLib lets you concentrate on the unique logic of your smart sensors, controllers, or DIY automations - without needing to reinvent connectivity or configuration layers every time.

💡 Potential use cases

  • 🏠 Smart home solutions - services, monitoring, alarming

  • 📊 Telemetry systems - sending sensor data, device statuses

  • 🎛️ Remote control applications - switching devices, executing commands

The library is not limited to these examples - it’s designed to support a wide range of IoT projects.

For instance, one of my personal implementations involves remotely controlling a heating boiler, fully integrated with Home Assistant via MQTT. I have devices running continuously for months without interruptions, demonstrating the library’s stability and reliability in real-world deployments.

🧭 Motivation

  • Create a solid starting point for developing applications targeting Espressif microcontrollers

  • Streamline the process of adapting and reusing code across multiple devices

  • Apply the DRY principle (Don't Repeat Yourself) to DIY IoT projects by consolidating common functionality into a simple, reusable library

🛠️ How it started?

I first got into programming back in elementary school, but PCBs fascinated me even earlier. It started when my cousin showed me a small microphone board from a CB radio - and I couldn’t stop thinking about how such things were made. I always dreamed of creating my own.

The first real project happened years later when I modified my dad’s car radio so it powered on with the ignition. That little hack was the spark that led me to discover Arduino - and the urge to build something truly mine.

My first breadboard project was a pump controller for an old heating furnace. It turned on the pump automatically when the temperature was right. Looking back, I’m still surprised it worked! But that’s when I got hooked on real-time telemetry.

That was around 2017, using the ESP8266. As I built more devices, I noticed I was constantly duplicating code. So in 2020, I decided to create a lightweight framework that would unify my projects - and that’s how ksIotFrameworkLib was born.

Today, several of my devices use it daily, sending thousands of MQTT messages to control everything from Zigbee-based home automation to my parents’ heating boiler over CAN bus, connected through a cellular network.

The framework keeps evolving, driven by real-world use and the desire to make each next device easier to build than the last.

ksiotnex.mp4

High-Level Overview of ksIotFrameworkLib Architecture

MPEG-4 Video - 43.14 MB - 10/15/2025 at 07:31

Download

  • Feature: Device web-portal

    cziter1503/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

    cziter1509/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

    cziter1508/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

    cziter1508/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

    cziter1507/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

    cziter1507/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!

    cziter1507/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

Does this project spark your interest?

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