[SYS] Bump ESP32 platform to v6.1.0 and ESP8266 to v4.1.0 (#1547)

* Bump ESP32 platform to v6.1.0 and ESP8266 to v4.1.0

* Fix ESP32 not connecting to Ethernet

And remove check updates as it is now done every hour

* Do not define LED pins if not explicitly stated

* OLED need to be reset for Heltec Lora 32 V2

* Fix issue with SSD1306 saving
This commit is contained in:
Florian authored and GitHub committed 2023-03-23 11:24:49 -05:00
1 parent 537d4849e5
commit 86744b283b
6 files changed
+75 -55

No files matched your search

+4 -4
View File
@@ -1510,7 +1510,7 @@ build_flags =
custom_description = Default BLE gateway with additional servicedata, manufacturerdata and service uuid for analysing decoding issues custom_description = Default BLE gateway with additional servicedata, manufacturerdata and service uuid for analysing decoding issues
[env:esp32s3-dev-c1-ble] [env:esp32s3-dev-c1-ble]
platform = ${com.esp32_c3_s3_platform} platform = ${com.esp32_platform}
board = esp32-s3-devkitc-1 board = esp32-s3-devkitc-1
lib_deps = lib_deps =
${com-esp.lib_deps} ${com-esp.lib_deps}
@@ -1530,7 +1530,7 @@ build_flags =
custom_description = BLE gateway on the S3 custom_description = BLE gateway on the S3
[env:esp32c3-dev-m1-ble] [env:esp32c3-dev-m1-ble]
platform = ${com.esp32_c3_s3_platform} platform = ${com.esp32_platform}
board = esp32-c3-devkitm-1 board = esp32-c3-devkitm-1
board_build.partitions = min_spiffs.csv board_build.partitions = min_spiffs.csv
lib_deps = lib_deps =
@@ -1551,7 +1551,7 @@ build_flags =
custom_description = BLE gateway on the C3 custom_description = BLE gateway on the C3
[env:airm2m_core_esp32c3] [env:airm2m_core_esp32c3]
platform = ${com.esp32_c3_s3_platform} platform = ${com.esp32_platform}
board = airm2m_core_esp32c3 board = airm2m_core_esp32c3
board_build.partitions = min_spiffs.csv board_build.partitions = min_spiffs.csv
lib_deps = lib_deps =
@@ -1571,7 +1571,7 @@ custom_hardware = AirM2M ESP32C3-CORE
; Wemos Lolin C3 mini v2.1.0 ; Wemos Lolin C3 mini v2.1.0
[env:lolin_c3_mini] [env:lolin_c3_mini]
;platform = ${com.esp32_c3_s3_platform} ; standard is @5.2.0, causes `assert rwble.c 261` error ;platform = ${com.esp32_platform} ; standard is @5.2.0, causes `assert rwble.c 261` error
platform = espressif32@5.3.0 ; override to @5.3.0. Includes a fixed for the `assert rwble.c 261` error platform = espressif32@5.3.0 ; override to @5.3.0. Includes a fixed for the `assert rwble.c 261` error
board = lolin_c3_mini board = lolin_c3_mini
board_build.partitions = min_spiffs.csv board_build.partitions = min_spiffs.csv
+53 -29
View File
@@ -417,13 +417,13 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
/*-------------DEFINE PINs FOR STATUS LEDs----------------*/ /*-------------DEFINE PINs FOR STATUS LEDs----------------*/
# ifndef LED_SEND_RECEIVE # ifndef LED_SEND_RECEIVE
# ifdef ESP8266 # ifdef ESP8266
# define LED_SEND_RECEIVE 40 //# define LED_SEND_RECEIVE 40
# elif ESP32 # elif ESP32
# define LED_SEND_RECEIVE 40 //# define LED_SEND_RECEIVE 40
# elif __AVR_ATmega2560__ //arduino mega # elif __AVR_ATmega2560__ //arduino mega
# define LED_SEND_RECEIVE 40 //# define LED_SEND_RECEIVE 40
# else //arduino uno/nano # else //arduino uno/nano
# define LED_SEND_RECEIVE 40 //# define LED_SEND_RECEIVE 40
# endif # endif
# endif # endif
# ifndef LED_SEND_RECEIVE_ON # ifndef LED_SEND_RECEIVE_ON
@@ -431,13 +431,13 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
# endif # endif
# ifndef LED_ERROR # ifndef LED_ERROR
# ifdef ESP8266 # ifdef ESP8266
# define LED_ERROR 42 //# define LED_ERROR 42
# elif ESP32 # elif ESP32
# define LED_ERROR 42 //# define LED_ERROR 42
# elif __AVR_ATmega2560__ //arduino mega # elif __AVR_ATmega2560__ //arduino mega
# define LED_ERROR 42 //# define LED_ERROR 42
# else //arduino uno/nano # else //arduino uno/nano
# define LED_ERROR 42 //# define LED_ERROR 42
# endif # endif
# endif # endif
# ifndef LED_ERROR_ON # ifndef LED_ERROR_ON
@@ -445,36 +445,57 @@ int lowpowermode = DEFAULT_LOW_POWER_MODE;
# endif # endif
# ifndef LED_INFO # ifndef LED_INFO
# ifdef ESP8266 # ifdef ESP8266
# define LED_INFO 44 //# define LED_INFO 44
# elif ESP32 # elif ESP32
# define LED_INFO 44 //# define LED_INFO 44
# elif __AVR_ATmega2560__ //arduino mega # elif __AVR_ATmega2560__ //arduino mega
# define LED_INFO 44 //# define LED_INFO 44
# else //arduino uno/nano # else //arduino uno/nano
# define LED_INFO 44 //# define LED_INFO 44
# endif # endif
# endif # endif
# ifndef LED_INFO_ON # ifndef LED_INFO_ON
# define LED_INFO_ON HIGH # define LED_INFO_ON HIGH
# endif # endif
# define SetupIndicators() \
pinMode(LED_SEND_RECEIVE, OUTPUT); \
pinMode(LED_INFO, OUTPUT); \
pinMode(LED_ERROR, OUTPUT); \
SendReceiveIndicatorOFF(); \
InfoIndicatorOFF(); \
ErrorIndicatorOFF();
# define ErrorIndicatorON() digitalWrite(LED_ERROR, LED_ERROR_ON) # ifdef LED_ERROR
# define ErrorIndicatorOFF() digitalWrite(LED_ERROR, !LED_ERROR_ON) # define SetupIndicatorError() \
# define SendReceiveIndicatorON() digitalWrite(LED_SEND_RECEIVE, LED_SEND_RECEIVE_ON) pinMode(LED_ERROR, OUTPUT); \
# define SendReceiveIndicatorOFF() digitalWrite(LED_SEND_RECEIVE, !LED_SEND_RECEIVE_ON) ErrorIndicatorOFF();
# define InfoIndicatorON() digitalWrite(LED_INFO, LED_INFO_ON) # define ErrorIndicatorON() digitalWrite(LED_ERROR, LED_ERROR_ON)
# define InfoIndicatorOFF() digitalWrite(LED_INFO, !LED_INFO_ON) # define ErrorIndicatorOFF() digitalWrite(LED_ERROR, !LED_ERROR_ON)
# define CriticalIndicatorON() // Not used # else
# define CriticalIndicatorON() // Not used # define SetupIndicatorError()
# define PowerIndicatorON() // Not used # define ErrorIndicatorON()
# define PowerIndicatorOFF() // Not used # define ErrorIndicatorOFF()
# endif
# ifdef LED_SEND_RECEIVE
# define SetupIndicatorSendReceive() \
pinMode(LED_SEND_RECEIVE, OUTPUT); \
SendReceiveIndicatorOFF();
# define SendReceiveIndicatorON() digitalWrite(LED_SEND_RECEIVE, LED_SEND_RECEIVE_ON)
# define SendReceiveIndicatorOFF() digitalWrite(LED_SEND_RECEIVE, !LED_SEND_RECEIVE_ON)
# else
# define SetupIndicatorSendReceive()
# define SendReceiveIndicatorON()
# define SendReceiveIndicatorOFF()
# endif
# ifdef LED_INFO
# define SetupIndicatorInfo() \
pinMode(LED_INFO, OUTPUT); \
InfoIndicatorOFF();
# define InfoIndicatorON() digitalWrite(LED_INFO, LED_INFO_ON)
# define InfoIndicatorOFF() digitalWrite(LED_INFO, !LED_INFO_ON)
# else
# define SetupIndicatorInfo()
# define InfoIndicatorON()
# define InfoIndicatorOFF()
# endif
# define CriticalIndicatorON() // Not used
# define CriticalIndicatorON() // Not used
# define PowerIndicatorON() // Not used
# define PowerIndicatorOFF() // Not used
# define SetupIndicators() // Not used
#else // Management of Errors, reception/emission and informations indicators with RGB LED #else // Management of Errors, reception/emission and informations indicators with RGB LED
# if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3) //I2S not available yet with Fastled on S3 and C3 # if !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(CONFIG_IDF_TARGET_ESP32C3) //I2S not available yet with Fastled on S3 and C3
# define FASTLED_ESP32_I2S // To avoid ESP32 instabilities https://github.com/FastLED/FastLED/issues/1438 # define FASTLED_ESP32_I2S // To avoid ESP32 instabilities https://github.com/FastLED/FastLED/issues/1438
@@ -549,6 +570,9 @@ CRGB leds2[FASTLED_IND_NUM_LEDS];
leds2[FASTLED_INFO_LED] = CRGB::Black; \ leds2[FASTLED_INFO_LED] = CRGB::Black; \
FastLED.show() FastLED.show()
# endif # endif
# define SetupIndicatorInfo()
# define SetupIndicatorSendReceive()
# define SetupIndicatorError()
#endif #endif
#ifdef ESP8266 #ifdef ESP8266
+7 -9
View File
@@ -174,10 +174,7 @@ void MQTTtoSSD1306(char* topicOri, JsonObject& SSD1306data) { // json object dec
} }
// save, load, init, erase // save, load, init, erase
if (SSD1306data.containsKey("save") && SSD1306data["save"]) { if (SSD1306data.containsKey("save") && SSD1306data["save"]) {
success = SSD1306Config_save(); SSD1306Config_save();
if (success) {
Log.notice(F("SSD1306 config saved" CR));
}
} else if (SSD1306data.containsKey("load") && SSD1306data["load"]) { } else if (SSD1306data.containsKey("load") && SSD1306data["load"]) {
success = SSD1306Config_load(); success = SSD1306Config_load();
if (success) { if (success) {
@@ -207,7 +204,7 @@ void MQTTtoSSD1306(char* topicOri, JsonObject& SSD1306data) { // json object dec
} }
} }
bool SSD1306Config_save() { void SSD1306Config_save() {
StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer; StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer;
JsonObject jo = jsonBuffer.to<JsonObject>(); JsonObject jo = jsonBuffer.to<JsonObject>();
jo["onstate"] = displayState; jo["onstate"] = displayState;
@@ -223,6 +220,7 @@ bool SSD1306Config_save() {
preferences.begin(Gateway_Short_Name, false); preferences.begin(Gateway_Short_Name, false);
preferences.putString("SSD1306Config", conf); preferences.putString("SSD1306Config", conf);
preferences.end(); preferences.end();
Log.notice(F("SSD1306 config saved" CR));
} }
void SSD1306Config_init() { void SSD1306Config_init() {
@@ -827,10 +825,10 @@ OledSerial Oled(0); // Not sure about this, came from Hardwareserial
OledSerial::OledSerial(int x) { OledSerial::OledSerial(int x) {
displayQueue = xQueueCreate(5, sizeof(displayQueueMessage*)); displayQueue = xQueueCreate(5, sizeof(displayQueueMessage*));
# if defined(WIFI_Kit_32) || defined(WIFI_LoRa_32) || defined(WIFI_LoRa_32_V2) # if defined(WIFI_Kit_32) || defined(WIFI_LoRa_32) || defined(WIFI_LoRa_32_V2)
// pinMode(RST_OLED, OUTPUT); // https://github.com/espressif/arduino-esp32/issues/4278 pinMode(RST_OLED, OUTPUT); // https://github.com/espressif/arduino-esp32/issues/4278
// digitalWrite(RST_OLED, LOW); digitalWrite(RST_OLED, LOW);
// delay(50); delay(50);
// digitalWrite(RST_OLED, HIGH); digitalWrite(RST_OLED, HIGH);
display = new SSD1306Wire(0x3c, SDA_OLED, SCL_OLED, GEOMETRY_128_64); display = new SSD1306Wire(0x3c, SDA_OLED, SCL_OLED, GEOMETRY_128_64);
# elif defined(Wireless_Stick) # elif defined(Wireless_Stick)
// pinMode(RST_OLED, OUTPUT); // https://github.com/espressif/arduino-esp32/issues/4278 // pinMode(RST_OLED, OUTPUT); // https://github.com/espressif/arduino-esp32/issues/4278
-2
View File
@@ -80,8 +80,6 @@ struct RTL_433device {
bool isDisc; bool isDisc;
}; };
extern std::vector<RTL_433device*> RTL_433devices;
const char parameters[40][4][24] = { const char parameters[40][4][24] = {
// RTL_433 key, name, unit, device_class // RTL_433 key, name, unit, device_class
{"temperature_C", "temperature", "°C", "temperature"}, {"temperature_C", "temperature", "°C", "temperature"},
+9 -8
View File
@@ -755,7 +755,10 @@ void setup() {
checkButton(); checkButton();
#endif #endif
//setup LED status //setup LED status
SetupIndicators(); SetupIndicatorError();
SetupIndicatorSendReceive();
SetupIndicatorInfo();
SetupIndicators(); // For RGB Leds
#if defined(ESP8266) || defined(ESP32) #if defined(ESP8266) || defined(ESP32)
# ifdef ESP8266 # ifdef ESP8266
@@ -1492,24 +1495,24 @@ void setup_ethernet_esp32() {
void WiFiEvent(WiFiEvent_t event) { void WiFiEvent(WiFiEvent_t event) {
switch (event) { switch (event) {
case SYSTEM_EVENT_ETH_START: case ARDUINO_EVENT_ETH_START:
Log.trace(F("Ethernet Started" CR)); Log.trace(F("Ethernet Started" CR));
ETH.setHostname(gateway_name); ETH.setHostname(gateway_name);
break; break;
case SYSTEM_EVENT_ETH_CONNECTED: case ARDUINO_EVENT_ETH_CONNECTED:
Log.notice(F("Ethernet Connected" CR)); Log.notice(F("Ethernet Connected" CR));
break; break;
case SYSTEM_EVENT_ETH_GOT_IP: case ARDUINO_EVENT_ETH_GOT_IP:
Log.trace(F("OpenMQTTGateway MAC: %s" CR), ETH.macAddress().c_str()); Log.trace(F("OpenMQTTGateway MAC: %s" CR), ETH.macAddress().c_str());
Log.trace(F("OpenMQTTGateway IP: %s" CR), ETH.localIP().toString().c_str()); Log.trace(F("OpenMQTTGateway IP: %s" CR), ETH.localIP().toString().c_str());
Log.trace(F("OpenMQTTGateway link speed: %d Mbps" CR), ETH.linkSpeed()); Log.trace(F("OpenMQTTGateway link speed: %d Mbps" CR), ETH.linkSpeed());
esp32EthConnected = true; esp32EthConnected = true;
break; break;
case SYSTEM_EVENT_ETH_DISCONNECTED: case ARDUINO_EVENT_ETH_DISCONNECTED:
Log.error(F("Ethernet Disconnected" CR)); Log.error(F("Ethernet Disconnected" CR));
esp32EthConnected = false; esp32EthConnected = false;
break; break;
case SYSTEM_EVENT_ETH_STOP: case ARDUINO_EVENT_ETH_STOP:
Log.error(F("Ethernet Stopped" CR)); Log.error(F("Ethernet Stopped" CR));
esp32EthConnected = false; esp32EthConnected = false;
break; break;
@@ -2178,8 +2181,6 @@ void MQTTHttpsFWUpdate(char* topicOri, JsonObject& HttpsFwUpdateData) {
# if defined(ZgatewayBT) # if defined(ZgatewayBT)
stopProcessing(); stopProcessing();
# endif # endif
if (!checkForUpdates())
return;
systemUrl = RELEASE_LINK + latestVersion + "/" + ENV_NAME + "-firmware.bin"; systemUrl = RELEASE_LINK + latestVersion + "/" + ENV_NAME + "-firmware.bin";
url = systemUrl.c_str(); url = systemUrl.c_str();
Log.notice(F("Using system OTA url with latest version %s" CR), url); Log.notice(F("Using system OTA url with latest version %s" CR), url);
+2 -3
View File
@@ -169,9 +169,8 @@ build_flags =
monitor_speed = 115200 monitor_speed = 115200
[com] [com]
esp8266_platform = espressif8266@3.2.0 esp8266_platform = espressif8266@4.1.0
esp32_platform = espressif32@3.5.0 esp32_platform = espressif32@6.1.0
esp32_c3_s3_platform = espressif32@5.2.0
esp32_solo_platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.5/platform-espressif32-v.2.0.5.zip esp32_solo_platform = https://github.com/tasmota/platform-espressif32/releases/download/v.2.0.5/platform-espressif32-v.2.0.5.zip
atmelavr_platform = atmelavr@3.3.0 atmelavr_platform = atmelavr@3.3.0