Initial commit — KC868-A2 contrôleur solaire ESP32
Fonctionnalités : - Lecture RS485 Modbus Epever Tracer 4210N (115200 bps, FC03/FC04/FC16) - Moteur de règles JSON (LittleFS) — commande automatique des relais - Interface web mobile-first (dashboard, règles, config, historique, EPEVER, debug) - WiFi AP+STA simultanés avec reconnexion automatique et portail captif - mDNS configurable (pv.local par défaut) - Configuration registres EPEVER depuis l'UI (18 registres holding) - Historique basse/haute résolution avec graphes canvas - VPN WireGuard optionnel (désactivé par défaut, config via UI) - OTA firmware + filesystem via ElegantOTA - Deep sleep / économie d'énergie Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
struct EpeverRegDef {
|
||||
uint16_t reg;
|
||||
const char *key;
|
||||
float scale; // raw→float : 0.01 pour les tensions, 1.0 pour les entiers
|
||||
float valMin;
|
||||
float valMax;
|
||||
bool writable;
|
||||
const char *unit;
|
||||
const char *label;
|
||||
const char *aide;
|
||||
};
|
||||
|
||||
extern const EpeverRegDef EPEVER_REGS[];
|
||||
extern const uint8_t EPEVER_REGS_COUNT;
|
||||
|
||||
// Blocs de registres consécutifs
|
||||
#define EPEVER_BLOC1_REG 0x9000u
|
||||
#define EPEVER_BLOC1_QTY 14u
|
||||
#define EPEVER_BLOC2_REG 0x906Bu
|
||||
#define EPEVER_BLOC2_QTY 4u
|
||||
|
||||
void initConfigEpever();
|
||||
bool lireConfigEpever();
|
||||
bool ecrireConfigEpever(JsonObject obj, String &erreur);
|
||||
bool sauvegarderConfigJson();
|
||||
bool restaurerConfigJson(String &erreur);
|
||||
void getConfigJson(String &out);
|
||||
void getConfigSauvegardeJson(String &out);
|
||||
Reference in New Issue
Block a user