Initial esp32c3 support, also upgrade esp32 framework to 3.5. (#489)

* Initial esp32c3 support! (fixes #134)
This commit is contained in:
Darrell 2022-06-11 11:25:25 -04:00 committed by GitHub
parent 25bb7eb479
commit d2e4f452ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 436 additions and 364 deletions

View File

@ -37,7 +37,7 @@ jobs:
run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${GITHUB_REF#refs/*/}\"'" >> $GITHUB_ENV run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${GITHUB_REF#refs/*/}\"'" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
- name: Run PlatformIO - name: Run PlatformIO
run: pio run -e esp32 -e esp32-verbose -e adafruit-huzzah32 -e m5stickc -e m5stickc-plus -e m5atom-matrix -e esp32-sensors -e esp32-verbose-sensors -e adafruit-huzzah32-sensors -e m5stickc-sensors -e m5stickc-plus-sensors -e m5atom-matrix-sensors -e macchina-a0 run: pio run -e esp32 -e esp32-verbose -e adafruit-huzzah32 -e m5stickc -e m5stickc-plus -e m5atom-matrix -e esp32-sensors -e esp32-verbose-sensors -e adafruit-huzzah32-sensors -e m5stickc-sensors -e m5stickc-plus-sensors -e m5atom-matrix-sensors -e macchina-a0 -e esp32c3
- name: Rename firmware - name: Rename firmware
run: | run: |
cp .pio/build/esp32/firmware.bin esp32.bin cp .pio/build/esp32/firmware.bin esp32.bin
@ -54,6 +54,7 @@ jobs:
cp .pio/build/m5stickc-plus-sensors/firmware.bin m5stickc-plus-sensors.bin cp .pio/build/m5stickc-plus-sensors/firmware.bin m5stickc-plus-sensors.bin
cp .pio/build/m5atom-matrix-sensors/firmware.bin m5atom-matrix-sensors.bin cp .pio/build/m5atom-matrix-sensors/firmware.bin m5atom-matrix-sensors.bin
cp .pio/build/esp32c3/firmware.bin esp32c3.bin
cp .pio/build/macchina-a0/firmware.bin macchina-a0.bin cp .pio/build/macchina-a0/firmware.bin macchina-a0.bin
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ cmake-build-*
build/ build/
CMakeLists.txt CMakeLists.txt
CMakeListsPrivate.txt CMakeListsPrivate.txt
platformio_override.ini

View File

@ -1,7 +1,7 @@
#include "BleFingerprint.h" #include "BleFingerprint.h"
#include "BleFingerprintCollection.h" #include "BleFingerprintCollection.h"
#include "rssi.h" #include "rssi.h"
#include "strings.h" #include "string_utils.h"
#include "util.h" #include "util.h"
class ClientCallbacks : public BLEClientCallbacks class ClientCallbacks : public BLEClientCallbacks
@ -298,7 +298,7 @@ void BleFingerprint::fingerprintManufactureData(NimBLEAdvertisedDevice *advertis
} }
else if (strManufacturerData.length() >= 4 && strManufacturerData[2] == 0x10) else if (strManufacturerData.length() >= 4 && strManufacturerData[2] == 0x10)
{ {
String pid = Sprintf("apple:%02x%02x:%zu", strManufacturerData[2], strManufacturerData[3], strManufacturerData.length()); String pid = Sprintf("apple:%02x%02x:%u", strManufacturerData[2], strManufacturerData[3], strManufacturerData.length());
if (haveTxPower) pid += -txPower; if (haveTxPower) pid += -txPower;
setId(pid, ID_TYPE_APPLE_NEARBY); setId(pid, ID_TYPE_APPLE_NEARBY);
disc = hexStr(strManufacturerData.substr(4)).c_str(); disc = hexStr(strManufacturerData.substr(4)).c_str();
@ -306,7 +306,7 @@ void BleFingerprint::fingerprintManufactureData(NimBLEAdvertisedDevice *advertis
} }
else if (strManufacturerData.length() >= 4) else if (strManufacturerData.length() >= 4)
{ {
String pid = Sprintf("apple:%02x%02x:%zu", strManufacturerData[2], strManufacturerData[3], strManufacturerData.length()); String pid = Sprintf("apple:%02x%02x:%u", strManufacturerData[2], strManufacturerData[3], strManufacturerData.length());
if (haveTxPower) pid += -txPower; if (haveTxPower) pid += -txPower;
setId(pid, ID_TYPE_MISC_APPLE); setId(pid, ID_TYPE_MISC_APPLE);
mdRssi = BleFingerprintCollection::refRssi + APPLE_TX; mdRssi = BleFingerprintCollection::refRssi + APPLE_TX;
@ -352,7 +352,7 @@ void BleFingerprint::fingerprintManufactureData(NimBLEAdvertisedDevice *advertis
else if (manuf != "0000") else if (manuf != "0000")
{ {
mdRssi = haveTxPower ? BleFingerprintCollection::refRssi + txPower : NO_RSSI; mdRssi = haveTxPower ? BleFingerprintCollection::refRssi + txPower : NO_RSSI;
String fingerprint = Sprintf("md:%s:%zu", manuf.c_str(), strManufacturerData.length()); String fingerprint = Sprintf("md:%s:%u", manuf.c_str(), strManufacturerData.length());
if (haveTxPower) fingerprint = fingerprint + String(-txPower); if (haveTxPower) fingerprint = fingerprint + String(-txPower);
setId(fingerprint, ID_TYPE_MD); setId(fingerprint, ID_TYPE_MD);
} }

View File

@ -3,7 +3,7 @@
#include "GUI.h" #include "GUI.h"
#include "rssi.h" #include "rssi.h"
#include "strings.h" #include "string_utils.h"
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <NimBLEAdvertisedDevice.h> #include <NimBLEAdvertisedDevice.h>
#include <NimBLEBeacon.h> #include <NimBLEBeacon.h>

View File

@ -1,5 +1,5 @@
#include <regex> #include <regex>
#include <strings.h> #include <string_utils.h>
std::string ltrim(const std::string &s, char toTrim) std::string ltrim(const std::string &s, char toTrim)
{ {

View File

@ -1,9 +1,15 @@
#ifndef STRINGS_h #pragma once
#define STRINGS_h
#include <Arduino.h> #include <Arduino.h>
#include <WString.h>
#include <string>
#include <cstring>
#ifdef CONFIG_IDF_TARGET_ESP32C3
#define ESPMAC (Sprintf("%06x", (uint32_t)ESP.getEfuseMac()))
#else
#define ESPMAC (Sprintf("%06" PRIx64, ESP.getEfuseMac() >> 24)) #define ESPMAC (Sprintf("%06" PRIx64, ESP.getEfuseMac() >> 24))
#endif
#define Sprintf(f, ...) ({ char* s; asprintf(&s, f, __VA_ARGS__); String r = s; free(s); r; }) #define Sprintf(f, ...) ({ char* s; asprintf(&s, f, __VA_ARGS__); String r = s; free(s); r; })
#define Stdprintf(f, ...) ({ char* s; asprintf(&s, f, __VA_ARGS__); std::string r = s; free(s); r; }) #define Stdprintf(f, ...) ({ char* s; asprintf(&s, f, __VA_ARGS__); std::string r = s; free(s); r; })
#define SMacf(f) ( \ #define SMacf(f) ( \
@ -23,4 +29,3 @@ std::string hexStrRev(const uint8_t *data, int len);
std::string hexStrRev(const char *data, int len); std::string hexStrRev(const char *data, int len);
std::string hexStrRev(const std::string &s); std::string hexStrRev(const std::string &s);
bool prefixExists(const String& prefixes, const String& s); bool prefixExists(const String& prefixes, const String& s);
#endif

View File

@ -10,6 +10,8 @@
[platformio] [platformio]
default_envs = esp32 default_envs = esp32
build_cache_dir = ~/.buildcache
extra_configs = platformio_override.ini
[common] [common]
debug_build_flags = -O0 -ggdb3 -g3 -DDEBUG_TLS_MEM debug_build_flags = -O0 -ggdb3 -g3 -DDEBUG_TLS_MEM
@ -17,15 +19,13 @@ build_flags =
-D MQTT_MIN_FREE_MEMORY=8128 -D MQTT_MIN_FREE_MEMORY=8128
-D SECURE_CLIENT=SECURE_CLIENT_BEARSSL -D SECURE_CLIENT=SECURE_CLIENT_BEARSSL
-D BEARSSL_SSL_BASIC -D BEARSSL_SSL_BASIC
-D CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
-D CONFIG_BT_NIMBLE_MAX_BONDS=0 -D CONFIG_BT_NIMBLE_MAX_BONDS=0
-D CONFIG_BT_NIMBLE_MAX_CCCDS=0 -D CONFIG_BT_NIMBLE_MAX_CCCDS=0
-D CONFIG_BT_NIMBLE_TASK_STACK_SIZE=8128 -D CONFIG_BT_NIMBLE_TASK_STACK_SIZE=8128
-D CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED -D CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
-D CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED -D CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
-D CONFIG_ASYNC_TCP_USE_WDT=0 -D CONFIG_ASYNC_TCP_USE_WDT=0
-D CONFIG_USE_ETHERNET build_unflags =
platform = espressif32@3.2
framework = arduino framework = arduino
lib_deps = lib_deps =
haimoz/SoftFilters@^0.1.0 haimoz/SoftFilters@^0.1.0
@ -36,6 +36,35 @@ lib_deps =
https://github.com/pbolduc/AsyncTCP.git @ 1.2.0 https://github.com/pbolduc/AsyncTCP.git @ 1.2.0
bbx10/DNSServer@^1.1.0 bbx10/DNSServer@^1.1.0
[esp32]
platform = espressif32@3.5.0
platform_packages = framework-arduinoespressif32 @ https://github.com/Aircoookie/arduino-esp32.git#1.0.6.4
framework = ${common.framework}
build_unflags = ${common.build_unflags}
build_flags = -g
-D ARDUINO_ARCH_ESP32
-D CONFIG_BT_NIMBLE_PINNED_TO_CORE=1
-D REPORT_PINNED_TO_CORE=1
-D CONFIG_USE_ETHERNET
${common.build_flags}
lib_deps = ${common.lib_deps}
[esp32c3]
platform = espressif32@4.4.0
platform_packages =
framework = ${common.framework}
build_unflags = ${common.build_unflags}
build_flags = -g
-D ARDUINO_ARCH_ESP32
-D ARDUINO_ARCH_ESP32C3
-D CONFIG_IDF_TARGET_ESP32C3
-D CO
-D CONFIG_BT_NIMBLE_PINNED_TO_CORE=0
-D REPORT_PINNED_TO_CORE=0
${common.build_flags}
lib_deps = ${common.lib_deps}
[common_sensors] [common_sensors]
lib_deps = lib_deps =
adafruit/Adafruit Unified Sensor @ ^1.1.4 adafruit/Adafruit Unified Sensor @ ^1.1.4
@ -44,227 +73,251 @@ lib_deps =
adafruit/Adafruit BME280 Library@^2.2.2 adafruit/Adafruit BME280 Library@^2.2.2
adafruit/Adafruit TSL2561@^1.1.0 adafruit/Adafruit TSL2561@^1.1.0
[env:debug]
build_type=debug
platform = ${common.platform}
framework = ${common.framework}
board = esp-wrover-kit
debug_tool = esp-prog
debug_init_break=tbreak abort
upload_protocol = esp-prog
lib_deps = ${common.lib_deps}
board_build.partitions = partitions_singleapp.csv
monitor_port = /dev/cu.usbserial-*1
monitor_speed = 115200
monitor_filters = esp32_exception_decoder, time
debug_build_flags = ${common.debug_build_flags}
build_flags = ${common.build_flags}
[env:esp32] [env:esp32]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = ${common.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 1500000 upload_speed = 1500000
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D FIRMWARE='"esp32"' -D FIRMWARE='"esp32"'
${common.build_flags} ${esp32.build_flags}
[env:esp32c3]
platform = ${esp32c3.platform}
platform_packages = ${esp32c3.platform_packages}
framework = ${esp32c3.framework}
board = esp32-c3-devkitm-1
board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200
upload_speed = 1500000
lib_deps = ${esp32c3.lib_deps}
build_unflags = ${esp32c3.build_unflags}
build_flags =
-D FIRMWARE='"esp32c3"'
${esp32c3.build_flags}
[env:adafruit-huzzah32] [env:adafruit-huzzah32]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = ${common.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D FIRMWARE='"adafruit-huzzah32"' -D FIRMWARE='"adafruit-huzzah32"'
-D HUZZAH32 -D HUZZAH32
${common.build_flags} ${esp32.build_flags}
[env:esp32-verbose] [env:esp32-verbose]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = ${common.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 1500000 upload_speed = 1500000
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D CORE_DEBUG_LEVEL=2 -D CORE_DEBUG_LEVEL=2
-D FIRMWARE='"esp32-verbose"' -D FIRMWARE='"esp32-verbose"'
-D VERBOSE -D VERBOSE
${common.build_flags} ${esp32.build_flags}
[env:m5stickc] [env:m5stickc]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stick-c board = m5stick-c
lib_deps = lib_deps =
m5stack/M5StickC@^0.2.0 m5stack/M5StickC@^0.2.0
https://github.com/ESPresense/M5StickC-TB_Display.git https://github.com/ESPresense/M5StickC-TB_Display.git
${common.lib_deps} ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5STICK -D M5STICK
-D FIRMWARE='"m5stickc"' -D FIRMWARE='"m5stickc"'
${common.build_flags} ${esp32.build_flags}
[env:m5stickc-plus] [env:m5stickc-plus]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stick-c board = m5stick-c
lib_deps = lib_deps =
m5stack/M5StickCPlus@^0.0.2 m5stack/M5StickCPlus@^0.0.2
https://github.com/ESPresense/M5StickC-TB_Display.git https://github.com/ESPresense/M5StickC-TB_Display.git
${common.lib_deps} ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5STICK -D M5STICK
-D PLUS -D PLUS
-D FIRMWARE='"m5stickc-plus"' -D FIRMWARE='"m5stickc-plus"'
${common.build_flags} ${esp32.build_flags}
[env:m5atom-matrix] [env:m5atom-matrix]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stack-atom board = m5stack-atom
lib_deps = lib_deps =
fastled/FastLED@^3.4.0 fastled/FastLED@^3.4.0
m5stack/m5atom@^0.0.5 m5stack/m5atom@^0.0.5
${common.lib_deps} ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5ATOM -D M5ATOM
-D MATRIX -D MATRIX
-D FIRMWARE='"m5atom-matrix"' -D FIRMWARE='"m5atom-matrix"'
${common.build_flags} ${esp32.build_flags}
[env:macchina-a0] [env:macchina-a0]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = ${common.lib_deps} lib_deps = ${esp32.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D MACCHINA_A0 -D MACCHINA_A0
-D FIRMWARE='"macchina-a0"' -D FIRMWARE='"macchina-a0"'
${common.build_flags} ${esp32.build_flags}
[env:esp32-sensors] [env:esp32-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = lib_deps =
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 115200 upload_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D FIRMWARE='"esp32-sensors"' -D FIRMWARE='"esp32-sensors"'
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}
[env:adafruit-huzzah32-sensors] [env:adafruit-huzzah32-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = lib_deps =
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D FIRMWARE='"adafruit-huzzah32-sensors"' -D FIRMWARE='"adafruit-huzzah32-sensors"'
-D HUZZAH32 -D HUZZAH32
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}
[env:esp32-verbose-sensors] [env:esp32-verbose-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = esp32dev board = esp32dev
lib_deps = lib_deps =
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 1500000 upload_speed = 1500000
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D CORE_DEBUG_LEVEL=2 -D CORE_DEBUG_LEVEL=2
-D FIRMWARE='"esp32-verbose-sensors"' -D FIRMWARE='"esp32-verbose-sensors"'
-D VERBOSE -D VERBOSE
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}
[env:m5stickc-sensors] [env:m5stickc-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stick-c board = m5stick-c
lib_deps = lib_deps =
m5stack/M5StickC@^0.2.0 m5stack/M5StickC@^0.2.0
https://github.com/ESPresense/M5StickC-TB_Display.git https://github.com/ESPresense/M5StickC-TB_Display.git
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5STICK -D M5STICK
-D FIRMWARE='"m5stickc-sensors"' -D FIRMWARE='"m5stickc-sensors"'
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}
[env:m5stickc-plus-sensors] [env:m5stickc-plus-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stick-c board = m5stick-c
lib_deps = lib_deps =
m5stack/M5StickCPlus@^0.0.2 m5stack/M5StickCPlus@^0.0.2
https://github.com/ESPresense/M5StickC-TB_Display.git https://github.com/ESPresense/M5StickC-TB_Display.git
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5STICK -D M5STICK
-D PLUS -D PLUS
-D FIRMWARE='"m5stickc-plus-sensors"' -D FIRMWARE='"m5stickc-plus-sensors"'
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}
[env:m5atom-matrix-sensors] [env:m5atom-matrix-sensors]
platform = ${common.platform} platform = ${esp32.platform}
framework = ${common.framework} platform_packages = ${esp32.platform_packages}
framework = ${esp32.framework}
board = m5stack-atom board = m5stack-atom
lib_deps = lib_deps =
fastled/FastLED@^3.4.0 fastled/FastLED@^3.4.0
m5stack/m5atom@^0.0.5 m5stack/m5atom@^0.0.5
${common.lib_deps} ${esp32.lib_deps}
${common_sensors.lib_deps} ${common_sensors.lib_deps}
board_build.partitions = partitions_singleapp.csv board_build.partitions = partitions_singleapp.csv
monitor_speed = 115200 monitor_speed = 115200
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
build_unflags = ${esp32.build_unflags}
build_flags = build_flags =
-D M5ATOM -D M5ATOM
-D MATRIX -D MATRIX
-D FIRMWARE='"m5atom-matrix-sensors"' -D FIRMWARE='"m5atom-matrix-sensors"'
-D SENSORS -D SENSORS
${common.build_flags} ${esp32.build_flags}

View File

@ -1,155 +1,155 @@
#ifdef SENSORS #ifdef SENSORS
#include "defaults.h" #include "defaults.h"
#include "BME280Sensor.h" #include "BME280Sensor.h"
#include <WiFiSettings.h> #include <WiFiSettings.h>
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
#include <Adafruit_BME280.h> #include <Adafruit_BME280.h>
// for #define ESPMAC // for #define ESPMAC
#include "strings.h" #include "string_utils.h"
// TODO: Not a fan of externs, but this helps refactoring for now // TODO: Not a fan of externs, but this helps refactoring for now
extern bool I2C_Bus_1_Enabled; extern bool I2C_Bus_1_Enabled;
extern bool I2C_Bus_2_Enabled; extern bool I2C_Bus_2_Enabled;
extern unsigned long sensorInterval; extern unsigned long sensorInterval;
extern char buffer[2048]; extern char buffer[2048];
extern String room; extern String room;
extern String roomsTopic; extern String roomsTopic;
extern void commonDiscovery(); extern void commonDiscovery();
extern bool pub(const char *topic, uint8_t qos, bool retain, const char *payload, size_t length = 0, bool dup = false, uint16_t message_id = 0); extern bool pub(const char *topic, uint8_t qos, bool retain, const char *payload, size_t length = 0, bool dup = false, uint16_t message_id = 0);
namespace BME280 namespace BME280
{ {
Adafruit_BME280 BME280; Adafruit_BME280 BME280;
long BME280_status; long BME280_status;
String BME280_I2c; String BME280_I2c;
int BME280_I2c_Bus; int BME280_I2c_Bus;
unsigned long bme280PreviousMillis = 0; unsigned long bme280PreviousMillis = 0;
void Setup() void Setup()
{ {
} }
void ConnectToWifi() void ConnectToWifi()
{ {
WiFiSettings.html("h4", "BME280 - Weather Sensor:"); WiFiSettings.html("h4", "BME280 - Weather Sensor:");
BME280_I2c_Bus = WiFiSettings.integer("BME280_I2c_Bus", 1, 2, DEFAULT_I2C_BUS, "I2C Bus"); BME280_I2c_Bus = WiFiSettings.integer("BME280_I2c_Bus", 1, 2, DEFAULT_I2C_BUS, "I2C Bus");
BME280_I2c = WiFiSettings.string("BME280_I2c", "", "I2C address (0x76 or 0x77)"); BME280_I2c = WiFiSettings.string("BME280_I2c", "", "I2C address (0x76 or 0x77)");
} }
void SerialReport() void SerialReport()
{ {
Serial.print("BME280_I2c Sensor: "); Serial.print("BME280_I2c Sensor: ");
Serial.println(BME280_I2c + " on bus " + BME280_I2c_Bus); Serial.println(BME280_I2c + " on bus " + BME280_I2c_Bus);
} }
void Loop(AsyncMqttClient& mqttClient) void Loop(AsyncMqttClient& mqttClient)
{ {
if (!I2C_Bus_1_Enabled && !I2C_Bus_2_Enabled) return; if (!I2C_Bus_1_Enabled && !I2C_Bus_2_Enabled) return;
// TODO: This should move to setup // TODO: This should move to setup
if (BME280_I2c == "0x76" && BME280_I2c_Bus == 1) { if (BME280_I2c == "0x76" && BME280_I2c_Bus == 1) {
BME280_status = BME280.begin(0x76, &Wire); BME280_status = BME280.begin(0x76, &Wire);
} else if (BME280_I2c == "0x77" && BME280_I2c_Bus == 1) { } else if (BME280_I2c == "0x77" && BME280_I2c_Bus == 1) {
BME280_status = BME280.begin(0x77, &Wire); BME280_status = BME280.begin(0x77, &Wire);
} else if (BME280_I2c == "0x76" && BME280_I2c_Bus == 2) { } else if (BME280_I2c == "0x76" && BME280_I2c_Bus == 2) {
BME280_status = BME280.begin(0x76, &Wire1); BME280_status = BME280.begin(0x76, &Wire1);
} else if (BME280_I2c == "0x77" && BME280_I2c_Bus == 2) { } else if (BME280_I2c == "0x77" && BME280_I2c_Bus == 2) {
BME280_status = BME280.begin(0x77, &Wire1); BME280_status = BME280.begin(0x77, &Wire1);
} else { } else {
return; return;
} }
if (!BME280_status) { if (!BME280_status) {
Serial.println("[BME280] Couldn't find a sensor, check your wiring and I2C address!"); Serial.println("[BME280] Couldn't find a sensor, check your wiring and I2C address!");
} }
BME280.setSampling( BME280.setSampling(
Adafruit_BME280::MODE_FORCED, Adafruit_BME280::MODE_FORCED,
Adafruit_BME280::SAMPLING_X1, // Temperature Adafruit_BME280::SAMPLING_X1, // Temperature
Adafruit_BME280::SAMPLING_X1, // Pressure Adafruit_BME280::SAMPLING_X1, // Pressure
Adafruit_BME280::SAMPLING_X1, // Humidity Adafruit_BME280::SAMPLING_X1, // Humidity
//Adafruit_BME280::FILTER_X16, //Adafruit_BME280::FILTER_X16,
Adafruit_BME280::FILTER_OFF Adafruit_BME280::FILTER_OFF
); );
float temperature = BME280.readTemperature(); float temperature = BME280.readTemperature();
float humidity = BME280.readHumidity(); float humidity = BME280.readHumidity();
float pressure = BME280.readPressure() / 100.0F; float pressure = BME280.readPressure() / 100.0F;
if (millis() - bme280PreviousMillis >= sensorInterval) { if (millis() - bme280PreviousMillis >= sensorInterval) {
mqttClient.publish((roomsTopic + "/bme280_temperature").c_str(), 0, 1, String(temperature).c_str()); mqttClient.publish((roomsTopic + "/bme280_temperature").c_str(), 0, 1, String(temperature).c_str());
mqttClient.publish((roomsTopic + "/bme280_humidity").c_str(), 0, 1, String(humidity).c_str()); mqttClient.publish((roomsTopic + "/bme280_humidity").c_str(), 0, 1, String(humidity).c_str());
mqttClient.publish((roomsTopic + "/bme280_pressure").c_str(), 0, 1, String(pressure).c_str()); mqttClient.publish((roomsTopic + "/bme280_pressure").c_str(), 0, 1, String(pressure).c_str());
bme280PreviousMillis = millis(); bme280PreviousMillis = millis();
} }
} }
static bool SendTemperature(DynamicJsonDocument& doc) static bool SendTemperature(DynamicJsonDocument& doc)
{ {
commonDiscovery(); commonDiscovery();
doc["~"] = roomsTopic; doc["~"] = roomsTopic;
doc["name"] = "ESPresense " + room + " BME280 Temperature"; doc["name"] = "ESPresense " + room + " BME280 Temperature";
doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_temperature", ESP.getEfuseMac() >> 24); doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_temperature", ESP.getEfuseMac() >> 24);
doc["avty_t"] = "~/status"; doc["avty_t"] = "~/status";
doc["stat_t"] = "~/bme280_temperature"; doc["stat_t"] = "~/bme280_temperature";
doc["dev_cla"] = "temperature"; doc["dev_cla"] = "temperature";
doc["unit_of_meas"] = "°C"; doc["unit_of_meas"] = "°C";
doc["frc_upd"] = true; doc["frc_upd"] = true;
serializeJson(doc, buffer); serializeJson(doc, buffer);
String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_temperature/config"; String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_temperature/config";
return pub(discoveryTopic.c_str(), 0, true, buffer); return pub(discoveryTopic.c_str(), 0, true, buffer);
} }
static bool SendHumidity(DynamicJsonDocument& doc) static bool SendHumidity(DynamicJsonDocument& doc)
{ {
commonDiscovery(); commonDiscovery();
doc["~"] = roomsTopic; doc["~"] = roomsTopic;
doc["name"] = "ESPresense " + room + " BME280 Humidity"; doc["name"] = "ESPresense " + room + " BME280 Humidity";
doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_humidity", ESP.getEfuseMac() >> 24); doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_humidity", ESP.getEfuseMac() >> 24);
doc["avty_t"] = "~/status"; doc["avty_t"] = "~/status";
doc["stat_t"] = "~/bme280_humidity"; doc["stat_t"] = "~/bme280_humidity";
doc["dev_cla"] = "humidity"; doc["dev_cla"] = "humidity";
doc["unit_of_meas"] = "%"; doc["unit_of_meas"] = "%";
doc["frc_upd"] = true; doc["frc_upd"] = true;
serializeJson(doc, buffer); serializeJson(doc, buffer);
String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_humidity/config"; String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_humidity/config";
return pub(discoveryTopic.c_str(), 0, true, buffer); return pub(discoveryTopic.c_str(), 0, true, buffer);
} }
static bool SendPressure(DynamicJsonDocument& doc) static bool SendPressure(DynamicJsonDocument& doc)
{ {
commonDiscovery(); commonDiscovery();
doc["~"] = roomsTopic; doc["~"] = roomsTopic;
doc["name"] = "ESPresense " + room + " BME280 Pressure"; doc["name"] = "ESPresense " + room + " BME280 Pressure";
doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_pressure", ESP.getEfuseMac() >> 24); doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_bme280_pressure", ESP.getEfuseMac() >> 24);
doc["avty_t"] = "~/status"; doc["avty_t"] = "~/status";
doc["stat_t"] = "~/bme280_pressure"; doc["stat_t"] = "~/bme280_pressure";
doc["dev_cla"] = "pressure"; doc["dev_cla"] = "pressure";
doc["unit_of_meas"] = "hPa"; doc["unit_of_meas"] = "hPa";
doc["frc_upd"] = true; doc["frc_upd"] = true;
serializeJson(doc, buffer); serializeJson(doc, buffer);
String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_pressure/config"; String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/bme280_pressure/config";
return pub(discoveryTopic.c_str(), 0, true, buffer); return pub(discoveryTopic.c_str(), 0, true, buffer);
} }
bool SendDiscovery(DynamicJsonDocument& doc) bool SendDiscovery(DynamicJsonDocument& doc)
{ {
if (BME280_I2c.isEmpty()) return true; if (BME280_I2c.isEmpty()) return true;
return SendTemperature(doc) && SendHumidity(doc) && SendPressure(doc); return SendTemperature(doc) && SendHumidity(doc) && SendPressure(doc);
} }
} }
#endif #endif

View File

@ -6,7 +6,7 @@
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
// for #define ESPMAC // for #define ESPMAC
#include "strings.h" #include "string_utils.h"
// TODO: Not a fan of externs, but this helps refactoring for now // TODO: Not a fan of externs, but this helps refactoring for now
extern char buffer[2048]; extern char buffer[2048];

View File

@ -3,7 +3,7 @@
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
// for #define ESPMAC // for #define ESPMAC
#include "strings.h" #include "string_utils.h"
// TODO: Not a fan of externs, but this helps refactoring for now // TODO: Not a fan of externs, but this helps refactoring for now
extern char buffer[2048]; extern char buffer[2048];

View File

@ -1,122 +1,121 @@
#ifdef SENSORS #ifdef SENSORS
#include "defaults.h" #include "defaults.h"
#include "TSL2561Sensor.h" #include "TSL2561Sensor.h"
#include <WiFiSettings.h> #include <WiFiSettings.h>
#include <AsyncMqttClient.h> #include <AsyncMqttClient.h>
#include <Adafruit_TSL2561_U.h> #include <Adafruit_TSL2561_U.h>
// for #define ESPMAC // for #define ESPMAC
#include "strings.h" #include "string_utils.h"
// TODO: Not a fan of externs, but this helps refactoring for now // TODO: Not a fan of externs, but this helps refactoring for now
extern bool I2C_Bus_1_Enabled; extern bool I2C_Bus_1_Enabled;
extern bool I2C_Bus_2_Enabled; extern bool I2C_Bus_2_Enabled;
extern unsigned long sensorInterval; extern unsigned long sensorInterval;
extern char buffer[2048]; extern char buffer[2048];
extern String room; extern String room;
extern String roomsTopic; extern String roomsTopic;
extern void commonDiscovery(); extern void commonDiscovery();
extern bool pub(const char *topic, uint8_t qos, bool retain, const char *payload, size_t length = 0, bool dup = false, uint16_t message_id = 0); extern bool pub(const char *topic, uint8_t qos, bool retain, const char *payload, size_t length = 0, bool dup = false, uint16_t message_id = 0);
namespace TSL2561 namespace TSL2561
{ {
String TSL2561_I2c; String TSL2561_I2c;
int TSL2561_I2c_Bus; int TSL2561_I2c_Bus;
String TSL2561_I2c_Gain; String TSL2561_I2c_Gain;
unsigned long tsl2561PreviousMillis = 0; unsigned long tsl2561PreviousMillis = 0;
void Setup() void Setup()
{ {
}
}
void ConnectToWifi()
void ConnectToWifi() {
{ WiFiSettings.html("h4", "TSL2561 - Ambient Light Sensor:");
WiFiSettings.html("h4", "TSL2561 - Ambient Light Sensor:"); TSL2561_I2c_Bus = WiFiSettings.integer("TSL2561_I2c_Bus", 1, 2, DEFAULT_I2C_BUS, "I2C Bus");
TSL2561_I2c_Bus = WiFiSettings.integer("TSL2561_I2c_Bus", 1, 2, DEFAULT_I2C_BUS, "I2C Bus"); TSL2561_I2c = WiFiSettings.string("TSL2561_I2c", "", "I2C address (0x39, 0x49 or 0x29)");
TSL2561_I2c = WiFiSettings.string("TSL2561_I2c", "", "I2C address (0x39, 0x49 or 0x29)"); TSL2561_I2c_Gain = WiFiSettings.string("TSL2561_I2c_Gain", DEFAULT_TSL2561_I2C_GAIN, "Gain (auto, 1x or 16x)");
TSL2561_I2c_Gain = WiFiSettings.string("TSL2561_I2c_Gain", DEFAULT_TSL2561_I2C_GAIN, "Gain (auto, 1x or 16x)"); }
}
void SerialReport()
void SerialReport() {
{ Serial.print("TSL2561_I2c Sensor: ");
Serial.print("TSL2561_I2c Sensor: "); Serial.println(TSL2561_I2c + " on bus " + TSL2561_I2c_Bus);
Serial.println(TSL2561_I2c + " on bus " + TSL2561_I2c_Bus); }
}
void Loop(AsyncMqttClient& mqttClient)
void Loop(AsyncMqttClient& mqttClient) {
{ if (!I2C_Bus_1_Enabled && !I2C_Bus_2_Enabled) return;
if (!I2C_Bus_1_Enabled && !I2C_Bus_2_Enabled) return;
// TODO: This should move to setup
// TODO: This should move to setup int tsl2561_address;
int tsl2561_address;
if (TSL2561_I2c == "0x39") {
if (TSL2561_I2c == "0x39") { tsl2561_address = 0x39;
tsl2561_address = 0x39; } else if (TSL2561_I2c == "0x29") {
} else if (TSL2561_I2c == "0x29") { tsl2561_address = 0x29;
tsl2561_address = 0x29; } else if (TSL2561_I2c == "0x49") {
} else if (TSL2561_I2c == "0x49") { tsl2561_address = 0x49;
tsl2561_address = 0x49; } else {
} else { return;
return; }
}
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(tsl2561_address);
Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(tsl2561_address);
if (TSL2561_I2c_Bus == 1) {
if (TSL2561_I2c_Bus == 1) { tsl.begin(&Wire);
tsl.begin(&Wire); } else if (TSL2561_I2c_Bus == 2) {
} else if (TSL2561_I2c_Bus == 2) { tsl.begin(&Wire1);
tsl.begin(&Wire1); }
}
if (TSL2561_I2c_Gain == "auto") {
if (TSL2561_I2c_Gain == "auto") { tsl.enableAutoRange(true);
tsl.enableAutoRange(true); } else if (TSL2561_I2c_Gain == "1x") {
} else if (TSL2561_I2c_Gain == "1x") { tsl.setGain(TSL2561_GAIN_1X);
tsl.setGain(TSL2561_GAIN_1X); } else if (TSL2561_I2c_Gain == "16x") {
} else if (TSL2561_I2c_Gain == "16x") { tsl.setGain(TSL2561_GAIN_16X);
tsl.setGain(TSL2561_GAIN_16X); } else {
} else { Serial.println("[TSL2561] Invalid gain");
Serial.println("[TSL2561] Invalid gain"); return;
return; }
}
tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS);
tsl.setIntegrationTime(TSL2561_INTEGRATIONTIME_402MS);
sensors_event_t event;
sensors_event_t event; tsl.getEvent(&event);
tsl.getEvent(&event);
if (event.light) {
if (event.light) { if (millis() - tsl2561PreviousMillis >= sensorInterval) {
if (millis() - tsl2561PreviousMillis >= sensorInterval) { mqttClient.publish((roomsTopic + "/tsl2561_lux").c_str(), 0, 1, String(event.light).c_str());
mqttClient.publish((roomsTopic + "/tsl2561_lux").c_str(), 0, 1, String(event.light).c_str());
tsl2561PreviousMillis = millis();
tsl2561PreviousMillis = millis(); }
} } else {
} else { Serial.println("[TSL2561] Sensor overloaded");
Serial.println("[TSL2561] Sensor overloaded"); }
} }
}
bool SendDiscovery(DynamicJsonDocument& doc)
bool SendDiscovery(DynamicJsonDocument& doc) {
{ if (TSL2561_I2c.isEmpty()) return true;
if (TSL2561_I2c.isEmpty()) return true;
commonDiscovery();
commonDiscovery(); doc["~"] = roomsTopic;
doc["~"] = roomsTopic; doc["name"] = "ESPresense " + room + " TSL2561 Lux";
doc["name"] = "ESPresense " + room + " TSL2561 Lux"; doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_tsl2561_lux", ESP.getEfuseMac() >> 24);
doc["uniq_id"] = Sprintf("espresense_%06" PRIx64 "_tsl2561_lux", ESP.getEfuseMac() >> 24); doc["avty_t"] = "~/status";
doc["avty_t"] = "~/status"; doc["stat_t"] = "~/tsl2561_lux";
doc["stat_t"] = "~/tsl2561_lux"; doc["dev_cla"] = "illuminance";
doc["dev_cla"] = "illuminance"; doc["unit_of_meas"] = "lx";
doc["unit_of_meas"] = "lx"; doc["frc_upd"] = true;
doc["frc_upd"] = true;
serializeJson(doc, buffer);
serializeJson(doc, buffer); String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/tsl2561_lux/config";
String discoveryTopic = "homeassistant/sensor/espresense_" + ESPMAC + "/tsl2561_lux/config";
return pub(discoveryTopic.c_str(), 0, true, buffer);
return pub(discoveryTopic.c_str(), 0, true, buffer); }
} }
}
#endif
#endif

View File

@ -128,20 +128,26 @@ void setupNetwork()
WiFiSettings.onFailure = []() WiFiSettings.onFailure = []()
{ {
GUI::status("WiFi Portal..."); GUI::status("WiFi Failed");
}; };
WiFiSettings.onWaitLoop = []() WiFiSettings.onWaitLoop = []()
{ {
GUI::connecting(); GUI::connecting();
return 150; return 150;
}; };
static bool inPortal = false;
WiFiSettings.onPortalWaitLoop = []() WiFiSettings.onPortalWaitLoop = []()
{ {
if (!inPortal)
{
inPortal = true;
GUI::status("WiFi Portal...");
}
if (getUptimeSeconds() > 600) if (getUptimeSeconds() > 600)
ESP.restart(); ESP.restart();
}; };
GUI::connected(true, false);
#ifdef VERSION #ifdef VERSION
WiFiSettings.info("ESPresense Version: " + String(VERSION)); WiFiSettings.info("ESPresense Version: " + String(VERSION));
#endif #endif
@ -228,6 +234,9 @@ void setupNetwork()
if (ethernetType > 0) success = Network.connect(ethernetType, 20, WiFiSettings.hostname.c_str()); if (ethernetType > 0) success = Network.connect(ethernetType, 20, WiFiSettings.hostname.c_str());
if (!success && !WiFiSettings.connect(true, 40)) if (!success && !WiFiSettings.connect(true, 40))
ESP.restart(); ESP.restart();
GUI::connected(true, false);
#ifdef FIRMWARE #ifdef FIRMWARE
Serial.println("Firmware: " + String(FIRMWARE)); Serial.println("Firmware: " + String(FIRMWARE));
#endif #endif
@ -714,7 +723,7 @@ void setup()
HX711::Setup(); HX711::Setup();
#endif #endif
xTaskCreatePinnedToCore(scanTask, "scanTask", 7168, nullptr, 2, &scanTaskHandle, CONFIG_BT_NIMBLE_PINNED_TO_CORE); xTaskCreatePinnedToCore(scanTask, "scanTask", 7168, nullptr, 2, &scanTaskHandle, CONFIG_BT_NIMBLE_PINNED_TO_CORE);
xTaskCreatePinnedToCore(reportTask, "reportTask", 7168, nullptr, 1, &reportTaskHandle, 1); xTaskCreatePinnedToCore(reportTask, "reportTask", 7168, nullptr, 1, &reportTaskHandle, REPORT_PINNED_TO_CORE);
configureOTA(); configureOTA();
} }

View File

@ -3,7 +3,7 @@
#include "GUI.h" #include "GUI.h"
#include "defaults.h" #include "defaults.h"
#include "strings.h" #include "string_utils.h"
#include <Arduino.h> #include <Arduino.h>
#include <ArduinoJson.h> #include <ArduinoJson.h>
@ -114,6 +114,9 @@ BleFingerprintCollection fingerprints;
String resetReason(RESET_REASON reason) String resetReason(RESET_REASON reason)
{ {
#ifdef ARDUINO_ARCH_ESP32C3
return "";
#else
switch (reason) switch (reason)
{ {
case POWERON_RESET: case POWERON_RESET:
@ -149,6 +152,7 @@ String resetReason(RESET_REASON reason)
default: default:
return "Unknown"; return "Unknown";
} }
#endif
} }
unsigned long getUptimeSeconds() unsigned long getUptimeSeconds()