Add 868MHz envs, fix MAC id, offset timesync
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user