Skip to content

Commit

Permalink
Merge pull request #162 from matthias-bs/fix-rtc-setting-from-sntp
Browse files Browse the repository at this point in the history
BresserWeatherSensorMQTTWifiMgr.ino: Fixed setting of real time clock via SNTP in case of USE_WIFI is set
  • Loading branch information
matthias-bs committed May 3, 2024
2 parents eae36c9 + eddaa2d commit a3fe788
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
// Added formatting of LittleFS partition if mounting failed
// 20240209 Added Leakage, Air Quality (HCHO/VOC) and CO2 Sensors
// 20240213 Added PM1.0 to Air Quality (Particulate Matter) Sensor decoder
// 20240503 Fixed setting of RTC via SNTP in case on non-secure WiFi config
//
// ToDo:
//
Expand Down Expand Up @@ -599,8 +600,7 @@ void wifimgr_setup(void)
*/
void mqtt_setup(void)
{
#ifdef USE_SECUREWIFI
// Note: TLS security needs correct time
// Note: TLS security, raingauge and lightning need correct time
log_i("Setting time using SNTP");
configTime(TIMEZONE * 3600, 0, "pool.ntp.org", "time.nist.gov");
time_t now = time(nullptr);
Expand All @@ -623,6 +623,7 @@ void mqtt_setup(void)
gmtime_r(&now, &timeinfo);
log_i("Current time (GMT): %s", asctime(&timeinfo));

#ifdef USE_SECUREWIFI
#if defined(ESP8266)
#ifdef CHECK_CA_ROOT
BearSSL::X509List cert(digicert);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BresserWeatherSensorReceiver
version=0.27.2
version=0.27.3
author=Matthias Prinke <matthias-bs@web.de>
maintainer=Matthias Prinke <matthias-bs@web.de>
sentence=Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BresserWeatherSensorReceiver",
"version": "0.27.2",
"version": "0.27.3",
"description": "Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262",
"main": "WeatherSensor.cpp",
"frameworks": "arduino",
Expand Down

0 comments on commit a3fe788

Please sign in to comment.