Add 868MHz envs, fix MAC id, offset timesync

This commit is contained in:
2026-01-21 21:14:48 +01:00
parent 8c9520f7e5
commit 5f42575b10
6 changed files with 46 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ static SenderStatus g_sender_statuses[NUM_SENDERS];
static bool g_ap_mode = false;
static WifiMqttConfig g_cfg;
static uint32_t g_last_timesync_ms = 0;
static constexpr uint32_t TIME_SYNC_OFFSET_MS = 15000;
static void init_sender_statuses() {
for (uint8_t i = 0; i < NUM_SENDERS; ++i) {
@@ -124,6 +125,9 @@ static void sender_cycle() {
}
static void receiver_loop() {
if (g_last_timesync_ms == 0) {
g_last_timesync_ms = millis() - (TIME_SYNC_INTERVAL_SEC * 1000UL - TIME_SYNC_OFFSET_MS);
}
LoraPacket pkt = {};
if (lora_receive(pkt, 0) && pkt.protocol_version == PROTOCOL_VERSION && pkt.payload_type == PayloadType::MeterData) {
uint8_t decompressed[256];