fix-up gateway configs

more improvements needed
This commit is contained in:
Timm Bogner 2023-01-31 19:48:20 -06:00
parent a958f18387
commit ab1f51e547
4 changed files with 92 additions and 185 deletions

View File

@ -37,65 +37,37 @@
#define LORA1_ACT
#define LORA2_ACT
// LoRa Configuration
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
#define LORA_ACK // Request LoRa acknowledgment.
//Pins for UART data interface (ESP32 only)
#define RXD2 14
#define TXD2 15
// WiFi and MQTT Credentials -- These will override the global settings
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
//Logging settings -- Logging will occur when MQTT is disconnected
//#define USE_SD_LOG //Enable SD-card logging
//#define USE_FS_LOG //Enable filesystem (flash) logging
#define LOGBUF_DELAY 10000 // Log Buffer Delay - in milliseconds
#define SD_SS 0 //SD card CS pin (Use different pins for LoRa and SD)
#define LOG_FILENAME "fdrs_log.csv"
#define FS_FILENAME "fdrs_log.csv"
// SPI Configuration -- Needed only on Boards with multiple SPI interfaces like the ESP32
#define SPI_SCK 5
#define SPI_MISO 19
#define SPI_MOSI 27
// LoRa Configuration -- Needed only if using LoRa
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define LORA_BAND 915E6 // LoRa Frequency Band
#define LORA_SF 7 // LoRa Spreading Factor
#define LORA_TXPWR 17 // LoRa TX power in dBm (+2dBm - +20dBm), default is +17dBm. Lower power = less battery use
// Buffer Delays - in milliseconds - Uncomment to enable any buffer
//#define ESPNOW1_DELAY 0
//#define ESPNOW2_DELAY 0
//#define ESPNOWG_DELAY 0
//#define SERIAL_DELAY 0
//#define MQTT_DELAY 0
//#define LORAG_DELAY 1000
//#define LORA1_DELAY 1000
//#define LORA2_DELAY 1000
#define PEER_TIMEOUT 300000
// FastLED -- Not yet fully implemented
//#define USE_LED
#define LED_PIN 32
#define NUM_LEDS 4
// WiFi and MQTT Credentials -- Needed for MQTT only if "fdrs_globals.h" is not included
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
// MQTT Topics
#define TOPIC_DATA "fdrs/data"
#define TOPIC_STATUS "fdrs/status"
#define TOPIC_COMMAND "fdrs/command"
///#define USE_OLED
#define OLED_HEADER "FDRS"
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16

View File

@ -13,10 +13,9 @@
//#define USE_WIFI
// Actions -- Define what happens when a packet arrives at each interface:
// .
// sendESPNowNbr(1 or 2); sendESPNowPeers(); sendLoRaNbr(1 or 2); broadcastLoRa(); sendSerial(); sendMQTT();
#define ESPNOWG_ACT sendSerial();
#define SERIAL_ACT sendESPNow(0x02); sendLoRaNbr(1); sendESPNowPeers();
#define SERIAL_ACT sendESPNowNbr(2); sendLoRaNbr(2); sendESPNowPeers(); broadcastLoRa();
#define MQTT_ACT
#define LORAG_ACT sendSerial();
// Neighbor Actions
@ -25,22 +24,15 @@
#define LORA1_ACT sendSerial();
#define LORA2_ACT
// Functions available:
// sendESPNowNbr(int neighbor); sendESPNowPeers();
// sendLoRaNbr(neighbor); broadcastLoRa();
// sendSerial(); sendMQTT();
// Protocols -- Define which protocols the gateway will use.
// Warning: ESP-NOW and WiFi should not be used simultaneously.
//
//
//
// Neighboring gateway addresses
#define ESPNOW_NEIGHBOR_1 0x0E // ESPNOW1 Address
#define ESPNOW_NEIGHBOR_2 0xFF // ESPNOW2 Address
#define LORA_NEIGHBOR_1 0x02 // LoRa1 Address
#define LORA_NEIGHBOR_2 0xFF // LoRa2 Address
#define ESPNOW_NEIGHBOR_1 0x00 // ESPNOW1 Address
#define ESPNOW_NEIGHBOR_2 0x02 // ESPNOW2 Address
#define LORA_NEIGHBOR_1 0x00 // LoRa1 Address
#define LORA_NEIGHBOR_2 0x03 // LoRa2 Address
// LoRa Configuration
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
@ -54,12 +46,12 @@
#define RXD2 14
#define TXD2 15
// WiFi and MQTT Credentials -- Override the global settings
// WiFi and MQTT Credentials -- These will override the global settings
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"

