Nimbin[12]?Embedded / esp_garden / globals.cpp

esp_garden git · master

Distributed ESP sensor and actuator system (garden)

esp32 esp-idf iot sensors c++ sql · first commit 2025-10-15 · last commit 2026-01-20 (8 months ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/mic/esp_garden

C++ 70.7% Markdown 18% C 10.7%
git clone https://git.christianimmanuel.de/embedded/esp_garden.gitwget https://git.christianimmanuel.de/embedded/esp_garden/archive/esp_garden.tar.gz
globals.cpp 961 B · 32 lines raw
#include "globals.h"

uint32_t g_setup_duration = 0;
uint32_t g_wakeup_earlier_server = 20000;
uint32_t g_wakeup_earlier_sensor =  2000;
uint32_t g_wakeup_earlier_pump   =  8000;

SensorEntry_s g_buffer[BUFFER_SIZE];
uint8_t g_buffer_count = 0;
char    g_pending_sensor_configs[4][32] = {};
uint8_t g_pending_sensor_configs_count  = 0;

bool g_received_ok_from_server = false;





// Client sensor stuff
const uint32_t g_min_sleep_time = 60000;
RTC_DATA_ATTR bool all_init_configs_received = false;

constexpr uint8_t PEER_SERVER[6] = {0xc2,0xde,0x67,0x2a,0x1e,0x29};
constexpr uint8_t PEER_SENSOR[6] = {0xc2,0xc2,0x80,0x2f,0xfe,0x28};
constexpr uint8_t PEER_PUMP[6]   = {0xc2,0xc1,0x79,0x1e,0xed,0x18};

SensorConfig_s sensor_configs[] = {
    {"moisture_1", true, 11, 10, "pump_1", 0, 0, {0},  90000, true,  {465, 466}, 2, 0, 0},
    {"moisture_2", true, 11, 10, "pump_2", 0, 0, {0}, 120000, false, {0}, 0, 0, 0}
};

uint8_t config_request_attempts_max = 3;