2 ‐ Configuration - tk5ep/WX-station-LoRa-WiFi GitHub Wiki
-
Chose the board you will be using :
Open the platformio.ini file and uncomment the board you want to use.
The example below is for a LilyGo T3 v1.6 board.
-
Modify the settings to fit your needs :
Open the settings.h file and comment/uncomment the parameters to fit your needs.
The lines have enough comments to explain what they do. Here some explanations...
DEBUGGING
If you need some debugging, it makes the serial port more verbose.
In case of trouble with the i2C devices for example, you can select the DEBUG_I2C option. At startup, all i2C devices are scanned and displayed.
//#define DEBUG_RAIN // debug the rain function
//#define DEBUG_WIND // debug the win function
//#define DEBUG_BME // debug the BME sensors
//#define DEBUG_SHT // debug the SHT31 sensor
//#define DEBUG_TIME // debug the time routine
//#define DEBUG_WG // debug the Wunderground routine
//#define DEBUG_RS485 // debug the RS485 protocol
//#define DEBUG_NTP // debug the NTP routine
//#define DEBUG_BAT // debug the battery routine
//#define DEBUG_I2C // launch i2C scanner at startup
DISPLAY
//#define HAS_SH110X // remove "//"" if using a SH110X OLED display instead of SSD1306
const byte ECOMODE = 2; // screensaver 0=OFF 1=PERMANENT 2=ONLY BETWEEN TX
const bool DISPLAY_CARDINAL = false; // display directions on OLED. true = cardinal. false = degrees
If you want to use a OLED display that uses the SH1106 driver (mainly 1.3" wide), uncomment this line.
The T3 module and other boards have onboard 0.96" displays, so this is not recommanded. Normally, the software takes care of this.
PROTOCOLS
#define WITH_APRS_LORA // use APRS LoRa or not
//#define WITH_APRS_IS // use APRS-IS instead of APRS via LoRa<
#define WITH_WIFI // needed for MQTT, WUNDERGROUND, APRS-IS and WEBPAGE
#define WITH_WUNDERGROUND // send WX repots to Wunderground
#define WITH_MQTT // use MQTT broker or not
#define SEND_BAT_INFO // send battery voltage in APRS packets
Only ONE APRS protocol is wanted. Either LoRa on 433.775 MHz or APRS-IS via Internet.
Normally the software takes care of this.
If you don't have any WiFi access, comment the line "define WITH_WIFI", this deselect all protocols that need an Internet access.
SENSORS
#define WITH_BME280
//#define WITH_BMP280
//#define WITH_BME680
//#define WITH_SHT31
//#define WITH_RAIN // comment if NO rain sensor
//#define WITH_WIND
const float rainBucketCont = 0.28; // rain sensor bucket containance in mm of water, depends on model
Comment out the lines to match your sensors.
Only one of the 3 possible combined sensors.
STATION
const String CALLSIGN = "NOCALL-13"; // callsign with SSID ex TK5EP-13
cont float latitude = 41.9491; // latitude in DD.MMMM
const float longitude = 8.75438; // longitude in DD.MMM
const uint16_t ALTITUDE = 60; // home altitude in meters
#define WITH_SEALEVELPRESSURE // if pressure corrected to sealevel is wanted
You can use my online map to get correct APRS coordinates : http://egloff.eu/qralocator
APRS LoRa
const float TXFREQUENCY = 433.775; // TX frequency in MHz
const int TXPERIOD = 120; // TX period in seconds
const int TXPOWER = 20; // power in dBm
#define COMMENT "" // short info in beacon. Leave blank if not wanted
#define WITH_DIGIPEATING // if we want the APRS frames to be repeated (adds WIDE1-1)
Adjust TXPERIOD to your needs. 600 (10 minutes) is probably enough, as this is the update rate for WX stations on the APRS network.
APRS-IS
#define APRS_IS_PASSWD "11111" // APRS IS password, get it at https://apps.magicbug.co.uk/passcode/
#define APRS_IS_SERVER "rotate.aprs.net" // APRS server address, ie rotate.aprs.net
const int APRS_IS_SERVER_PORT = 14580; // APRS server port, default 14580
WIFI
#define wifi_ssid "WIFI_SSID" // Change this to your WiFi SSID
#define wifi_password "WIFI_PWD" // Change this to your WiFi password
//#define WITH_STATIC_IP // true=static address or false=DHCP
const IPAddress local_IP(44, 168, 80, 141); // Set your Static IP address like xxx,xxx,xxx,xxx
const IPAddress gateway(44, 168, 80, 129); // Set your Gateway IP address
const IPAddress subnet(255, 255, 255, 240); // Set your subnet mask
const IPAddress primaryDNS(44, 168, 80, 129); // optional, put 8.8.8.8 if you don't know
WUNDERGOUND
#define WG_server "weatherstation.wunderground.com" // Wunderground server address
#define WG_ID "WG_ID" // Your WunderGround ID. You need to register to get this ID and Key
`#define WG_PWD "WG_KEY" // Your WunderGround key
MQTT
#define mqtt_broker "broker_address" // the MQTT server
const int mqtt_port = 1883; // MQTT server port 1883 by default
const byte mqtt_retained = 0; // should the datas be retained ?
#define mqtt_username "" // MQTT server username if needed, leave blank if not
#define mqtt_password "" // MQTT server password if needed, leave blank if not
#define TOPIC_TEMP "wx/home/temp" // topic for the temperature
#define TOPIC_HUMI "wx/home/humi" // topic for the humidity
#define TOPIC_PRESS "wx/home/press" // topic for the pressure
#define TOPIC_WINDSPEED "wx/home/windspeed" // topic for the wind speed
#define TOPIC_WINDDIR "wx/home/winddir" // topic for the wind direction
#define TOPIC_GUSTSPEED "wx/home/gustspeed" // topic for the wind speed
#define TOPIC_GUSTDIR "wx/home/gustdir" // topic for the wind direction
#define TOPIC_RAIN1H "wx/home/rain1h" // topic for the rain fall
#define TOPIC_RAIN24H "wx/home/rain24h" // topic for the 24 h rain fall
#define TOPIC_WINDSPEEDSENSOR "wx/home/windspeedsensor" // topic to check if the RS485 dialog is OK
#define TOPIC_WINDDIRSENSOR "wx/home/winddirsensor" // topic to check if the RS485 dialog is OK
#define TOPIC_BATTERYVOLTAGE "wx/home/batteryvoltage"
// topic to monitor the battery voltage`
OTA
#define OTA_username "root" // OTA access login
#define OTA_password "password" // OTA access password
NTP
// last sunday in march 2:00, timetone +120min (+1 GMT + 1h summertime offset)
#define DSTzone "CEST"
const int8_t DSTweek = 0; //Last, First, Second, Third, Fourth (0 - 4)
const int8_t DSTwday = 0; // Sun, Mon, Tue, Wed, Thu, Fri, Sat (0 - 7)
const int8_t DSTmonth = 3;
const int8_t DSTday = 2;
const int8_t DSToffset = 120;
// last sunday in october 3:00, timezone +60min (+1 GMT)
#define STDzone "CET"
const int8_t STDweek = 0; //Last, First, Second, Third, Fourth (0 - 4)
const int8_t STDwday = 0; // Sun, Mon, Tue, Wed, Thu, Fri, Sat (0 - 7)
const int8_t STDmonth = 10;
const int8_t STDday = 3;
const int8_t STDoffset = 60;
Adjust your own daylight saving time parameters here
http://www.timezoneconverter.com/cgi-bin/zoneinfo?s=standard&tz=Europe/Paris