All Projects → workilabs → Bleeper

workilabs / Bleeper

Licence: mit
Library to manage your firmware configurations written in C++

Projects that are alternatives of or similar to Bleeper

Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (+331.48%)
Mutual labels:  arduino, esp32, firmware, arduino-ide, iot, esp8266, wifi
Espui
A simple web user interface library for ESP32 and ESP8266
Stars: ✭ 330 (+511.11%)
Mutual labels:  arduino, esp32, arduino-ide, iot, esp8266
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (+212.96%)
Mutual labels:  arduino, esp32, iot, esp8266, wifi
Esp3d
FW for ESP8266/ESP8285/ESP32 used with 3D printer
Stars: ✭ 979 (+1712.96%)
Mutual labels:  arduino, esp32, firmware, esp8266, wifi
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 (+6020.37%)
Mutual labels:  arduino, esp32, 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 (-75.93%)
Mutual labels:  arduino, iot, esp8266, wifi, webserver
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+1927.78%)
Mutual labels:  arduino, esp32, iot, esp8266, wifi
Blinker Doc
blinker中文文档
Stars: ✭ 139 (+157.41%)
Mutual labels:  arduino, esp32, iot, esp8266, wifi
Platform Espressif32
Espressif 32: development platform for PlatformIO
Stars: ✭ 333 (+516.67%)
Mutual labels:  arduino, esp32, firmware, arduino-ide, iot
Arduinowebsockets
A library for writing modern websockets applications with Arduino (ESP8266 and ESP32)
Stars: ✭ 213 (+294.44%)
Mutual labels:  arduino, esp32, iot, esp8266
Platform Espressif8266
Espressif 8266: development platform for PlatformIO
Stars: ✭ 206 (+281.48%)
Mutual labels:  arduino, firmware, iot, esp8266
Tasmota
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
Stars: ✭ 16,624 (+30685.19%)
Mutual labels:  arduino, firmware, iot, esp8266
Awesome Esp
📶 A curated list of awesome ESP8266/32 projects and code
Stars: ✭ 212 (+292.59%)
Mutual labels:  arduino, esp32, iot, esp8266
Dsckeybusinterface
An Arduino/esp8266/esp32 library to directly interface with DSC security systems.
Stars: ✭ 202 (+274.07%)
Mutual labels:  arduino, esp32, iot, esp8266
Deviot
Sublime Text plugin for IoT development based in PlatformIO ecosystem (Arduino IDE)
Stars: ✭ 281 (+420.37%)
Mutual labels:  arduino, esp32, arduino-ide, esp8266
Esphelper
A library to make using WiFi & MQTT on the ESP8266 easy.
Stars: ✭ 310 (+474.07%)
Mutual labels:  arduino, esp32, esp8266, wifi
Platformio Atom Ide
PlatformIO IDE for Atom: The next generation integrated development environment for IoT
Stars: ✭ 475 (+779.63%)
Mutual labels:  arduino, esp32, iot, esp8266
Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (+555.56%)
Mutual labels:  arduino, firmware, iot, esp8266
Esphome Core
🚨 No longer used 🚨 - The C++ framework behind ESPHome
Stars: ✭ 545 (+909.26%)
Mutual labels:  arduino, esp32, iot, esp8266
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 (-85.19%)
Mutual labels:  arduino, esp32, iot, esp8266

Bleeper is a library to manage your firmware configurations written in C++ for ESP8266 and ESP32 Arduino Platforms.

Features

  • [x] Fully customizable hierarchical configuration structure
  • [x] Generic property types
  • [x] Automatic storage with property granularity (EEPROM & SPIFFS)
  • [x] Wifi & AP connections
  • [x] Configuration interfaces (web panel by default)
  • [x] Observe any configuration property change through the observer API

Why Bleeper

In the scenario of prototyping with hardware devices you will likely end up with a bunch of configuration settings like pin numbers, sensor thresholds, device ids, connection credentials, port numbers, and so many others.
As a good programmer you decide to define these configurations in a "configuration file" with a lot of #define macros or constants.

