C++ client library for the Insula Labs INSI service. Provides key/value storage and eventing capabilities via web service for ESP32-based IoT devices.
- Clone or download this repository.
- Place the library folder in your Arduino libraries directory (e.g., ~/Documents/Arduino/libraries/insipp).
- Restart the Arduino IDE if open.
- ESP32 Arduino core (install via Arduino Boards Manager).
- No external library dependencies.
brew install arduino-cli
Use the provided Makefile:
make setup: Install ESP32 core.make build: Compile the example sketch.make upload: Upload to ESP32 board (update PORT in Makefile if needed).make monitor: Open serial monitor.make all: Build, upload, and monitor.
For proper IntelliSense and LSP:
- Disable the clangd extension for this workspace if enabled (go to Extensions, search for clangd, and disable for workspace).
- Use or update
.vscode/c_cpp_properties.jsonwith include paths for ESP32:- Add paths like
/Users/<yourusername>/Library/Arduino15/packages/esp32/hardware/esp32/3.3.1/cores/esp32and libraries. - Adjust compilerPath to your avr-gcc installation.
- Ensure "defines" include ESP32-specific macros like "ARDUINO_ARCH_ESP32" and "ESP32".
- Add paths like
Include the header:
#include <insipp.hpp>
Implement a logger and HTTP client (ESP32 default provided).
Example (from BasicDemo.ino):
class logger : public log_cb_if {
public:
void on_log(const char* message) const override {
Serial.print("[LOG] ");
Serial.println(message);
}
};
logger log_handler;
http_client_esp32 http;
config_s config = {
.api_key = "your_api_key_here",
.log_cb = &log_handler,
};
Insipp client(config, http);
// Set value
client.set_value({"test.key", "value"});
// Get value
String value;
client.get_value("test.key", value);
See examples/BasicDemo/BasicDemo.ino for full demonstration of all operations including cache, setnx, cas, bump, and iterate.