Added a default.h file to the sensors files

and took the else out (no more needed because now defined in default.h
Added band in default.h

Band should be renamed to FREQUENCY (because it defines the frequency)
This commit is contained in:
sensorsiot 2022-05-22 09:37:13 +02:00
parent e47bbc4906
commit 027a75df60
9 changed files with 107 additions and 51 deletions

View File

@ -0,0 +1,45 @@
#define UNIT_MAC 0xFC // THIS UNIT
#define ESPNOW1_PEER 0xFD // ESPNOW1 Address
#define ESPNOW2_PEER 0xFE // ESPNOW2 Address
#define LORA1_PEER 0xFD // LoRa1 Address
#define LORA2_PEER 0xFE // LoRa2 Address
#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 ESPNOW1_ACT
#define ESPNOW2_ACT
#define ESPNOWG_ACT
#define SERIAL_ACT
#define MQTT_ACT
#define LORAG_ACT
#define LORA1_ACT
#define LORA2_ACT
//#define RXD2 21
//#define TXD2 22
//#define USE_LORA
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 915E6
//#define USE_LED
#define LED_PIN 32
#define NUM_LEDS 4
#define MAC_PREFIX 0xAA, 0xBB, 0xCC, 0xDD, 0xEE

View File

@ -23,7 +23,7 @@
#define RST 14 #define RST 14
#define DIO0 26 #define DIO0 26
#include "defaults.h"
#ifdef CREDENTIALS #ifdef CREDENTIALS
#include <credentials.h> #include <credentials.h>
#define WIFI_NET mySSID #define WIFI_NET mySSID
@ -31,15 +31,6 @@
#define MQTT_ADDR MQTT_BROKER #define MQTT_ADDR MQTT_BROKER
#define BAND myBAND #define BAND myBAND
#define SF mySF #define SF mySF
#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 #endif
typedef struct __attribute__((packed)) DataReading { typedef struct __attribute__((packed)) DataReading {

View File

@ -0,0 +1,45 @@
#define UNIT_MAC 0xFC // THIS UNIT
#define ESPNOW1_PEER 0xFD // ESPNOW1 Address
#define ESPNOW2_PEER 0xFE // ESPNOW2 Address
#define LORA1_PEER 0xFD // LoRa1 Address
#define LORA2_PEER 0xFE // LoRa2 Address
#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 ESPNOW1_ACT
#define ESPNOW2_ACT
#define ESPNOWG_ACT
#define SERIAL_ACT
#define MQTT_ACT
#define LORAG_ACT
#define LORA1_ACT
#define LORA2_ACT
//#define RXD2 21
//#define TXD2 22
//#define USE_LORA
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 915E6
//#define USE_LED
#define LED_PIN 32
#define NUM_LEDS 4
#define MAC_PREFIX 0xAA, 0xBB, 0xCC, 0xDD, 0xEE

View File

@ -22,21 +22,13 @@
#define RST 14 #define RST 14
#define DIO0 26 #define DIO0 26
#include "defaults.h"
#ifdef CREDENTIALS #ifdef CREDENTIALS
#include <credentials.h> #include <credentials.h>
#define WIFI_NET mySSID #define WIFI_NET mySSID
#define WIFI_PASS myPASSWORD #define WIFI_PASS myPASSWORD
#define MQTT_ADDR MQTT_BROKER #define MQTT_ADDR MQTT_BROKER
#define BAND myBAND #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 #endif
typedef struct __attribute__((packed)) DataReading { typedef struct __attribute__((packed)) DataReading {

View File

@ -29,6 +29,11 @@
#define WIFI_PASS "Password" #define WIFI_PASS "Password"
#define MQTT_ADDR "192.168.0.8" #define MQTT_ADDR "192.168.0.8"
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 915E6
//#define USE_LORA //#define USE_LORA
#define SCK 5 #define SCK 5
#define MISO 19 #define MISO 19

View File

@ -35,19 +35,11 @@
#define RST 14 #define RST 14
#define DIO0 26 #define DIO0 26
// default.h values are overwritten by the #defines of credentials.h files in the library folder
#ifdef CREDENTIALS #ifdef CREDENTIALS
#include <credentials.h> #include <credentials.h>
#define WIFI_NET mySSID #define WIFI_NET mySSID
#define WIFI_PASS myPASSWORD #define WIFI_PASS myPASSWORD
#define MQTT_ADDR MQTT_BROKER #define MQTT_ADDR MQTT_BROKER
#define BAND myBAND #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 #endif

View File

@ -33,6 +33,11 @@
#define RST 14 #define RST 14
#define DIO0 26 #define DIO0 26
//433E6 for Asia
//866E6 for Europe
//915E6 for North America
#define BAND 915E6
//#define USE_LED //#define USE_LED
#define LED_PIN 32 #define LED_PIN 32
#define NUM_LEDS 4 #define NUM_LEDS 4

View File

@ -35,9 +35,7 @@
#define RST 14 #define RST 14
#define DIO0 26 #define DIO0 26
//WiFi Configuration -- Needed only if is using MQTT // default.h values are overwritten by the #defines of credentials.h files in the library folder
#ifdef CREDENTIALS #ifdef CREDENTIALS
#include <credentials.h> #include <credentials.h>
#define WIFI_NET mySSID #define WIFI_NET mySSID
@ -45,13 +43,4 @@
#define MQTT_ADDR MQTT_BROKER #define MQTT_ADDR MQTT_BROKER
#define BAND myBAND #define BAND myBAND
#define SF mySF #define SF mySF
#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 #endif

View File

@ -36,19 +36,11 @@
#define DIO0 26 #define DIO0 26
// default.h values are overwritten by the #defines of credentials.h files in the library folder
#ifdef CREDENTIALS #ifdef CREDENTIALS
#include <credentials.h> #include <credentials.h>
#define WIFI_NET mySSID #define WIFI_NET mySSID
#define WIFI_PASS myPASSWORD #define WIFI_PASS myPASSWORD
#define MQTT_ADDR MQTT_BROKER #define MQTT_ADDR MQTT_BROKER
#define BAND myBAND #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 #endif