2022-08-03 03:36:04 +00:00
|
|
|
// FARM DATA RELAY SYSTEM
|
|
|
|
//
|
2023-02-25 18:08:21 +00:00
|
|
|
// GATEWAY CONFIGURATION
|
2022-08-03 03:36:04 +00:00
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
//Addresses
|
|
|
|
#define UNIT_MAC 0x02 // The address of this gateway
|
2022-08-25 08:58:02 +00:00
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
#define ESPNOW_NEIGHBOR_1 0x01 // Address of ESP-NOW neighbor #1
|
|
|
|
#define ESPNOW_NEIGHBOR_2 0x04 // Address of ESP-NOW neighbor #2
|
|
|
|
#define LORA_NEIGHBOR_1 0x00 // Address of LoRa neighbor #1
|
|
|
|
#define LORA_NEIGHBOR_2 0x00 // Address of LoRa neighbor #2
|
2022-08-03 03:36:04 +00:00
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
// Interfaces
|
2022-08-03 03:36:04 +00:00
|
|
|
#define USE_ESPNOW
|
|
|
|
//#define USE_LORA
|
2023-02-25 18:08:21 +00:00
|
|
|
//#define USE_WIFI // Will cause errors if used with ESP-NOW. Use a serial link instead!
|
|
|
|
//#define USE_ETHERNET
|
2022-08-03 03:36:04 +00:00
|
|
|
|
2023-03-03 04:26:52 +00:00
|
|
|
// Routing
|
2023-02-25 18:08:21 +00:00
|
|
|
// Options: sendESPNowNbr(1 or 2); sendESPNowPeers(); sendLoRaNbr(1 or 2); broadcastLoRa(); sendSerial(); sendMQTT();
|
|
|
|
#define ESPNOWG_ACT sendESPNowNbr(1);
|
|
|
|
#define LORAG_ACT
|
|
|
|
#define SERIAL_ACT
|
|
|
|
#define MQTT_ACT
|
|
|
|
#define INTERNAL_ACT sendESPNowNbr(1);
|
|
|
|
#define ESPNOW1_ACT sendESPNowNbr(2); sendESPNowPeers();
|
|
|
|
#define ESPNOW2_ACT sendESPNowNbr(1);
|
|
|
|
#define LORA1_ACT
|
2022-08-03 03:36:04 +00:00
|
|
|
#define LORA2_ACT
|
|
|
|
|
2023-02-01 01:48:20 +00:00
|
|
|
// LoRa Configuration
|
2023-02-25 18:08:21 +00:00
|
|
|
#define RADIOLIB_MODULE SX1276
|
|
|
|
#define LORA_SS 18
|
|
|
|
#define LORA_RST 14
|
|
|
|
#define LORA_DIO 26
|
2023-03-09 00:45:45 +00:00
|
|
|
#define LORA_BUSY 33
|
2023-02-25 18:08:21 +00:00
|
|
|
//#define USE_SX126X
|
|
|
|
|
2023-03-09 00:45:45 +00:00
|
|
|
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
|
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
//#define CUSTOM_SPI
|
|
|
|
#define LORA_SPI_SCK 5
|
|
|
|
#define LORA_SPI_MISO 19
|
|
|
|
#define LORA_SPI_MOSI 27
|
2022-08-03 03:36:04 +00:00
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
#define FDRS_DEBUG // Enable USB-Serial debugging
|
|
|
|
|
|
|
|
// OLED -- Displays console debugging messages on an SSD1306 I²C OLED
|
|
|
|
///#define USE_OLED
|
|
|
|
#define OLED_HEADER "FDRS"
|
2023-03-08 22:12:14 +00:00
|
|
|
#define OLED_PAGE_SECS 30
|
2023-02-25 18:08:21 +00:00
|
|
|
#define OLED_SDA 4
|
|
|
|
#define OLED_SCL 15
|
|
|
|
#define OLED_RST 16
|
|
|
|
|
2023-09-08 22:29:28 +00:00
|
|
|
// UART data interface pins (ESP32 only)
|
|
|
|
//#define RXD2 14
|
|
|
|
//#define TXD2 15
|
2022-08-03 03:36:04 +00:00
|
|
|
|
2023-02-25 18:08:21 +00:00
|
|
|
//#define USE_LR // Use ESP-NOW LR mode (ESP32 only)
|
|
|
|
|
2023-02-01 01:48:20 +00:00
|
|
|
// WiFi and MQTT Credentials -- These will override the global settings
|
2022-08-03 03:36:04 +00:00
|
|
|
//#define WIFI_SSID "Your SSID"
|
|
|
|
//#define WIFI_PASS "Your Password"
|
2023-03-06 17:04:10 +00:00
|
|
|
|
|
|
|
// Use Static IP Address for WiFi connections
|
|
|
|
// #define USE_STATIC_IPADDRESS
|
|
|
|
// #define HOST_IPADDRESS "192.168.0.100"
|
|
|
|
// #define GW_IPADDRESS "192.168.0.1"
|
|
|
|
// #define SUBNET_ADDRESS "255.255.255.0"
|
2023-03-06 21:07:19 +00:00
|
|
|
// #define DNS1_IPADDRESS "192.168.0.1"
|
|
|
|
// #define DNS2_IPADDRESS "192.168.0.2"
|
2023-02-01 01:48:20 +00:00
|
|
|
|
2022-08-03 03:36:04 +00:00
|
|
|
//#define MQTT_ADDR "192.168.0.8"
|
|
|
|
//#define MQTT_PORT 1883 // Default MQTT port is 1883
|
|
|
|
//#define MQTT_AUTH //Enable MQTT authentication
|
|
|
|
//#define MQTT_USER "Your MQTT Username"
|
|
|
|
//#define MQTT_PASS "Your MQTT Password"
|
|
|
|
|
2023-03-03 04:26:52 +00:00
|
|
|
|
2023-02-01 01:48:20 +00:00
|
|
|
|