refactor lora payload timing
Bump the batch payload codec to schema v4 with separate meter-time and UTC anchors, then use meter seconds for sparse batch slotting and receiver reconstruction. Update the current 868 MHz bench configuration, allow ACKs from configured receiver short IDs, improve AP-to-STA recovery, quiet the test build, and document the changed protocol in the README.
This commit is contained in:
+17
-5
@@ -17,16 +17,22 @@ enum class BatchRetryPolicy : uint8_t {
|
||||
// =============================================================================
|
||||
|
||||
// LoRa frequency — uncomment ONE line:
|
||||
#define LORA_FREQUENCY_HZ 433E6 // 433 MHz (EU ISM, default)
|
||||
// #define LORA_FREQUENCY_HZ 868E6 // 868 MHz (EU SRD)
|
||||
// #define LORA_FREQUENCY_HZ 433E6 // 433 MHz (EU ISM, default)
|
||||
#define LORA_FREQUENCY_HZ 868E6 // 868 MHz (EU SRD)
|
||||
// #define LORA_FREQUENCY_HZ 915E6 // 915 MHz (US ISM)
|
||||
|
||||
// Expected sender device IDs (short-IDs). The receiver will only accept
|
||||
// batches from these senders. Add one entry per physical sender board.
|
||||
constexpr uint8_t NUM_SENDERS = 1;
|
||||
inline constexpr uint16_t EXPECTED_SENDER_IDS[NUM_SENDERS] = {
|
||||
0xF19C // TTGO #1 – 433 MHz sender
|
||||
// 0x7EB4 // TTGO #2 – 868 MHz sender (uncomment & adjust NUM_SENDERS)
|
||||
0x6540 // TTGO #1 – detected 868 MHz sender on /dev/ttyACM1
|
||||
};
|
||||
|
||||
// Receiver short-ID(s) allowed to originate AckDown packets. On the current
|
||||
// bench setup the receiver board on /dev/ttyACM0 identifies as 0x7EB4.
|
||||
constexpr uint8_t NUM_RECEIVERS = 1;
|
||||
inline constexpr uint16_t EXPECTED_RECEIVER_IDS[NUM_RECEIVERS] = {
|
||||
0x7EB4 // TTGO receiver – detected 868 MHz receiver on /dev/ttyACM0
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
@@ -79,12 +85,17 @@ constexpr uint8_t METER_BATCH_MAX_SAMPLES = 30;
|
||||
constexpr uint8_t BATCH_QUEUE_DEPTH = 10;
|
||||
constexpr BatchRetryPolicy BATCH_RETRY_POLICY = BatchRetryPolicy::Keep;
|
||||
constexpr uint32_t WATCHDOG_TIMEOUT_SEC = 120;
|
||||
constexpr uint32_t WIFI_RECONNECT_INTERVAL_MS = 60000; // WiFi reconnection retry interval (1 minute)
|
||||
constexpr uint32_t WIFI_RECONNECT_INTERVAL_MS = 80UL * 1000UL; // WiFi reconnection retry interval (80 seconds)
|
||||
constexpr bool ENABLE_HA_DISCOVERY = true;
|
||||
#ifndef SERIAL_DEBUG_MODE_FLAG
|
||||
#define SERIAL_DEBUG_MODE_FLAG 0
|
||||
#endif
|
||||
constexpr bool SERIAL_DEBUG_MODE = SERIAL_DEBUG_MODE_FLAG != 0;
|
||||
#if defined(DD3_DEBUG)
|
||||
constexpr bool CONFIG_FLOW_DEBUG = SERIAL_DEBUG_MODE;
|
||||
#else
|
||||
constexpr bool CONFIG_FLOW_DEBUG = false;
|
||||
#endif
|
||||
constexpr bool SERIAL_DEBUG_DUMP_JSON = false;
|
||||
constexpr bool LORA_SEND_BYPASS = false;
|
||||
|
||||
@@ -130,6 +141,7 @@ constexpr bool WEB_AUTH_REQUIRE_AP = true;
|
||||
// the web config page (/wifi). The first-boot AP forces password change.
|
||||
constexpr const char *WEB_AUTH_DEFAULT_USER = "admin";
|
||||
constexpr const char *WEB_AUTH_DEFAULT_PASS = "admin";
|
||||
|
||||
inline constexpr char HA_MANUFACTURER[] = "AcidBurns";
|
||||
static_assert(
|
||||
HA_MANUFACTURER[0] == 'A' &&
|
||||
|
||||
Reference in New Issue
Block a user