#pragma once // LoRa radio parameters — must match exactly on node and gateway #define LORA_FREQ 868.0 // MHz #define LORA_SF 12 #define LORA_BW 125.0 // kHz #define LORA_CR 5 #define LORA_SYNC_WORD 0xAB // distinct from ice-track (0x34) #define LORA_POWER 22 // dBm (SX1262 max) // Wio-SX1262 pins for XIAO ESP32S3 // Verify against https://wiki.seeedstudio.com/wio_sx1262_with_xiao_esp32s3 #define LORA_NSS 44 // D7 #define LORA_RST 43 // D6 #define LORA_DIO1 2 // D1 #define LORA_BUSY 1 // D0 // Send interval (node) — 30 min fills one packet; adjust 1–4x/hour #define SEND_INTERVAL_MS (30UL * 60UL * 1000UL) // MQTT broker (home, shared with mitt_lora) #define MQTT_HOST "192.168.86.31" #define MQTT_PORT 1883 #define MQTT_USER "mqtt" #ifndef MQTT_PASS #define MQTT_PASS "" #endif // MQTT topics (cabin ESPHome → node subscribes to these) #define TOPIC_TEMP_IN "hytte/sensor/temp_inne" #define TOPIC_TEMP_OUT "hytte/sensor/temp_ute" #define TOPIC_BATT_MV "hytte/sensor/batt_mv" #define TOPIC_BATT_PCT "hytte/sensor/batt_pct" // MQTT topic gateway publishes received packets to (home broker) #define TOPIC_GW_STATUS "hytte/lora/status" // Command topics (home HA publishes → cabin_gw → LoRa → cabin_node → ESPHome) // Payload: "ON" or "OFF" #define TOPIC_CMD_VARME "hytte/cmd/varme" #define TOPIC_CMD_VVB "hytte/cmd/vvb" // ESPHome publishes switch states here (cabin_node subscribes) #define TOPIC_STATE_VARME "hytte/switch/varme/state" #define TOPIC_STATE_VVB "hytte/switch/vvb/state" // WiFi credentials #ifndef WIFI_SSID #define WIFI_SSID "your-ssid" #endif #ifndef WIFI_PASS #define WIFI_PASS "your-pass" #endif // HMAC key — 32+ chars, keep secret #ifndef HMAC_KEY #define HMAC_KEY "hytte-link-hmac-key-replace-me" #endif #if __has_include("secrets.h") #include "secrets.h" #endif