mirror of
https://github.com/timmbogner/Farm-Data-Relay-System
synced 2024-11-10 07:10:42 +00:00
Add MQTT port selection and MQTT user/password auth support
This commit is contained in:
parent
3818d88dd5
commit
ec0da25bfe
@ -34,6 +34,13 @@
|
||||
#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
|
||||
|
||||
//MQTT Credentials -- Needed only if MQTT broker requires authentication
|
||||
//#define MQTT_AUTH
|
||||
//#define MQTT_USER "Your MQTT Username"
|
||||
//#define MQTT_PASS "Your MQTT Password"
|
||||
|
||||
// MQTT Topics
|
||||
#define TOPIC_DATA "fdrs/data"
|
||||
#define TOPIC_STATUS "fdrs/status"
|
||||
|
@ -14,12 +14,18 @@
|
||||
#define FDRS_WIFI_SSID GLOBAL_SSID
|
||||
#define FDRS_WIFI_PASS GLOBAL_PASS
|
||||
#define FDRS_MQTT_ADDR GLOBAL_MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT GLOBAL_MQTT_PORT
|
||||
#define FDRS_MQTT_USER GLOBAL_MQTT_USER
|
||||
#define FDRS_MQTT_PASS GLOBAL_MQTT_PASS
|
||||
#define FDRS_BAND GLOBAL_BAND
|
||||
#define FDRS_SF GLOBAL_SF
|
||||
#else
|
||||
#define FDRS_WIFI_SSID WIFI_SSID
|
||||
#define FDRS_WIFI_PASS WIFI_PASS
|
||||
#define FDRS_MQTT_ADDR MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT MQTT_PORT
|
||||
#define FDRS_MQTT_USER MQTT_USER
|
||||
#define FDRS_MQTT_PASS MQTT_PASS
|
||||
#define FDRS_BAND BAND
|
||||
#define FDRS_SF SF
|
||||
#endif
|
||||
@ -100,8 +106,15 @@ PubSubClient client(espClient);
|
||||
const char* ssid = FDRS_WIFI_SSID;
|
||||
const char* password = FDRS_WIFI_PASS;
|
||||
const char* mqtt_server = FDRS_MQTT_ADDR;
|
||||
const int mqtt_port = FDRS_MQTT_PORT;
|
||||
#endif
|
||||
#ifdef MQTT_AUTH
|
||||
const char* mqtt_user = FDRS_MQTT_USER;
|
||||
const char* mqtt_pass = FDRS_MQTT_PASS;
|
||||
#else
|
||||
const char* mqtt_user = null;
|
||||
const char* mqtt_pass = null;
|
||||
#endif
|
||||
|
||||
|
||||
// Set ESP-NOW send and receive callbacks for either ESP8266 or ESP32
|
||||
#if defined(ESP8266)
|
||||
|
@ -34,6 +34,13 @@
|
||||
#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
|
||||
|
||||
//MQTT Credentials -- Needed only if MQTT broker requires authentication
|
||||
//#define MQTT_AUTH
|
||||
//#define MQTT_USER "Your MQTT Username"
|
||||
//#define MQTT_PASS "Your MQTT Password"
|
||||
|
||||
// MQTT Topics
|
||||
#define TOPIC_DATA "fdrs/data"
|
||||
#define TOPIC_STATUS "fdrs/status"
|
||||
|
@ -14,12 +14,18 @@
|
||||
#define FDRS_WIFI_SSID GLOBAL_SSID
|
||||
#define FDRS_WIFI_PASS GLOBAL_PASS
|
||||
#define FDRS_MQTT_ADDR GLOBAL_MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT GLOBAL_MQTT_PORT
|
||||
#define FDRS_MQTT_USER GLOBAL_MQTT_USER
|
||||
#define FDRS_MQTT_PASS GLOBAL_MQTT_PASS
|
||||
#define FDRS_BAND GLOBAL_BAND
|
||||
#define FDRS_SF GLOBAL_SF
|
||||
#else
|
||||
#define FDRS_WIFI_SSID WIFI_SSID
|
||||
#define FDRS_WIFI_PASS WIFI_PASS
|
||||
#define FDRS_MQTT_ADDR MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT MQTT_PORT
|
||||
#define FDRS_MQTT_USER MQTT_USER
|
||||
#define FDRS_MQTT_PASS MQTT_PASS
|
||||
#define FDRS_BAND BAND
|
||||
#define FDRS_SF SF
|
||||
#endif
|
||||
@ -100,8 +106,15 @@ PubSubClient client(espClient);
|
||||
const char* ssid = FDRS_WIFI_SSID;
|
||||
const char* password = FDRS_WIFI_PASS;
|
||||
const char* mqtt_server = FDRS_MQTT_ADDR;
|
||||
const int mqtt_port = FDRS_MQTT_PORT;
|
||||
#endif
|
||||
#ifdef MQTT_AUTH
|
||||
const char* mqtt_user = FDRS_MQTT_USER;
|
||||
const char* mqtt_pass = FDRS_MQTT_PASS;
|
||||
#else
|
||||
const char* mqtt_user = null;
|
||||
const char* mqtt_pass = null;
|
||||
#endif
|
||||
|
||||
|
||||
// Set ESP-NOW send and receive callbacks for either ESP8266 or ESP32
|
||||
#if defined(ESP8266)
|
||||
|
@ -67,6 +67,13 @@
|
||||
#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
|
||||
|
||||
//MQTT Credentials -- Needed only if MQTT broker requires authentication
|
||||
//#define MQTT_AUTH
|
||||
//#define MQTT_USER "Your MQTT Username"
|
||||
//#define MQTT_PASS "Your MQTT Password"
|
||||
|
||||
// MQTT Topics
|
||||
#define TOPIC_DATA "fdrs/data"
|
||||
#define TOPIC_STATUS "fdrs/status"
|
||||
|
@ -14,12 +14,18 @@
|
||||
#define FDRS_WIFI_SSID GLOBAL_SSID
|
||||
#define FDRS_WIFI_PASS GLOBAL_PASS
|
||||
#define FDRS_MQTT_ADDR GLOBAL_MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT GLOBAL_MQTT_PORT
|
||||
#define FDRS_MQTT_USER GLOBAL_MQTT_USER
|
||||
#define FDRS_MQTT_PASS GLOBAL_MQTT_PASS
|
||||
#define FDRS_BAND GLOBAL_BAND
|
||||
#define FDRS_SF GLOBAL_SF
|
||||
#else
|
||||
#define FDRS_WIFI_SSID WIFI_SSID
|
||||
#define FDRS_WIFI_PASS WIFI_PASS
|
||||
#define FDRS_MQTT_ADDR MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT MQTT_PORT
|
||||
#define FDRS_MQTT_USER MQTT_USER
|
||||
#define FDRS_MQTT_PASS MQTT_PASS
|
||||
#define FDRS_BAND BAND
|
||||
#define FDRS_SF SF
|
||||
#endif
|
||||
@ -100,8 +106,15 @@ PubSubClient client(espClient);
|
||||
const char* ssid = FDRS_WIFI_SSID;
|
||||
const char* password = FDRS_WIFI_PASS;
|
||||
const char* mqtt_server = FDRS_MQTT_ADDR;
|
||||
const int mqtt_port = FDRS_MQTT_PORT;
|
||||
#endif
|
||||
#ifdef MQTT_AUTH
|
||||
const char* mqtt_user = FDRS_MQTT_USER;
|
||||
const char* mqtt_pass = FDRS_MQTT_PASS;
|
||||
#else
|
||||
const char* mqtt_user = null;
|
||||
const char* mqtt_pass = null;
|
||||
#endif
|
||||
|
||||
|
||||
// Set ESP-NOW send and receive callbacks for either ESP8266 or ESP32
|
||||
#if defined(ESP8266)
|
||||
|
@ -67,6 +67,13 @@
|
||||
#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
|
||||
|
||||
//MQTT Credentials -- Needed only if MQTT broker requires authentication
|
||||
//#define MQTT_AUTH
|
||||
//#define MQTT_USER "Your MQTT Username"
|
||||
//#define MQTT_PASS "Your MQTT Password"
|
||||
|
||||
// MQTT Topics
|
||||
#define TOPIC_DATA "fdrs/data"
|
||||
#define TOPIC_STATUS "fdrs/status"
|
||||
|
@ -19,12 +19,18 @@
|
||||
#define FDRS_WIFI_SSID GLOBAL_SSID
|
||||
#define FDRS_WIFI_PASS GLOBAL_PASS
|
||||
#define FDRS_MQTT_ADDR GLOBAL_MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT GLOBAL_MQTT_PORT
|
||||
#define FDRS_MQTT_USER GLOBAL_MQTT_USER
|
||||
#define FDRS_MQTT_PASS GLOBAL_MQTT_PASS
|
||||
#define FDRS_BAND GLOBAL_BAND
|
||||
#define FDRS_SF GLOBAL_SF
|
||||
#else
|
||||
#define FDRS_WIFI_SSID WIFI_SSID
|
||||
#define FDRS_WIFI_PASS WIFI_PASS
|
||||
#define FDRS_MQTT_ADDR MQTT_ADDR
|
||||
#define FDRS_MQTT_PORT MQTT_PORT
|
||||
#define FDRS_MQTT_USER MQTT_USER
|
||||
#define FDRS_MQTT_PASS MQTT_PASS
|
||||
#define FDRS_BAND BAND
|
||||
#define FDRS_SF SF
|
||||
#endif
|
||||
@ -105,8 +111,15 @@ PubSubClient client(espClient);
|
||||
const char* ssid = FDRS_WIFI_SSID;
|
||||
const char* password = FDRS_WIFI_PASS;
|
||||
const char* mqtt_server = FDRS_MQTT_ADDR;
|
||||
const int mqtt_port = FDRS_MQTT_PORT;
|
||||
#endif
|
||||
#ifdef MQTT_AUTH
|
||||
const char* mqtt_user = FDRS_MQTT_USER;
|
||||
const char* mqtt_pass = FDRS_MQTT_PASS;
|
||||
#else
|
||||
const char* mqtt_user = null;
|
||||
const char* mqtt_pass = null;
|
||||
#endif
|
||||
|
||||
|
||||
// Set ESP-NOW send and receive callbacks for either ESP8266 or ESP32
|
||||
#if defined(ESP8266)
|
||||
|
Loading…
Reference in New Issue
Block a user