Nimbin[12]?Embedded / esp_garden / client_pump/main/ClientPump.h

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
client_pump/main/ClientPump.h 1.4 KB · 59 lines raw
#ifndef CLIENTPUMP_H
#define CLIENTPUMP_H


#include "globals.h"
#include "secrets.h"


extern long long next_message_unix;
extern bool received_starting_message;

enum PumpSatatus_e {
    INACTIVE,
    START,
    RUNNING,
    FINISHED
};

struct PumpConfig_s {
    char pump_name[32];
    int pumping_delay_sec;
    int pumping_duration;
    long long next_message_unix;
    long long pumping_started_at_unix;
    PumpSatatus_e pumping_status;
};

#define PUMP_COUNT 2
extern PumpConfig_s pump_configs[PUMP_COUNT];

// ----------------------------------------------------------------------------
// Time handling
// ----------------------------------------------------------------------------

int64_t get_CurrentUnix();
void    setup_Timezone();

// ----------------------------------------------------------------------------
// WiFi handling
// ----------------------------------------------------------------------------

void init_WiFi();


// ----------------------------------------------------------------------------
// ESP-NOW handling
// ----------------------------------------------------------------------------

void init_EspNow();


// ----------------------------------------------------------------------------
// Deep sleep scheduler
// ----------------------------------------------------------------------------

void sleep_UntilNextSend(int64_t next_read);


#endif