OmniEdgev0.4.2
IDLEFPS 60CPU 27%
v0/mpenon4-e83b86d8
// main.cpp — esp32-edge-vision
// On-device inference loop · TinyML quantized model
#include <Arduino.h>
#include <esp_camera.h>
#include "tflite_micro/model_runner.h"
#include "drivers/bme280.h"
#include "comms/esp_now_mesh.h"
 
static ModelRunner runner("vision_v3.tflite");
static BME280 env;
static MeshNode mesh(/* channel */ 6);
 
void setup() {
Serial.begin(921600);
env.begin(I2C_BUS_0);
runner.load(/* arena_kb */ 256);
mesh.join("omniedge.fleet");
}
 
void loop() {
camera_fb_t* fb = esp_camera_fb_get();
if (!fb) return;
 
auto inference = runner.infer(fb->buf, fb->len);
if (inference.confidence > 0.82f) {
mesh.broadcast({
.label = inference.label,
.conf = inference.confidence,
.temp = env.read_temperature(),
.ts = micros(),
});
}
esp_camera_fb_return(fb);
vTaskDelay(pdMS_TO_TICKS(33)); // ~30 fps
}
 
C++17UTF-8LF
Ln 14 · Col 2238 lines · 1.2 KB
>_Oracle· Engineering Console
ready
[14:22:01]buildplatformio · linking firmware.elf (1.84 MB)
[14:22:18]meshesp-now joined · channel 6 · 4 peers
[14:24:01]tinymlSRAM at 71% — approaching arena ceiling
$