[SYS] Update arduino core to 3.1.1 + refactor ino to cpp (#2177)

* Update arduino core to 3.1.1

* Fix Blufi build

* Update arduinojson, fix build errors with idf

* Fix narrowing

* fix RF builds

* WIP-Convert ino files to cpp

* Fix pilight build

* Fix Somfy actuator build.

* Update esp32dev-rf partition

* Fix Weatherstation build

* Fix GFSunInverter build

* Fix esp32dev-ir build

* Fix ble-aws build

* Fix eth builds

* Fix m5Stack missing pins_arduino.h

* Fix build errors for M5 stack/tough, others are upstream issues.

* Fix RTL 433 build - remaining errors are from radolib

* Fix nodemcu build

* fix 2g builds

* Fix serial build

* Fix actuator on off builds

* Fix SSD1306 build - remaining errors are from radiolib

* Fix multiple definition of OTAserver_cert

* Fix nodemcu rf2 build

* Fix ADC builds

* Fix sensor builds

* Fix LORA builds

* Fix multi-receiver builds - remaining errors are in radiolib

* Fix fastled builds

* Fix theegns board builds

* Fix broker builds

* Update fastled - old version failed all-test build

* Fix RN8209 builds

* Fix max temp actuator builds

* Fix PWM builds

* Fix C37 sensor builds

* Fix HTU21 builds

* Fix INA266 builds

* Fix undefined variables in mqtt discovery

* Fix webui build

* Fix fastled invalid pin error

* Fix wifi manual setup builds

* Fix onewire/all-test build - bin too big error remaining

* Fix theengs plug build

* Fix rfbridge builds

* Fix blufi builds

* Fix undefined functions in serial

* Fix preprocessor definition checks

* Set IDF log level to erre

* Add delay in loop to prevent watchdog timeout

* Use xTaskCreateUniveral to support single core processors

* Remove old HTTPUpdate files - upsteam fixed.

* Cleanup and move common declarations to header file

* Use custom partiton table to fix builds where bin is too large

* Update M5StickC - fixs esp32-m5stick-c-ble build

* Revert to Arduino core 2.x for builds with incompatible libs

* Remove "Z" from file names and rename omg_common to TheengsCommon

* Fix gateway name when using MAC with new Arduino core

* Update IDF config to reduce loop task stack use

* Update esp-nimble-cpp version, corrects BLE uppercase ID's

* Update wifi manager to fix watchdog timeout error
This commit is contained in:
Ryan Powell authored and GitHub committed 2025-05-06 19:35:50 -05:00
1 parent 6e77efb11b
commit 585df9a420
83 files changed
+1275 -1293

No files matched your search

+17 -55
View File
@@ -226,7 +226,8 @@
#if AWS_IOT
// Enable the use of ALPN for AWS IoT Core with the port 443
const char* alpnProtocols[] = {"x-amzn-mqtt-ca", NULL};
# define ALPN_PROTOCOLS \
{ "x-amzn-mqtt-ca", NULL }
#endif
//# define MQTT_HTTPS_FW_UPDATE //uncomment to enable updating via MQTT message.
@@ -251,7 +252,7 @@ const char* alpnProtocols[] = {"x-amzn-mqtt-ca", NULL};
# define RELEASE_LINK_DEV "https://ota.openmqttgateway.com/binaries/dev/"
# define RELEASE_LINK "https://ota.openmqttgateway.com/binaries/"
#else
const char* OTAserver_cert = "";
static const char* OTAserver_cert = "";
#endif
#ifndef MQTT_SECURE_SIGNED_CLIENT
@@ -289,12 +290,15 @@ struct ss_cnt_parameters {
bool validConnection;
};
# define CNT_PARAMS_ARR \
{ \
{ss_server_cert, ss_client_cert, ss_client_key, OTAserver_cert, MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false}, \
{"", "", "", "", MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false}, \
{ "", "", "", "", MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false } \
}
# define cnt_parameters_array_size 3
ss_cnt_parameters cnt_parameters_array[cnt_parameters_array_size] = {
{ss_server_cert, ss_client_cert, ss_client_key, OTAserver_cert, MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false},
{"", "", "", "", MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false},
{"", "", "", "", MQTT_SERVER, MQTT_PORT, MQTT_USER, MQTT_PASS, MQTT_SECURE_DEFAULT, MQTT_CERT_VALIDATE_DEFAULT, false}};
extern ss_cnt_parameters cnt_parameters_array[];
#endif
#define MIN_CERT_LENGTH 200 // Minimum length of a certificate to be considered valid
@@ -527,7 +531,7 @@ ss_cnt_parameters cnt_parameters_array[cnt_parameters_array_size] = {
#ifdef ESP8266
//# define TRIGGER_GPIO 14 // pin D5 as full reset button (long press >10s)
#elif ESP32
#elif defined(ESP32)
//# define TRIGGER_GPIO 0 // boot button as full reset button (long press >10s)
//# define NO_INT_TEMP_READING true //Define if we don't want internal temperature reading for the ESP32
#endif
@@ -621,60 +625,14 @@ ss_cnt_parameters cnt_parameters_array[cnt_parameters_array_size] = {
#define displayPrint(...) // only print if not in low power mode
#define lpDisplayPrint(...) // print in low power mode
/*----------- SHARED WITH OMG MODULES --------------*/
char mqtt_topic[parameters_size + 1] = Base_Topic;
char gateway_name[parameters_size + 1] = Gateway_Name;
void connectMQTT();
unsigned long uptime();
bool cmpToMainTopic(const char*, const char*);
bool pub(const char*, const char*, bool);
bool pub(const char*, const char*);
#if defined(ESP32)
# include <Preferences.h>
Preferences preferences;
#endif
unsigned long lastDiscovery = 0; // Time of the last discovery to trigger automaticaly to off after DiscoveryAutoOffTimer
#ifndef DEFAULT_DISCOVERY
# define DEFAULT_DISCOVERY true
#endif
#include <vector>
// Flags definition for white list, black list, discovery management
#define device_flags_init 0 << 0
#define device_flags_isDisc 1 << 0
#define device_flags_isWhiteL 1 << 1
#define device_flags_isBlackL 1 << 2
#define device_flags_connect 1 << 3
#define isWhite(device) device->isWhtL
#define isBlack(device) device->isBlkL
#define isDiscovered(device) device->isDisc
enum PowerMode { DEACTIVATED = -1,
ALWAYS_ON,
INTERVAL,
ACTION };
/*--------------------Minimum freeHeap--------------------*/
// Below this parameter we trigger a restart, this avoid stuck boards like seen in https://github.com/1technophile/OpenMQTTGateway/issues/1693
#define MinimumMemory 40000
/*----------------CONFIGURABLE PARAMETERS-----------------*/
struct SYSConfig_s {
bool mqtt; // if true the gateway will publish the received data on the MQTT broker
bool serial; // if true the gateway will publish the received data on the SERIAL
bool blufi; // if true the gateway will be accesible with blufi
bool offline;
bool discovery; // HA discovery convention
#ifdef LED_ADDRESSABLE
int rgbbrightness; // brightness of the RGB LED
#ifndef DEFAULT_DISCOVERY
# define DEFAULT_DISCOVERY true
#endif
enum PowerMode powerMode;
};
#ifndef DEFAULT_MQTT
# define DEFAULT_MQTT true
@@ -697,4 +655,8 @@ void storeSignalValue(uint64_t);
#define convertTemp_CtoF(c) ((c * 1.8) + 32)
#define convertTemp_FtoC(f) ((f - 32) * 5 / 9)
#ifndef QueueSize
# define QueueSize 18
#endif
#endif