Initial esp32c3 support, also upgrade esp32 framework to 3.5. (#489)
* Initial esp32c3 support! (fixes #134)
This commit is contained in:
parent
25bb7eb479
commit
d2e4f452ce
|
@ -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
|
||||||
|
|
|
@ -13,3 +13,4 @@ cmake-build-*
|
||||||
build/
|
build/
|
||||||
CMakeLists.txt
|
CMakeLists.txt
|
||||||
CMakeListsPrivate.txt
|
CMakeListsPrivate.txt
|
||||||
|
platformio_override.ini
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
|
@ -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
|
|
195
platformio.ini
195
platformio.ini
|
@ -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}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#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;
|
||||||
|
|
|
@ -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];
|
||||||
|
|
|
@ -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];
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#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;
|
||||||
|
@ -29,7 +29,6 @@ namespace TSL2561
|
||||||
|
|
||||||
void Setup()
|
void Setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectToWifi()
|
void ConnectToWifi()
|
||||||
|
|
15
src/main.cpp
15
src/main.cpp
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue