Farm-Data-Relay-System/Examples/4_UART_Gateway/fdrs_config.h
sensorsiot aee0ada35e Debugging enhanced
Definition of DEBUG in the main sketch (easy to change)
DBG definition
Use Serial2 instead of Serial1 for the ESP32
Changed the concept of UART.IF in the -5 sketch: Debug is always Serial and the ESP32 gets an additional Serial2 for communication

esp_now_peer_info_t peerInfo; seems not needed anymore

added a ROLE definition. With this definition it should be possible to have the same directory for all roles. We can discuss this in Skype if you want
2022-05-21 23:50:45 +02:00

57 lines
1.3 KiB
C

// FARM DATA RELAY SYSTEM
//
// GATEWAY 2.000 Configuration
#include "defaults.h"
#define UNIT_MAC 0x00 // The address of this gateway
//Actions -- Define what happens when a packet arrives at each interface:
//Current function options are: sendESPNOW(MAC), sendSerial(), sendMQTT(), bufferESPNOW(interface), bufferSerial(), and bufferLoRa(interface).
#define ESPNOWG_ACT sendSerial();
#define SERIAL_ACT
#define MQTT_ACT
#define LORAG_ACT sendSerial();
#define USE_LORA
//#define USE_WIFI //Used only for MQTT gateway
#define CREDENTIALS
#if defined (ESP32)
#define RXD2 14
#define TXD2 15
#define UART_IF Serial2
#else
#define UART_IF Serial
#endif
//LoRa Configuration -- Needed only if this device is using LoRa
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
//WiFi Configuration -- Needed only if is using MQTT
#ifdef CREDENTIALS
#include <credentials.h>
#define WIFI_NET mySSID
#define WIFI_PASS myPASSWORD
#define MQTT_ADDR MQTT_BROKER
#define BAND myBAND
#else
#define WIFI_NET "Your SSID"
#define WIFI_PASS "Password"
#define MQTT_ADDR "192.168.0.8"
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 915E6
#endif