View File

@ -13,10 +13,10 @@
// Current function options are: sendESPNow(MAC), sendSerial(), sendMQTT(),
// sendLoRaNbr(interface) , sendESPNowNbr(interface).
#define ESPNOWG_ACT sendESPNow(0x01);
#define ESPNOWG_ACT sendESPNowNbr(1);
#define SERIAL_ACT
#define MQTT_ACT
#define LORAG_ACT
#define LORAG_ACT sendESPNowNbr(1);
// Protocols -- Define which protocols the gateway will use.
// Warning: ESP-NOW and WiFi should not be used simultaneously.
@ -27,76 +27,47 @@
// Neighbor addresses
#define ESPNOW_NEIGHBOR_1 0x01 // ESPNOW1 Address
#define ESPNOW_NEIGHBOR_2 0x0F // ESPNOW2 Address
#define LORA_NEIGHBOR_1 0x0E // LoRa1 Address
#define LORA_NEIGHBOR_2 0x0F // LoRa2 Address
#define ESPNOW_NEIGHBOR_2 0x05 // ESPNOW2 Address
#define LORA_NEIGHBOR_1 0x00 // LoRa1 Address
#define LORA_NEIGHBOR_2 0x00 // LoRa2 Address
// Neighbor Actions
#define ESPNOW1_ACT sendSerial(); // This would display packets arriving *from* the front-end.
#define ESPNOW2_ACT
#define ESPNOW1_ACT sendESPNowPeers();
#define ESPNOW2_ACT sendESPNowNbr(1);
#define LORA1_ACT
#define LORA2_ACT
// LoRa Configuration
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
#define LORA_ACK // Request LoRa acknowledgment.
//Pins for UART data interface (ESP32 only)
#define RXD2 14
#define TXD2 15
// WiFi and MQTT Credentials -- These will override the global settings
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
//Logging settings -- Logging will occur when MQTT is disconnected
//#define USE_SD_LOG //Enable SD-card logging
//#define USE_FS_LOG //Enable filesystem (flash) logging
#define LOGBUF_DELAY 10000 // Log Buffer Delay - in milliseconds
#define SD_SS 0 //SD card CS pin (Use different pins for LoRa and SD)
#define LOG_FILENAME "fdrs_log.csv"
#define FS_FILENAME "fdrs_log.csv"
// SPI Configuration -- Needed only on Boards with multiple SPI interfaces like the ESP32
#define SPI_SCK 5
#define SPI_MISO 19
#define SPI_MOSI 27
// LoRa Configuration -- Needed only if using LoRa
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define LORA_BAND 915E6 // LoRa Frequency Band
#define LORA_SF 7 // LoRa Spreading Factor
#define LORA_TXPWR 17 // LoRa TX power in dBm (+2dBm - +20dBm), default is +17dBm.
// Buffer Delays - in milliseconds - Uncomment to enable any buffer
//#define ESPNOW1_DELAY 0
//#define ESPNOW2_DELAY 0
//#define ESPNOWG_DELAY 0
//#define SERIAL_DELAY 0
//#define MQTT_DELAY 0
//#define LORAG_DELAY 1000
//#define LORA1_DELAY 1000
//#define LORA2_DELAY 1000
#define PEER_TIMEOUT 300000
// FastLED -- Not yet fully implemented
//#define USE_LED
#define LED_PIN 32
#define NUM_LEDS 4
// WiFi and MQTT Credentials -- Needed for MQTT only if "fdrs_globals.h" is not included
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
// MQTT Topics
#define TOPIC_DATA "fdrs/data"
#define TOPIC_STATUS "fdrs/status"
#define TOPIC_COMMAND "fdrs/command"
///#define USE_OLED
#define OLED_HEADER "FDRS"
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16