But... what if you want to change those values? Downloading the firmware each time is tedious. Think about the cases where you have multiple devices to configure or even worst you don't have close physical access to them.

At the end you realize that you actually need some sort of "Configuration Manager" with high level features like exposing those variables on a web panel (or another type of interface), persisting some of them (usually your Wifi credentials) and so on.

Usage

Suppose that you have this configuration:

The above tree structure speaks by its own, what's worth to mention here is that we want wifi.ssid and wifi.passwrod to be persistent using the Bleeper storage.

The C++ code will look like this:

#include "Bleeper.h"

class Config: public RootConfiguration {
public:
  stringVar(name, "Default Device Name");
  subconfig(WifiConfig, wifi);
  subconfig(LedsConfig, leds);
};

class WifiConfig: public Configuration {
public:
  persistentStringVar(ssid, "MySSID");
  persistentStringVar(password, "MyPassword");
};

class LedsConfig: public Configuration {
public:
  floatVar(calibration, 1.5);
  subconfig(SPIConfig, spi);
};

class SPIConfig: public Configuration {
public:
  intVar(speed, 1000000);
};

Basically, per each configuration node you have to implement a subclass of Configuration and a RootConfiguration subclass for the especial root node (i.e the top level entry).

For a full documentation on how properties are defined read here.

Once we completed our configuration structure we can use it like this:

// Your Config instance
Config C;

void loop() {
  // access to your spi speed config
  int speed = C.leds.spi.speed
}

Note that all variables are type-safe. You are not accessing to a generic wrapper and casting its type.

The final step is to setup the Bleeper singleton instance with your RootConfiguration instance and specify your connections, interfaces, storage and observers.

#include "Bleeper.h"

class CalibrationObserver: public ConfigurationObserver {
public:
  void onConfigurationChanged(const ConfigurationPropertyChange value) {
    Serial.println("Configuration " + value.key + " changed from " + value.oldValue + " to " + value.newValue);
  }
};

Config C;

void setup() {

  Bleeper
    .verbose(115200)
    .configuration
      .set(&C)
      .addObserver(new CalibrationObserver(), {&C.leds.calibration})
      .done()
    .configurationInterface
      .addDefaultWebServer()
      .done()
    .connection
      .setSingleConnectionFromPriorityList({
          new Wifi(&C.wifi.ssid, &C.wifi.password),
          new AP() // fallback
      })
      .done()
    .storage
      .setDefault() // EEPROM
      // .set(new SPIFFSStorage()) // SPIFFS
      .done()
    .init();
}

void loop() {

  Bleeper.handle();

}

Basically Bleeper exposes four entry points:

  1. Bleeper.configuration

Lets you set your RootConfiguration instance and add observers to changes on it. In this example we are setting the CalibrationObserver instance that will be only notified about changes on the C.leds.calibration property.

  1. Bleeper.configurationInterface

Here you can add as many ConfigurationInterface instances as you want. Bleeper provides a default web panel when calling addDefaultWebServer.

  1. Bleeper.connection

Under connection we can call setMultipleConnections or setSingleConnectionFromPriorityList (in which only one connection will be active) and provide a list of Connection instances. By default the Wifi class will observe changes on the provided credentials and retry the connection accordingly.

  1. Bleeper.storage

Lets you specify the Storage instance to use when saving your persistent variables. Calling setDefault will use the default EEPROM storage automatically. You can also use SPIFFSStorage or create your own instead.

Installation

Arduino IDE

Go to Sketch > Include Library > Manage Libraries...
Search for Bleeper and click on Install

PlatformIO IDE

Go to your platformio.ini file and add the following lines:

lib_deps = Bleeper
lib_ldf_mode = deep

Future Work

  • Add support for other boards.
  • Improve documentation & examples.
  • Add CI server & tests.

Author

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].