View File

@ -25,76 +25,48 @@
//#define USE_WIFI //Used only for MQTT gateway
// Neighbor addresses
#define ESPNOW_NEIGHBOR_1 0x0E // ESPNOW1 Address
#define ESPNOW_NEIGHBOR_2 0x0F // ESPNOW2 Address
#define ESPNOW_NEIGHBOR_1 0x00 // ESPNOW1 Address
#define ESPNOW_NEIGHBOR_2 0x00 // ESPNOW2 Address
#define LORA_NEIGHBOR_1 0x01 // LoRa1 Address
#define LORA_NEIGHBOR_2 0x0F // LoRa2 Address
#define LORA_NEIGHBOR_2 0x04 // LoRa2 Address
// Neighbor Actions
#define ESPNOW1_ACT
#define ESPNOW2_ACT
#define LORA1_ACT sendSerial(); // This would display packets arriving *from* the front-end.
#define LORA2_ACT
#define LORA1_ACT broadcastLoRa();
#define LORA2_ACT sendLoRaNbr(1);
// LoRa Configuration
#define RADIOLIB_MODULE SX1276 //Tested on SX1276
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
#define LORA_TXPWR 17 // LoRa TX power in dBm (: +2dBm - +17dBm (for SX1276-7) +20dBm (for SX1278))
#define LORA_ACK // Request LoRa acknowledgment.
//Pins for UART data interface (ESP32 only)
#define RXD2 14
#define TXD2 15
// WiFi and MQTT Credentials -- These will override the global settings
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
//Logging settings -- Logging will occur when MQTT is disconnected
//#define USE_SD_LOG //Enable SD-card logging
//#define USE_FS_LOG //Enable filesystem (flash) logging
#define LOGBUF_DELAY 10000 // Log Buffer Delay - in milliseconds
#define SD_SS 0 //SD card CS pin (Use different pins for LoRa and SD)
#define LOG_FILENAME "fdrs_log.csv"
#define FS_FILENAME "fdrs_log.csv"
// SPI Configuration -- Needed only on Boards with multiple SPI interfaces like the ESP32
#define SPI_SCK 5
#define SPI_MISO 19
#define SPI_MOSI 27
// LoRa Configuration -- Needed only if using LoRa
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define LORA_BAND 915E6 // LoRa Frequency Band
#define LORA_SF 7 // LoRa Spreading Factor
#define LORA_TXPWR 17 // LoRa TX power in dBm (+2dBm - +20dBm), default is +17dBm.
// Buffer Delays - in milliseconds - Uncomment to enable any buffer
//#define ESPNOW1_DELAY 0
//#define ESPNOW2_DELAY 0
//#define ESPNOWG_DELAY 0
//#define SERIAL_DELAY 0
//#define MQTT_DELAY 0
//#define LORAG_DELAY 1000
#define LORA1_DELAY 5000
//#define LORA2_DELAY 1000
#define PEER_TIMEOUT 300000
// FastLED -- Not yet fully implemented
//#define USE_LED
#define LED_PIN 32
#define NUM_LEDS 4
// WiFi and MQTT Credentials -- Needed for MQTT only if "fdrs_globals.h" is not included
//#define WIFI_SSID "Your SSID"
//#define WIFI_PASS "Your Password"
//#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"
// MQTT Topics
#define TOPIC_DATA "fdrs/data"
#define TOPIC_STATUS "fdrs/status"
#define TOPIC_COMMAND "fdrs/command"
///#define USE_OLED
#define OLED_HEADER "FDRS"
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16