From bd21c51e2b23a3fdb332773ff407f25211f2892c Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Sat, 16 Nov 2024 10:35:12 -0700 Subject: [PATCH 01/46] updates for cross platform work --- sfeDataLoggerIoT/sfeDataLogger.cpp | 5 +++++ sfeDataLoggerIoT/sfeDataLogger.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 33fff07..4439399 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -167,6 +167,9 @@ sfeDataLogger::sfeDataLogger() // app key flux.setAppToken(_app_jump, sizeof(_app_jump)); + + // do not want the wifi connect() call made until after initialize + _wifiConnection.setDelayedStartup(true); } //--------------------------------------------------------------------------- @@ -689,6 +692,8 @@ bool sfeDataLogger::onStart() boot_count++; + // init wifi + _wifiConnection.connect(); // Logging is done at an interval - using an interval timer. // Connect logger to the timer event _logger.listen(_timer.on_interval); diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 61a7d41..c5e767b 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -25,9 +25,9 @@ #include // settings storage +#include #include #include -#include #include // SD Card output @@ -375,7 +375,7 @@ class sfeDataLogger : public flxApplication flxFileRotate _theOutputFile; // settings things - flxStorageESP32Pref _sysStorage; + flxPreferences _sysStorage; flxSettingsSerial _serialSettings; flxStorageJSONPrefFile _jsonStorage; From 81542b3e073ca23cd3a23ed1eebb6deacee60c5a Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 23 May 2025 17:31:24 -0600 Subject: [PATCH 02/46] mods to make this work with the latest flux core - more work ahead --- .gitignore | 7 +++++++ CMakeLists.txt | 5 ++++- sfeDataLoggerIoT/sfeDLLed.cpp | 2 +- sfeDataLoggerIoT/sfeDLMode.cpp | 5 ++++- sfeDataLoggerIoT/sfeDataLogger.cpp | 8 ++++---- sfeDataLoggerIoT/sfeDataLogger.h | 6 +++--- sfeDataLoggerIoT/sfeDataLoggerAbout.cpp | 1 - sfeDataLoggerIoT/sfeDataLoggerProps.cpp | 2 +- 8 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index d88a2db..50969a0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,10 @@ fuse_id/sfe_dl_fuseid.egg-info build/ SparkFun_Flux/ + +sfeDataLoggerIoT/Doxyfile + +sfeDataLoggerIoT/html/ + +sfeDataLoggerIoT/latex/ +.gitignore diff --git a/CMakeLists.txt b/CMakeLists.txt index ef06194..304b5be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,10 @@ cmake_minimum_required(VERSION 3.13) project(DataLoggerIoT NONE) # Import the flux-dk cmake system -include(flux_sdk_import.cmake) +include($ENV{FLUX_SDK_PATH}/external/flux_sdk_import.cmake) + +# set our Arduino Library name to something unique to this project +flux_sdk_set_library_name(SparkFun_DataLoggerIoT) # Where is directory that the flux stuff will be added to? This is the relative path from this file # to the aurdiuno sketch directory this is also used as the name of the cmake project diff --git a/sfeDataLoggerIoT/sfeDLLed.cpp b/sfeDataLoggerIoT/sfeDLLed.cpp index 3d7ee76..05e3367 100644 --- a/sfeDataLoggerIoT/sfeDLLed.cpp +++ b/sfeDataLoggerIoT/sfeDLLed.cpp @@ -319,7 +319,7 @@ void _sfeLED::blink(uint32_t timeout) //--------------------------------------------------------- // Blink - change state, start blinking -void _sfeLED::blink(sfeLEDColor_t color, uint timeout) +void _sfeLED::blink(sfeLEDColor_t color, uint32_t timeout) { if (_disabled) return; diff --git a/sfeDataLoggerIoT/sfeDLMode.cpp b/sfeDataLoggerIoT/sfeDLMode.cpp index c4acadf..9fddedf 100644 --- a/sfeDataLoggerIoT/sfeDLMode.cpp +++ b/sfeDataLoggerIoT/sfeDLMode.cpp @@ -132,7 +132,10 @@ uint32_t dlModeCheckSystem(void) for (int32_t block3Address = EFUSE_BLK3_RDATA0_REG; block3Address <= EFUSE_BLK3_RDATA7_REG; block3Address += 4) { // this is read in 4 byte chunks... - uint32_t block = REG_GET_FIELD(block3Address, EFUSE_BLK3_DOUT0); + // uint32_t block = REG_GET_FIELD(block3Address, EFUSE_BLK3_DOUT0); + // Arduion ESP32 core v 3.2.0 -- may 23, 2025 - looks like this defines changed, trying this. + // TODO: Still needs testing, but it's complining (which measn nada) + uint32_t block = REG_GET_FIELD(block3Address, EFUSE_BLK3_DIN0); data_buffer[i++] = block & 0xFF; data_buffer[i++] = block >> 8 & 0xFF; diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 4439399..eaff330 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -245,7 +245,7 @@ void sfeDataLogger::onSystemActivityLow(void) //--------------------------------------------------------------------------- // // CAlled when the button is pressed and an increment time passed -void sfeDataLogger::onButtonPressed(uint increment) +void sfeDataLogger::onButtonPressed(uint32_t increment) { // we need LED on for visual feedback... @@ -273,7 +273,7 @@ void sfeDataLogger::onButtonPressed(uint increment) } } //--------------------------------------------------------------------------- -void sfeDataLogger::onButtonReleased(uint increment) +void sfeDataLogger::onButtonReleased(uint32_t increment) { if (increment > 0) sfeLED.off(); @@ -602,8 +602,8 @@ void sfeDataLogger::onInitStartupCommands(uint delaySecs) void sfeDataLogger::onInit(void) { // Did the user set a serial value? - uint theRate; - uint theDelay; + uint32_t theRate; + uint32_t theDelay; getStartupProperties(theRate, theDelay); // just to be safe... diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index c5e767b..f5d3785 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -342,11 +342,11 @@ class sfeDataLogger : public flxApplication void onErrorMessage(uint8_t); - void getStartupProperties(uint &baudRate, uint &startupDelay); + void getStartupProperties(uint32_t &baudRate, uint32_t &startupDelay); // Board button callbacks - void onButtonPressed(uint); - void onButtonReleased(uint); + void onButtonPressed(uint32_t); + void onButtonReleased(uint32_t); // battery level checks void checkBatteryLevels(void); diff --git a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp index 53710a6..98a1831 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp @@ -98,7 +98,6 @@ void sfeDataLogger::displayAppStatus(bool useInfo) char szSize[32]; char szCap[32]; char szAvail[32]; - flx_utils::formatByteString(_theSDCard.size(), 2, szSize, sizeof(szSize)); flx_utils::formatByteString(_theSDCard.total(), 2, szCap, sizeof(szCap)); flx_utils::formatByteString(_theSDCard.total() - _theSDCard.used(), 2, szAvail, sizeof(szAvail)); diff --git a/sfeDataLoggerIoT/sfeDataLoggerProps.cpp b/sfeDataLoggerIoT/sfeDataLoggerProps.cpp index b7dec12..07cc875 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerProps.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerProps.cpp @@ -167,7 +167,7 @@ void sfeDataLogger::set_termBaudRate(uint32_t newRate) } } //--------------------------------------------------------------------------- -void sfeDataLogger::getStartupProperties(uint &baudRate, uint &startupDelay) +void sfeDataLogger::getStartupProperties(uint32_t &baudRate, uint32_t &startupDelay) { // Do we have this block in storage? And yes, a little hacky with name :) flxStorageBlock *stBlk = _sysStorage.getBlock(((flxObject *)this)->name()); From c9aaa1884ff6744ec77118e834e2617e1067cc23 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Sat, 24 May 2025 11:22:25 -0600 Subject: [PATCH 03/46] move to modern version of the async web server, not the other fork .. see how this works - compiles, not tested --- .github/workflows/build-datalogger-iot.yml | 2 +- sfeDataLoggerIoT/sfeDLWebServer.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 45068d3..0e47852 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -65,7 +65,7 @@ jobs: run: ./flux-sdk/install-libs.sh - name: Install datalogger libraries - run: arduino-cli lib install FastLED ESPAsyncWebSrv + run: arduino-cli lib install FastLED "ESP Async WebServer" # Compile time - build the Firmware for the data logger. # Note: diff --git a/sfeDataLoggerIoT/sfeDLWebServer.h b/sfeDataLoggerIoT/sfeDLWebServer.h index 6bff626..6d8fba6 100644 --- a/sfeDataLoggerIoT/sfeDLWebServer.h +++ b/sfeDataLoggerIoT/sfeDLWebServer.h @@ -20,7 +20,9 @@ #include // Testing -#include +// Used a different version for v1.0* +// #include +#include class sfeDLWebServer : public flxActionType { From 48cccb357cceffb545c4fb6740f4c3459a085f29 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Sat, 24 May 2025 11:37:23 -0600 Subject: [PATCH 04/46] new sub dir for flux lib is being used --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 50969a0..7ecdb5e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ sfeDataLoggerIoT/html/ sfeDataLoggerIoT/latex/ .gitignore + +SparkFun_DataLoggerIoT/ From 5ece1b51c91d45c99482d974cae23d10e5ca0950 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Mon, 26 May 2025 10:15:48 -0600 Subject: [PATCH 05/46] update prompt - similar to iot node --- sfeDataLoggerIoT/sfeDataLogger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index eaff330..95ab4a1 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -876,7 +876,11 @@ bool sfeDataLogger::loop() uint8_t chIn = Serial.read(); if (chIn == '!') { + flxSerial.textToWhite(); + Serial.write('>'); + flxSerial.textToNormal(); Serial.write('!'); + Serial.flush(); sfeDLCommands cmdProcessor; bool status = cmdProcessor.processCommand(this); } From cb29980972ccfcdd3118f16799caad9ac85bb2c6 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Mon, 26 May 2025 10:16:28 -0600 Subject: [PATCH 06/46] the current esp32 core that works with the system is 3.0.7 --- .github/workflows/build-datalogger-iot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 0e47852..d82e09d 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -56,9 +56,9 @@ jobs: - name: Arduino - Update index run: arduino-cli core update-index - # Install ESP32 - v2.0.9 (May, 2023) + # Install ESP32 - v3.0.7 - working as of June 2025 (latest versions fail for various reasons) - name: Arduino - Install ESP32 platform - run: arduino-cli core install esp32:esp32@2.0.14 + run: arduino-cli core install esp32:esp32@3.0.7 # install the libraries Flux uses - name: Install Flux dependant libraries. From dee2fc3340b9aafd21b61d3d2fe85bc25b91958e Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Tue, 27 May 2025 16:11:17 -0600 Subject: [PATCH 07/46] wiring in logging triggered by PPS signal from a connected GNSS board ... --- sfeDataLoggerIoT/sfeDLBoard.h | 5 +++++ sfeDataLoggerIoT/sfeDataLogger.h | 2 ++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDLBoard.h b/sfeDataLoggerIoT/sfeDLBoard.h index 167c047..aa93a1d 100644 --- a/sfeDataLoggerIoT/sfeDLBoard.h +++ b/sfeDataLoggerIoT/sfeDLBoard.h @@ -11,6 +11,7 @@ // Board specific things for the DataLogger.. #pragma once +#include // Pins // Das Boot button @@ -24,3 +25,7 @@ const uint8_t kDLBoardLEDBuiltin = 25; // RGB LED const uint8_t kDLBoardLEDRGBBuiltin = 26; + +// Define the GNSS PPS pin for the datalogger IoT board +const uint8_t kDLBoardGNSSPPSPin = 5; +; diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index f5d3785..574606e 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -184,6 +184,8 @@ class sfeDataLogger : public flxApplication //--------------------------------------------------------------------- void setupENS160(void); + //--------------------------------------------------------------------- + void setupGNSS(void); //------------------------------------------ // For controlling the log output types diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 6776ad9..8b9452a 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -13,6 +13,7 @@ * SparkFun Data Logger - setup methods * */ +#include "sfeDLBoard.h" #include "sfeDataLogger.h" #include @@ -227,4 +228,23 @@ void sfeDataLogger::setupENS160(void) flxLog_I(F("%s: compensation values applied from %s"), pENS160->name(), pSHTC3->name()); return; } +} +//--------------------------------------------------------------------------- +void sfeDataLogger::setupGNSS(void) +{ + // do we have one attached? + auto gnssDevices = flux.get(); + if (gnssDevices->size() == 0) + return; + + // get the first GNSS device and set the PPS Pin that can be used + flxDevGNSS *pGNSS = gnssDevices->at(0); + if (!pGNSS) + return; + + // set the in we use for PPS -- expect the input to be wired to this + pGNSS->set_pps_pin(kDLBoardGNSSPPSPin); + + // wire in the event to the logger + flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, &_logger, &flxLogger::logObservation); } \ No newline at end of file From 749ab121b3351bd59282735a0a972af9b55e7b79 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 28 May 2025 15:04:19 -0600 Subject: [PATCH 08/46] better task name for led --- sfeDataLoggerIoT/sfeDLLed.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDLLed.cpp b/sfeDataLoggerIoT/sfeDLLed.cpp index 05e3367..ea0710b 100644 --- a/sfeDataLoggerIoT/sfeDLLed.cpp +++ b/sfeDataLoggerIoT/sfeDLLed.cpp @@ -123,7 +123,7 @@ bool _sfeLED::initialize(void) // Event processing task BaseType_t xReturnValue = xTaskCreate(_sfeLED_TaskProcessing, // Event processing task function - "eventProc", // String with name of task. + "LEDEventProc", // String with name of task. kStackSize, // Stack size in 32 bit words. NULL, // Parameter passed as input of the task 1, // Priority of the task. From 401fd41526ef9be5f1c00f0dd591c07638398f8a Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 28 May 2025 15:05:02 -0600 Subject: [PATCH 09/46] changes to support setup of GNSS PPS triggered events --- sfeDataLoggerIoT/sfeDLBoard.h | 2 +- sfeDataLoggerIoT/sfeDataLogger.cpp | 4 ++++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDLBoard.h b/sfeDataLoggerIoT/sfeDLBoard.h index aa93a1d..81a48c1 100644 --- a/sfeDataLoggerIoT/sfeDLBoard.h +++ b/sfeDataLoggerIoT/sfeDLBoard.h @@ -27,5 +27,5 @@ const uint8_t kDLBoardLEDBuiltin = 25; const uint8_t kDLBoardLEDRGBBuiltin = 26; // Define the GNSS PPS pin for the datalogger IoT board -const uint8_t kDLBoardGNSSPPSPin = 5; +const uint16_t kDLBoardGNSSPPSPins[] = {33, 36}; ; diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 95ab4a1..131dde1 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -477,6 +477,10 @@ void sfeDataLogger::onDeviceLoad() for (auto tw : *twists) _logger.listen(tw->on_clicked); // Connect logger to the clicked event } + + // setup the GNSS device - will create some properties that should be visible + // after the device is loaded and before restore (if the settings are saved) + setupGNSS(); } //--------------------------------------------------------------------- // onRestore() diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 8b9452a..414212b 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -243,7 +243,7 @@ void sfeDataLogger::setupGNSS(void) return; // set the in we use for PPS -- expect the input to be wired to this - pGNSS->set_pps_pin(kDLBoardGNSSPPSPin); + pGNSS->setAvailablePPSPins(kDLBoardGNSSPPSPins, sizeof(kDLBoardGNSSPPSPins) / sizeof(kDLBoardGNSSPPSPins[0])); // wire in the event to the logger flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, &_logger, &flxLogger::logObservation); From ac701fcf542c29b842be05eaed438bb66dc92f6a Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 28 May 2025 15:37:30 -0600 Subject: [PATCH 10/46] added verbose mode menu option and command --- sfeDataLoggerIoT/sfeDLCommands.h | 38 +++++++++---------------- sfeDataLoggerIoT/sfeDataLogger.cpp | 14 +++++---- sfeDataLoggerIoT/sfeDataLogger.h | 9 +++++- sfeDataLoggerIoT/sfeDataLoggerProps.cpp | 26 +++++++++++++++++ 4 files changed, 56 insertions(+), 31 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDLCommands.h b/sfeDataLoggerIoT/sfeDLCommands.h index d789543..303a07b 100644 --- a/sfeDataLoggerIoT/sfeDLCommands.h +++ b/sfeDataLoggerIoT/sfeDLCommands.h @@ -193,41 +193,31 @@ class sfeDLCommands } //--------------------------------------------------------------------- /// - /// @brief Enables *normal* log level output - /// - /// @param dlApp Pointer to the DataLogger App - /// @retval bool indicates success (true) or failure (!true) - /// - bool logLevelNormal(sfeDataLogger *dlApp) - { - flxLog.setLogLevel(flxLogInfo); - flxLog_I(F("Output level set to Normal")); - return true; - } - //--------------------------------------------------------------------- - /// - /// @brief Enables debug log level output + /// @brief Enables verbose log level output /// /// @param dlApp Pointer to the DataLogger App /// @retval bool indicates success (true) or failure (!true) /// - bool logLevelDebug(sfeDataLogger *dlApp) + bool logLevelVerbose(sfeDataLogger *dlApp) { - flxLog.setLogLevel(flxLogDebug); - flxLog_D(F("Output level set to Debug")); + flxLog.setLogLevel(flxLogVerbose); + flxLog_V(F("Output level set to Verbose")); return true; } //--------------------------------------------------------------------- /// - /// @brief Enables verbose log level output + /// @brief Toggle verbose output /// - /// @param dlApp Pointer to the DataLogger App + /// @param theApp Pointer to the DataLogger App /// @retval bool indicates success (true) or failure (!true) /// - bool logLevelVerbose(sfeDataLogger *dlApp) + bool toggleVerboseOutput(sfeDataLogger *theApp) { - flxLog.setLogLevel(flxLogVerbose); - flxLog_V(F("Output level set to Verbose")); + + if (theApp) + theApp->set_verbose(!theApp->get_verbose()); + flxLog_I("Verbose Output %s", theApp->get_verbose() ? "Enabled" : "Disabled"); + return true; } //--------------------------------------------------------------------- @@ -474,9 +464,7 @@ class sfeDLCommands {"devices", &sfeDLCommands::listLoadedDevices}, {"save-settings", &sfeDLCommands::saveSettings}, {"heap", &sfeDLCommands::heapStatus}, - {"normal-output", &sfeDLCommands::logLevelNormal}, - {"debug-output", &sfeDLCommands::logLevelDebug}, - {"verbose-output", &sfeDLCommands::logLevelVerbose}, + {"verbose", &sfeDLCommands::toggleVerboseOutput}, {"systime", &sfeDLCommands::outputSystemTime}, {"uptime", &sfeDLCommands::outputUpTime}, {"device-id", &sfeDLCommands::printDeviceID}, diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 131dde1..01693e6 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -145,6 +145,7 @@ sfeDataLogger::sfeDataLogger() flxRegister(startupOutputMode, "Startup Messages", "Level of message output at startup"); flxRegister(startupDelaySecs, "Startup Delay", "Startup Menu Delay in Seconds"); flxRegister(verboseDevNames, "Device Names", "Name always includes the device address"); + flxRegister(verboseEnabled, "Verbose Messages", "Enable verbose messages"); // about? flxRegister(aboutApplication, "About...", "Details about the system"); @@ -532,11 +533,14 @@ void sfeDataLogger::onInitStartupCommands(uint delaySecs) uint16_t mode; const char *name; } startupCommand_t; - startupCommand_t commands[] = {{'n', kDataLoggerOpNone, "normal-startup"}, - {'a', kDataLoggerOpStartNoAutoload, "device-auto-load-disabled"}, - {'l', kDataLoggerOpStartListDevices, "i2c-driver-listing-enabled"}, - {'w', kDataLoggerOpStartNoWiFi, "wifi-disabled"}, - {'s', kDataLoggerOpStartNoSettings, "settings-restore-disabled"}}; + startupCommand_t commands[] = { + {'n', kDataLoggerOpNone, "normal-startup"}, + {'v', kAppOpStartVerboseOutput, "verbose-output-enabled"}, + {'a', kDataLoggerOpStartNoAutoload, "device-auto-load-disabled"}, + {'l', kDataLoggerOpStartListDevices, "i2c-driver-listing-enabled"}, + {'w', kDataLoggerOpStartNoWiFi, "wifi-disabled"}, + {'s', kDataLoggerOpStartNoSettings, "settings-restore-disabled"}, + }; // Default int iCommand = 0; diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 574606e..69cd0b1 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -112,10 +112,11 @@ const uint32_t kStartupMenuDefaultDelaySecs = 2; #define kDataLoggerOpStartListDevices (1 << 4) #define kDataLoggerOpStartNoSettings (1 << 5) #define kDataLoggerOpStartNoWiFi (1 << 6) +#define kAppOpStartVerboseOutput (1 << 7) #define kDataLoggerOpStartAllFlags \ (kDataLoggerOpStartNoAutoload | kDataLoggerOpStartListDevices | kDataLoggerOpStartNoSettings | \ - kDataLoggerOpStartNoWiFi) + kDataLoggerOpStartNoWiFi | kAppOpStartVerboseOutput) #define inOpMode(__mode__) ((_opFlags & __mode__) == __mode__) #define setOpMode(__mode__) _opFlags |= __mode__ @@ -244,6 +245,9 @@ class sfeDataLogger : public flxApplication std::string get_local_name(void); void set_local_name(std::string name); + bool get_verbose(void); + void set_verbose(bool enable); + // color text bool get_color_text(void); void set_color_text(bool); @@ -322,6 +326,9 @@ class sfeDataLogger : public flxApplication kAppStartupMsgNormal, {{"Normal", kAppStartupMsgNormal}, {"Compact", kAppStartupMsgCompact}, {"Disabled", kAppStartupMsgNone}}}; + // Verbose messages enabled? + flxPropertyRWBool verboseEnabled = {false}; + // log system info // Enabled/Disabled flxPropertyRWBool logSysInfo; diff --git a/sfeDataLoggerIoT/sfeDataLoggerProps.cpp b/sfeDataLoggerIoT/sfeDataLoggerProps.cpp index 07cc875..c39eeaa 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerProps.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerProps.cpp @@ -249,3 +249,29 @@ void sfeDataLogger::set_logsysinfo(bool bEnableSysLog) else _logger.remove(_pSystemInfo); } +//--------------------------------------------------------------------------- +// verbose messages +//--------------------------------------------------------------------------- +void sfeDataLogger::set_verbose(bool enable) +{ + + // If disable, but we are in startup mode that enables verbose, don't set disable + if (enable) + { + + flxSetLoggingVerbose(); + + // if in startup, the verbose mode is being set via pref restore. Note the change to user + if (inOpMode(kDataLoggerOpStartup)) + { + flxLog_N(""); + flxLog_V(F("Verbose output enabled")); + } + } + else if (!inOpMode(kAppOpStartVerboseOutput)) + flxSetLoggingInfo(); +} +bool sfeDataLogger::get_verbose(void) +{ + return flxIsLoggingVerbose(); +} \ No newline at end of file From 35e087084ce149870035d11740632a02c7012fd4 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Thu, 29 May 2025 08:11:07 -0600 Subject: [PATCH 11/46] added use/support of the log trigger source --- sfeDataLoggerIoT/sfeDLCommands.h | 2 +- sfeDataLoggerIoT/sfeDataLogger.cpp | 2 +- sfeDataLoggerIoT/sfeDataLogger.h | 1 + sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 6 +++++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDLCommands.h b/sfeDataLoggerIoT/sfeDLCommands.h index 303a07b..173f91f 100644 --- a/sfeDataLoggerIoT/sfeDLCommands.h +++ b/sfeDataLoggerIoT/sfeDLCommands.h @@ -406,7 +406,7 @@ class sfeDLCommands if (!dlApp) return false; - dlApp->_logger.logObservation(); + flxSendEvent(flxEvent::kOnLogObservationWithSource, "COMMAND"); return true; } diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 01693e6..6970996 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -704,7 +704,7 @@ bool sfeDataLogger::onStart() _wifiConnection.connect(); // Logging is done at an interval - using an interval timer. // Connect logger to the timer event - _logger.listen(_timer.on_interval); + _logger.listen(_timer.on_interval_with_name); // - Add the JSON and CVS format to the logger _logger.add(_fmtJSON); diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 69cd0b1..3071d15 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -187,6 +187,7 @@ class sfeDataLogger : public flxApplication //--------------------------------------------------------------------- void setupGNSS(void); + void gnssPPSEventCB(void); //------------------------------------------ // For controlling the log output types diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 414212b..fc3d711 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -229,6 +229,10 @@ void sfeDataLogger::setupENS160(void) return; } } +void sfeDataLogger::gnssPPSEventCB(void) +{ + flxSendEvent(flxEvent::kOnLogObservationWithSource, "PPS"); +} //--------------------------------------------------------------------------- void sfeDataLogger::setupGNSS(void) { @@ -246,5 +250,5 @@ void sfeDataLogger::setupGNSS(void) pGNSS->setAvailablePPSPins(kDLBoardGNSSPPSPins, sizeof(kDLBoardGNSSPPSPins) / sizeof(kDLBoardGNSSPPSPins[0])); // wire in the event to the logger - flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, &_logger, &flxLogger::logObservation); + flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, this, &sfeDataLogger::gnssPPSEventCB); } \ No newline at end of file From d64c12d1d1f6bb5fad049eba1db55ba3315bf155 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Thu, 29 May 2025 08:49:58 -0600 Subject: [PATCH 12/46] better name for command --- sfeDataLoggerIoT/sfeDLCommands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDLCommands.h b/sfeDataLoggerIoT/sfeDLCommands.h index 173f91f..ee5b89e 100644 --- a/sfeDataLoggerIoT/sfeDLCommands.h +++ b/sfeDataLoggerIoT/sfeDLCommands.h @@ -406,7 +406,7 @@ class sfeDLCommands if (!dlApp) return false; - flxSendEvent(flxEvent::kOnLogObservationWithSource, "COMMAND"); + flxSendEvent(flxEvent::kOnLogObservationWithSource, "CLI"); return true; } From 6f33a1a599646a4991c9854a511fa5684a893cb4 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 30 May 2025 12:36:23 -0600 Subject: [PATCH 13/46] futher work for serial - event relay to logger --- sfeDataLoggerIoT/sfeDataLogger.h | 6 ++++++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 3071d15..6b8b204 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -188,6 +188,12 @@ class sfeDataLogger : public flxApplication //--------------------------------------------------------------------- void setupGNSS(void); void gnssPPSEventCB(void); + + //--------------------------------------------------------------------------- + // serial input device setup and event methods ... + void serialDataEventCB(void); + void setupSerial(void); + //------------------------------------------ // For controlling the log output types diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index fc3d711..333bb04 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -21,6 +21,7 @@ #include #include #include +#include // Biometric Hub -- requires pins to be set on startup static const uint8_t kAppBioHubReset = 17; // Use the TXD pin as the bio hub reset pin @@ -251,4 +252,16 @@ void sfeDataLogger::setupGNSS(void) // wire in the event to the logger flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, this, &sfeDataLogger::gnssPPSEventCB); +} +//--------------------------------------------------------------------------- +// setup serial device things +void sfeDataLogger::serialDataEventCB(void) +{ + flxSendEvent(flxEvent::kOnLogObservationWithSource, "SERIAL"); +} +//--------------------------------------------------------------------------- +void sfeDataLogger::setupSerial(void) +{ + // wire in the event to the logger + flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::serialDataEventCB); } \ No newline at end of file From 23e9f236ea91955ef368e73c03ceec7a08075a22 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 30 May 2025 15:53:09 -0600 Subject: [PATCH 14/46] additional work to wire in the external serial system...setup and general creation seems to be working - havent run it yet --- sfeDataLoggerIoT/sfeDLBoard.h | 5 ++++- sfeDataLoggerIoT/sfeDataLogger.cpp | 9 +++++++++ sfeDataLoggerIoT/sfeDataLogger.h | 10 ++++++++-- sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 9 ++++++--- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDLBoard.h b/sfeDataLoggerIoT/sfeDLBoard.h index 81a48c1..5bcf0f4 100644 --- a/sfeDataLoggerIoT/sfeDLBoard.h +++ b/sfeDataLoggerIoT/sfeDLBoard.h @@ -28,4 +28,7 @@ const uint8_t kDLBoardLEDRGBBuiltin = 26; // Define the GNSS PPS pin for the datalogger IoT board const uint16_t kDLBoardGNSSPPSPins[] = {33, 36}; -; + +// External Serial pins on the board +const uint8_t kDLBoardExtSerialRXPin = 16; +const uint8_t kDLBoardExtSerialTXPin = 17; diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 6970996..bf79f7c 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -482,6 +482,9 @@ void sfeDataLogger::onDeviceLoad() // setup the GNSS device - will create some properties that should be visible // after the device is loaded and before restore (if the settings are saved) setupGNSS(); + + // setup the external serial device manager + setupExtSerial(); } //--------------------------------------------------------------------- // onRestore() @@ -630,6 +633,12 @@ void sfeDataLogger::onInit(void) startupDelaySecs = theDelay; onInitStartupCommands(theDelay); + + // change the order of the system settings + flux.insert_after(&flxSettings, &flxClock); + + // set the location of the external serial system + flux.insert_after(&_extSerial, &_theOutputFile); } //--------------------------------------------------------------------------- // Check our platform status diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 6b8b204..04ab96f 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -63,6 +63,9 @@ #include #include +// External Serial Device connection and use +#include + // System Firmware update/reset #include @@ -191,8 +194,8 @@ class sfeDataLogger : public flxApplication //--------------------------------------------------------------------------- // serial input device setup and event methods ... - void serialDataEventCB(void); - void setupSerial(void); + void extSerialDataEventCB(void); + void setupExtSerial(void); //------------------------------------------ // For controlling the log output types @@ -402,6 +405,9 @@ class sfeDataLogger : public flxApplication // a biometric sensor hub flxDevBioHub _bioHub; + // the external serial connection manager + flxOptExtSerial _extSerial; + // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 333bb04..230ee74 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -255,13 +255,16 @@ void sfeDataLogger::setupGNSS(void) } //--------------------------------------------------------------------------- // setup serial device things -void sfeDataLogger::serialDataEventCB(void) +void sfeDataLogger::extSerialDataEventCB(void) { flxSendEvent(flxEvent::kOnLogObservationWithSource, "SERIAL"); } //--------------------------------------------------------------------------- -void sfeDataLogger::setupSerial(void) +void sfeDataLogger::setupExtSerial(void) { + // setup the pins + _extSerial.rxPin(kDLBoardExtSerialRXPin); + _extSerial.txPin(kDLBoardExtSerialTXPin); // wire in the event to the logger - flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::serialDataEventCB); + flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::extSerialDataEventCB); } \ No newline at end of file From 3909e019066d8f1ad42c4fb9a41c490235fc74ff Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Mon, 2 Jun 2025 16:35:18 -0600 Subject: [PATCH 15/46] cleanup, add device add/remove event management / handlers --- sfeDataLoggerIoT/sfeDataLogger.cpp | 41 ++++++++++++++++++++++++- sfeDataLoggerIoT/sfeDataLogger.h | 4 +++ sfeDataLoggerIoT/sfeDataLoggerAbout.cpp | 6 ++-- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index bf79f7c..137d52b 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -745,8 +745,10 @@ bool sfeDataLogger::onStart() flxLog_N_(F(" %-20s - %-40s {"), device->name(), device->description()); if (device->getKind() == flxDeviceKindI2C) flxLog_N("%s x%x}", "qwiic", device->address()); - else + else if (device->getKind() == flxDeviceKindSPI) flxLog_N("%s p%u}", "SPI", device->address()); + else if (device->getKind() == flxDeviceKindGPIO) + flxLog_N("%s p%u}", "GPIO", device->address()); if (device->nOutputParameters() > 0) _logger.add(device); @@ -790,6 +792,10 @@ bool sfeDataLogger::onStart() // for our web server file search _iotWebServer.setFilePrefix(_theOutputFile.filePrefix()); + // Register our device management event handlers + flxRegisterEventCB(flxEvent::kOnFluxAddDevice, this, &sfeDataLogger::onDeviceAdded); + flxRegisterEventCB(flxEvent::kOnFluxRemoveDevice, this, &sfeDataLogger::onDeviceRemoved); + // clear startup flags/mode clearOpMode(kDataLoggerOpStartup); clearOpMode(kDataLoggerOpStartAllFlags); @@ -798,6 +804,7 @@ bool sfeDataLogger::onStart() if (_pDisplay) _pDisplay->update(); #endif + sfeLED.off(); // we are done with startup - reset output mode @@ -879,6 +886,38 @@ void sfeDataLogger::checkBatteryLevels(void) sfeLED.flash(color); } +//--------------------------------------------------------------------------- +// Device bookkeeping +//--------------------------------------------------------------------------- +void sfeDataLogger::onDeviceAdded(uint32_t uiDevice) +{ + flxLog_I("Device Added: %u", uiDevice); + // if in startup skip + if (inOpMode(kDataLoggerOpStartup)) + return; + + flxDevice *pDevice = (flxDevice *)uiDevice; + if (pDevice == nullptr) + return; + + // add this device to the logger + _logger.add(pDevice); +} +void sfeDataLogger::onDeviceRemoved(uint32_t uiDevice) +{ + flxLog_I("Device Removed: %u", uiDevice); + + // if in startup skip + if (inOpMode(kDataLoggerOpStartup)) + return; + + flxDevice *pDevice = (flxDevice *)uiDevice; + if (pDevice == nullptr) + return; + + // remove this device from the logger + _logger.remove(pDevice); +} //--------------------------------------------------------------------------- // loop() // diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 04ab96f..67f0e8e 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -370,6 +370,10 @@ class sfeDataLogger : public flxApplication // battery level checks void checkBatteryLevels(void); + // system device add/remove events -- when this happens, bookkeeping is requires + void onDeviceAdded(uint32_t); + void onDeviceRemoved(uint32_t); + // Class members -- that make up the application structure // WiFi and NTP diff --git a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp index 98a1831..fe2a04f 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp @@ -227,9 +227,11 @@ void sfeDataLogger::displayAppStatus(bool useInfo) flxLog_N_(F("%c %-20s - %-40s {"), pre_ch, device->name(), device->description()); if (device->getKind() == flxDeviceKindI2C) flxLog_N("%s x%x}", "qwiic", device->address()); - else + else if (device->getKind() == flxDeviceKindSPI) flxLog_N("%s p%u}", "SPI", device->address()); - } + else if (device->getKind() == flxDeviceKindGPIO) + flxLog_N("%s p%u}", "GPIO", device->address()); + } flxLog_N(""); } From d3981587bb06de0d56a83842238ac7911cea29a5 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Tue, 3 Jun 2025 08:12:52 -0600 Subject: [PATCH 16/46] latest work on serial --- sfeDataLoggerIoT/sfeDataLogger.cpp | 9 +++++++++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 137d52b..eabdf4f 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -729,6 +729,15 @@ bool sfeDataLogger::onStart() // setup NFC - it provides another means to load WiFi credentials setupNFDevice(); + // now lets rock on the external serilal device + if (_extSerial.begin()) + flxLog_I(F("External Serial Device started: RX %u, TX %u, Baud: %u"), _extSerial.rxPin(), _extSerial.txPin(), + _extSerial.serialBaudRate()); + else + flxLog_I(F("External Serial Device not started")); + + flxLog_N(""); + // check our I2C devices // Loop over the device list - note that it is iterable. flxLog_I_(F("Loading devices ... ")); diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 230ee74..e0a1774 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -262,7 +262,7 @@ void sfeDataLogger::extSerialDataEventCB(void) //--------------------------------------------------------------------------- void sfeDataLogger::setupExtSerial(void) { - // setup the pins + // setup the default pins _extSerial.rxPin(kDLBoardExtSerialRXPin); _extSerial.txPin(kDLBoardExtSerialTXPin); // wire in the event to the logger From c295139d03117bcc3e82f569a4d50ca26fc091ad Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Tue, 3 Jun 2025 20:08:30 -0600 Subject: [PATCH 17/46] add ext serial reset call at end of startup - fixes dead serial issue --- sfeDataLoggerIoT/sfeDataLogger.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index eabdf4f..b61980e 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -820,7 +820,10 @@ bool sfeDataLogger::onStart() if (startupOutputMode() != kAppStartupMsgNormal) flxLog.setLogLevel(flxLogInfo); - // flxLog_I("DEBUG: onStart() - exit - Free Heap: %d", ESP.getFreeHeap()); + // June 2025 - ESP32 arduino core v3.07- if a serial device is enabled, the setup of the device (above) + // the serial device doesn't behave correctly - new data fails to register. But, "resetting it here" + // enables the serial device to work correctly. + _extSerial.reset(); return true; } From a45c8da40fc53a886efd6b849b58963cd3721a70 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 4 Jun 2025 08:09:07 -0600 Subject: [PATCH 18/46] remove reset call - now handled in sdk --- sfeDataLoggerIoT/sfeDataLogger.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index b61980e..2d06fba 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -820,11 +820,6 @@ bool sfeDataLogger::onStart() if (startupOutputMode() != kAppStartupMsgNormal) flxLog.setLogLevel(flxLogInfo); - // June 2025 - ESP32 arduino core v3.07- if a serial device is enabled, the setup of the device (above) - // the serial device doesn't behave correctly - new data fails to register. But, "resetting it here" - // enables the serial device to work correctly. - _extSerial.reset(); - return true; } From 0b5a4235cb649150eea2586fef3ee6c244d23c6d Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 4 Jun 2025 17:09:56 -0600 Subject: [PATCH 19/46] remove debug statements for device add/rm events --- sfeDataLoggerIoT/sfeDataLogger.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 2d06fba..60a15d7 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -898,7 +898,6 @@ void sfeDataLogger::checkBatteryLevels(void) //--------------------------------------------------------------------------- void sfeDataLogger::onDeviceAdded(uint32_t uiDevice) { - flxLog_I("Device Added: %u", uiDevice); // if in startup skip if (inOpMode(kDataLoggerOpStartup)) return; @@ -912,8 +911,6 @@ void sfeDataLogger::onDeviceAdded(uint32_t uiDevice) } void sfeDataLogger::onDeviceRemoved(uint32_t uiDevice) { - flxLog_I("Device Removed: %u", uiDevice); - // if in startup skip if (inOpMode(kDataLoggerOpStartup)) return; From 37ed23acf7a3c0a3e69ef0c042942072f358a330 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 6 Jun 2025 17:28:36 -0600 Subject: [PATCH 20/46] added the Interrupt event action - triggers logging events --- sfeDataLoggerIoT/sfeDLBoard.h | 3 +++ sfeDataLoggerIoT/sfeDataLogger.cpp | 5 +++++ sfeDataLoggerIoT/sfeDataLogger.h | 8 ++++++++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 10 +++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDLBoard.h b/sfeDataLoggerIoT/sfeDLBoard.h index 5bcf0f4..9180803 100644 --- a/sfeDataLoggerIoT/sfeDLBoard.h +++ b/sfeDataLoggerIoT/sfeDLBoard.h @@ -32,3 +32,6 @@ const uint16_t kDLBoardGNSSPPSPins[] = {33, 36}; // External Serial pins on the board const uint8_t kDLBoardExtSerialRXPin = 16; const uint8_t kDLBoardExtSerialTXPin = 17; + +// pins that can be used for interrupts. +const uint16_t kDLBoardIntrruptPins[] = {33, 36}; \ No newline at end of file diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 60a15d7..0c6c85f 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -485,6 +485,9 @@ void sfeDataLogger::onDeviceLoad() // setup the external serial device manager setupExtSerial(); + + // setup interrupt event + setInterruptEvent(); } //--------------------------------------------------------------------- // onRestore() @@ -639,6 +642,8 @@ void sfeDataLogger::onInit(void) // set the location of the external serial system flux.insert_after(&_extSerial, &_theOutputFile); + + flux.insert_after(&_extIntrEvent, &_extSerial); } //--------------------------------------------------------------------------- // Check our platform status diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 67f0e8e..10096f8 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -66,6 +66,9 @@ // External Serial Device connection and use #include +// Interrupt event to drive logging +#include + // System Firmware update/reset #include @@ -197,6 +200,8 @@ class sfeDataLogger : public flxApplication void extSerialDataEventCB(void); void setupExtSerial(void); + void setInterruptEvent(void); + //------------------------------------------ // For controlling the log output types @@ -412,6 +417,9 @@ class sfeDataLogger : public flxApplication // the external serial connection manager flxOptExtSerial _extSerial; + // interrupt event to drive logging + flxOptInterruptEvent _extIntrEvent; + // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index e0a1774..0005974 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -267,4 +267,12 @@ void sfeDataLogger::setupExtSerial(void) _extSerial.txPin(kDLBoardExtSerialTXPin); // wire in the event to the logger flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::extSerialDataEventCB); -} \ No newline at end of file +} + +void sfeDataLogger::setInterruptEvent(void) +{ + _extIntrEvent.setAvailablePins(kDLBoardIntrruptPins, + sizeof(kDLBoardIntrruptPins) / sizeof(kDLBoardIntrruptPins[0])); + + _extIntrEvent.setEventToSend(flxEvent::kOnLogObservationWithSource); +} From e58c605bed0bd65780d99445ff18cb00398e01e4 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Mon, 9 Jun 2025 16:44:47 -0600 Subject: [PATCH 21/46] add enable/disable support for the soil sensor --- sfeDataLoggerIoT/sfeDataLogger.cpp | 2 ++ sfeDataLoggerIoT/sfeDataLogger.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 0c6c85f..1153d85 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -644,6 +644,8 @@ void sfeDataLogger::onInit(void) flux.insert_after(&_extSerial, &_theOutputFile); flux.insert_after(&_extIntrEvent, &_extSerial); + + flux.insert_after(&_soilMoistureEnable, &_extIntrEvent); } //--------------------------------------------------------------------------- // Check our platform status diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 10096f8..4d53101 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -69,6 +69,10 @@ // Interrupt event to drive logging #include +// Soil moisture sensor enable +#include +#include + // System Firmware update/reset #include @@ -420,6 +424,10 @@ class sfeDataLogger : public flxApplication // interrupt event to drive logging flxOptInterruptEvent _extIntrEvent; + // Soil moisture sensor Enable manager + flxOptEnableDevice _soilMoistureEnable = {"Soil Moisture Sensor", + "Enable GPIO attached Soil Moisture Sensor"}; + // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; From 014bddbed01df74b4ad34699ccf83881923e4b3b Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Tue, 10 Jun 2025 08:35:13 -0600 Subject: [PATCH 22/46] testing - working - passing init params to the Soil Sensor manager --- sfeDataLoggerIoT/sfeDataLogger.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 4d53101..7c6e99b 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -425,9 +425,10 @@ class sfeDataLogger : public flxApplication flxOptInterruptEvent _extIntrEvent; // Soil moisture sensor Enable manager - flxOptEnableDevice _soilMoistureEnable = {"Soil Moisture Sensor", - "Enable GPIO attached Soil Moisture Sensor"}; - + flxOptEnableDevice2 _soilMoistureEnable = { + "Soil Moisture Sensor", "Enable GPIO attached Soil Moisture Sensor", (uint8_t)33, (uint8_t)2}; + // flxOptEnableDevice2 _soilMoistureEnable = {"Soil Moisture Sensor", + // "Enable GPIO attached Soil Moisture Sensor"}; // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; From cca793f2234626a3228c98900fccd26bff9b9882 Mon Sep 17 00:00:00 2001 From: KDB Date: Tue, 10 Jun 2025 12:41:56 -0600 Subject: [PATCH 23/46] makes use of the updated OptEnableDevice - which takes initial values for the created device constructor --- sfeDataLoggerIoT/sfeDataLogger.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 7c6e99b..97e07b3 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -424,11 +424,14 @@ class sfeDataLogger : public flxApplication // interrupt event to drive logging flxOptInterruptEvent _extIntrEvent; - // Soil moisture sensor Enable manager - flxOptEnableDevice2 _soilMoistureEnable = { + // Soil moisture sensor Enable manager. We use the flxOptEnableDevice template to manage the device + // This allows us to enable/disable the device and manage its lifecycle. + // We pass in an initialiser list that contains: + // - The name and description of the device. + // - The default pins for the soil sensor - VCC and Sensor pin. + flxOptEnableDevice _soilMoistureEnable = { "Soil Moisture Sensor", "Enable GPIO attached Soil Moisture Sensor", (uint8_t)33, (uint8_t)2}; - // flxOptEnableDevice2 _soilMoistureEnable = {"Soil Moisture Sensor", - // "Enable GPIO attached Soil Moisture Sensor"}; + // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; From 2f424f35223a289f887fa97ff4af9d24d1af9f3e Mon Sep 17 00:00:00 2001 From: KDB Date: Tue, 10 Jun 2025 16:59:23 -0600 Subject: [PATCH 24/46] in progress - eod stop --- sfeDataLoggerIoT/sfeDataLogger.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 97e07b3..f341880 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -73,6 +73,9 @@ #include #include +// analog pin +#include + // System Firmware update/reset #include @@ -432,6 +435,14 @@ class sfeDataLogger : public flxApplication flxOptEnableDevice _soilMoistureEnable = { "Soil Moisture Sensor", "Enable GPIO attached Soil Moisture Sensor", (uint8_t)33, (uint8_t)2}; + // Analog pin device + // This allows us to enable/disable the device and manage its lifecycle. + // We pass in an initialiser list that contains: + // - The name and description of the device. + // - Available pins + // - The pin names for the analog pins. + flxOptEnableDevice _analogPinEnable = { + "Analog Pin Sensor", "Read analog values from a pin", {{"A0", 36}, {"A3", 39}, {"A7", 35}}}; // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; From 2f3ddad732ca29c903c8ec38c48f4fc4d3e5b572 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 11 Jun 2025 10:56:03 -0600 Subject: [PATCH 25/46] update and categorize the gpio device additions made --- sfeDataLoggerIoT/sfeDataLogger.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 1153d85..0760e70 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -640,12 +640,14 @@ void sfeDataLogger::onInit(void) // change the order of the system settings flux.insert_after(&flxSettings, &flxClock); - // set the location of the external serial system - flux.insert_after(&_extSerial, &_theOutputFile); - - flux.insert_after(&_extIntrEvent, &_extSerial); - - flux.insert_after(&_soilMoistureEnable, &_extIntrEvent); + // set interrupt event after the output file + flux.insert_after(&_extIntrEvent, &_theOutputFile); + + // GPIO devices in the menu + _extSerial.setTitle("GPIO Devices"); + flux.insert_after(&_extSerial, &_extIntrEvent); + flux.insert_after(&_soilMoistureEnable, &_extSerial); + flux.insert_after(&_analogPinEnable, &_soilMoistureEnable); } //--------------------------------------------------------------------------- // Check our platform status From ddfc61bdab75242d2271418a3f27cb20ec499685 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 11 Jun 2025 10:56:36 -0600 Subject: [PATCH 26/46] change descp of the trigger event --- sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 0005974..58b209c 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -268,9 +268,10 @@ void sfeDataLogger::setupExtSerial(void) // wire in the event to the logger flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::extSerialDataEventCB); } - +//--------------------------------------------------------------------------- void sfeDataLogger::setInterruptEvent(void) { + _extIntrEvent.setDescription("Trigger a logging event from an interrupt"); _extIntrEvent.setAvailablePins(kDLBoardIntrruptPins, sizeof(kDLBoardIntrruptPins) / sizeof(kDLBoardIntrruptPins[0])); From 483a441cddb43de82ec936d5581173e8b01504b3 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Wed, 11 Jun 2025 17:25:52 -0600 Subject: [PATCH 27/46] added *about* output for new GPIO features: intr events, serial input, soil sensor, analog sensor --- sfeDataLoggerIoT/sfeDataLoggerAbout.cpp | 44 ++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp index fe2a04f..136149f 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp @@ -175,6 +175,48 @@ void sfeDataLogger::displayAppStatus(bool useInfo) _theOutputFile.currentFilename().length() == 0 ? "" : _theOutputFile.currentFilename().c_str()); flxLog_N("%c Rotate Period: %d Hours", pre_ch, _theOutputFile.rotatePeriod()); + bool bEnabled = _extIntrEvent.isEnabled(); + flxLog__(logLevel, "%cInterrupt Log Trigger: %s", pre_ch, bEnabled ? "Enabled" : "Disabled"); + if (bEnabled) + { + flxLog__(logLevel, "%c Pin: %d", pre_ch, _extIntrEvent.intrPin()); + flxLog__(logLevel, "%c Event: %s", pre_ch, _extIntrEvent.eventName().c_str()); + } + flxLog_N(""); + if (!useInfo) + { + flxSerial.textToWhite(); + flxLog_N(" GPIO:"); + flxSerial.textToNormal(); + } + bEnabled = _extSerial.serialDeviceEnabled(); + flxLog__(logLevel, "%cSerial Device Logging: %s", pre_ch, bEnabled ? "Enabled" : "Disabled"); + if (bEnabled) + { + flxLog__(logLevel, "%c RX Pin: %d", pre_ch, _extSerial.rxPin()); + flxLog__(logLevel, "%c TX Pin: %d", pre_ch, _extSerial.txPin()); + flxLog__(logLevel, "%c Baud Rate: %d", pre_ch, _extSerial.serialBaudRate()); + } + bEnabled = _soilMoistureEnable.isEnabled(); + flxLog__(logLevel, "%cSoil Moisture Device: %s", pre_ch, bEnabled ? "Enabled" : "Disabled"); + if (bEnabled) + { + auto soilDevices = flux.get(); + if (soilDevices->size() > 0) + { + flxDevSoilMoisture *pSoil = soilDevices->at(0); + flxLog__(logLevel, "%c VCC Pin: %d", pre_ch, pSoil->vccPin()); + flxLog__(logLevel, "%c Sensor Pin: %d", pre_ch, pSoil->sensorPin()); + } + } + bEnabled = _analogPinEnable.isEnabled(); + flxLog__(logLevel, "%cAnalog Pin Sensor: %s", pre_ch, bEnabled ? "Enabled" : "Disabled"); + if (bEnabled) + { + auto analogDevices = flux.get(); + if (analogDevices->size() > 0) + flxLog__(logLevel, "%c Pin: %d", pre_ch, analogDevices->at(0)->sensorPin()); + } flxLog_N(""); if (!useInfo) { @@ -231,7 +273,7 @@ void sfeDataLogger::displayAppStatus(bool useInfo) flxLog_N("%s p%u}", "SPI", device->address()); else if (device->getKind() == flxDeviceKindGPIO) flxLog_N("%s p%u}", "GPIO", device->address()); - } + } flxLog_N(""); } From 0ac3f9297febb50d551f46d4748ec7550bdf8168 Mon Sep 17 00:00:00 2001 From: KDB Date: Fri, 13 Jun 2025 13:09:08 -0600 Subject: [PATCH 28/46] fix spello --- sfeDataLoggerIoT/sfeDLBoard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDLBoard.h b/sfeDataLoggerIoT/sfeDLBoard.h index 9180803..d4ce6fd 100644 --- a/sfeDataLoggerIoT/sfeDLBoard.h +++ b/sfeDataLoggerIoT/sfeDLBoard.h @@ -34,4 +34,4 @@ const uint8_t kDLBoardExtSerialRXPin = 16; const uint8_t kDLBoardExtSerialTXPin = 17; // pins that can be used for interrupts. -const uint16_t kDLBoardIntrruptPins[] = {33, 36}; \ No newline at end of file +const uint16_t kDLBoardInterruptPins[] = {33, 36}; \ No newline at end of file From 15000a6c794e2a609d59332c39022d9485cd8815 Mon Sep 17 00:00:00 2001 From: KDB Date: Fri, 13 Jun 2025 13:09:50 -0600 Subject: [PATCH 29/46] make use of event alias functionality - removed the callback *jump* work used to change event ids --- sfeDataLoggerIoT/sfeDataLogger.h | 4 ++-- sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 25 +++++++++---------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index f341880..92fb2ef 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -200,11 +200,11 @@ class sfeDataLogger : public flxApplication //--------------------------------------------------------------------- void setupGNSS(void); - void gnssPPSEventCB(void); + // void gnssPPSEventCB(void); //--------------------------------------------------------------------------- // serial input device setup and event methods ... - void extSerialDataEventCB(void); + // void extSerialDataEventCB(void); void setupExtSerial(void); void setInterruptEvent(void); diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 58b209c..9f33f15 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -230,10 +230,7 @@ void sfeDataLogger::setupENS160(void) return; } } -void sfeDataLogger::gnssPPSEventCB(void) -{ - flxSendEvent(flxEvent::kOnLogObservationWithSource, "PPS"); -} + //--------------------------------------------------------------------------- void sfeDataLogger::setupGNSS(void) { @@ -250,30 +247,26 @@ void sfeDataLogger::setupGNSS(void) // set the in we use for PPS -- expect the input to be wired to this pGNSS->setAvailablePPSPins(kDLBoardGNSSPPSPins, sizeof(kDLBoardGNSSPPSPins) / sizeof(kDLBoardGNSSPPSPins[0])); - // wire in the event to the logger - flxRegisterEventCB(flxEvent::kOnGNSSPPSEvent, this, &sfeDataLogger::gnssPPSEventCB); -} -//--------------------------------------------------------------------------- -// setup serial device things -void sfeDataLogger::extSerialDataEventCB(void) -{ - flxSendEvent(flxEvent::kOnLogObservationWithSource, "SERIAL"); + // map the GNSS PPS event to the log observation event + flxAddEventAliasWithValue(flxEvent::kOnGNSSPPSEvent, flxEvent::kOnLogObservationWithSource, "PPS"); } + //--------------------------------------------------------------------------- void sfeDataLogger::setupExtSerial(void) { // setup the default pins _extSerial.rxPin(kDLBoardExtSerialRXPin); _extSerial.txPin(kDLBoardExtSerialTXPin); - // wire in the event to the logger - flxRegisterEventCB(flxEvent::kOnSerialDataAvailable, this, &sfeDataLogger::extSerialDataEventCB); + + // map the data available event to the log observation event + flxAddEventAliasWithValue(flxEvent::kOnSerialDataAvailable, flxEvent::kOnLogObservationWithSource, "SERIAL"); } //--------------------------------------------------------------------------- void sfeDataLogger::setInterruptEvent(void) { _extIntrEvent.setDescription("Trigger a logging event from an interrupt"); - _extIntrEvent.setAvailablePins(kDLBoardIntrruptPins, - sizeof(kDLBoardIntrruptPins) / sizeof(kDLBoardIntrruptPins[0])); + _extIntrEvent.setAvailablePins(kDLBoardInterruptPins, + sizeof(kDLBoardInterruptPins) / sizeof(kDLBoardInterruptPins[0])); _extIntrEvent.setEventToSend(flxEvent::kOnLogObservationWithSource); } From fd82d68fd7740aa23e10b4710171cb5c5ee9f2ee Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 13 Jun 2025 15:35:13 -0600 Subject: [PATCH 30/46] date change --- sfeDataLoggerIoT/sfeDataLoggerAbout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp index 136149f..75fdb42 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerAbout.cpp @@ -1,7 +1,7 @@ /* *--------------------------------------------------------------------------------- * - * Copyright (c) 2022-2024, SparkFun Electronics Inc. + * Copyright (c) 2022-2025, SparkFun Electronics Inc. * * SPDX-License-Identifier: MIT * From c319b2bb4012632e39356b13f3fcb81bde9a4cbf Mon Sep 17 00:00:00 2001 From: KDB Date: Tue, 17 Jun 2025 12:55:56 -0600 Subject: [PATCH 31/46] moved IoT services into their own container to simplify operation/use --- sfeDataLoggerIoT/sfeDataLogger.cpp | 2 ++ sfeDataLoggerIoT/sfeDataLogger.h | 3 +++ sfeDataLoggerIoT/sfeDataLoggerSetup.cpp | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 0760e70..92593a7 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -648,6 +648,8 @@ void sfeDataLogger::onInit(void) flux.insert_after(&_extSerial, &_extIntrEvent); flux.insert_after(&_soilMoistureEnable, &_extSerial); flux.insert_after(&_analogPinEnable, &_soilMoistureEnable); + + flux.insert_after(&_iotEndpoints, &_analogPinEnable); } //--------------------------------------------------------------------------- // Check our platform status diff --git a/sfeDataLoggerIoT/sfeDataLogger.h b/sfeDataLoggerIoT/sfeDataLogger.h index 92fb2ef..6c5ad5d 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.h +++ b/sfeDataLoggerIoT/sfeDataLogger.h @@ -443,6 +443,9 @@ class sfeDataLogger : public flxApplication // - The pin names for the analog pins. flxOptEnableDevice _analogPinEnable = { "Analog Pin Sensor", "Read analog values from a pin", {{"A0", 36}, {"A3", 39}, {"A7", 35}}}; + + // Container for IoT endpoint drivers + flxActionContainer _iotEndpoints; // IoT endpoints // An generic MQTT client flxMQTTESP32 _mqttClient; diff --git a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp index 9f33f15..78c7604 100644 --- a/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp +++ b/sfeDataLoggerIoT/sfeDataLoggerSetup.cpp @@ -65,18 +65,23 @@ bool sfeDataLogger::setupSDCard(void) bool sfeDataLogger::setupIoTClients() { + _iotEndpoints.setTitle("Services"); + _iotEndpoints.setName("IoT Services", "IoT Service Connection Drivers"); // Add title for this section _mqttClient.setTitle("IoT Services"); // setup the network connection for the mqtt _mqttClient.setNetwork(&_wifiConnection); // add mqtt to JSON _fmtJSON.add(_mqttClient); + _iotEndpoints.push_back(_mqttClient); // setup the network connection for the mqtt _mqttSecureClient.setNetwork(&_wifiConnection); // add mqtt to JSON _fmtJSON.add(_mqttSecureClient); + _iotEndpoints.push_back(_mqttSecureClient); + // AWS _iotAWS.setName("AWS IoT", "Connect to an AWS Iot Thing"); _iotAWS.setNetwork(&_wifiConnection); @@ -85,6 +90,8 @@ bool sfeDataLogger::setupIoTClients() _iotAWS.setFileSystem(&_theSDCard); _fmtJSON.add(_iotAWS); + _iotEndpoints.push_back(_iotAWS); + // Thingspeak driver _iotThingSpeak.setNetwork(&_wifiConnection); @@ -92,6 +99,9 @@ bool sfeDataLogger::setupIoTClients() _iotThingSpeak.setFileSystem(&_theSDCard); _fmtJSON.add(_iotThingSpeak); + // Add the ThingSpeak driver to the flux system + _iotEndpoints.push_back(_iotThingSpeak); + // Azure IoT _iotAzure.setNetwork(&_wifiConnection); @@ -99,20 +109,30 @@ bool sfeDataLogger::setupIoTClients() _iotAzure.setFileSystem(&_theSDCard); _fmtJSON.add(_iotAzure); + // Add the Azure IoT driver to the flux system + _iotEndpoints.push_back(_iotAzure); + // general HTTP / URL logger _iotHTTP.setNetwork(&_wifiConnection); _iotHTTP.setFileSystem(&_theSDCard); _fmtJSON.add(_iotHTTP); + // Add the HTTP driver to the flux system + _iotEndpoints.push_back(_iotHTTP); // Machine Chat _iotMachineChat.setNetwork(&_wifiConnection); _iotMachineChat.setFileSystem(&_theSDCard); _fmtJSON.add(_iotMachineChat); + // Add the Machine Chat driver to the flux system + _iotEndpoints.push_back(_iotMachineChat); + // Arduino IoT _iotArduinoIoT.setNetwork(&_wifiConnection); _fmtJSON.add(_iotArduinoIoT); + // Add the Arduino IoT driver to the flux system + _iotEndpoints.push_back(_iotArduinoIoT); // Web server _iotWebServer.setTitle("Preview"); _iotWebServer.setNetwork(&_wifiConnection); From 85c00bc4908f64a615f7e73c90ff32c18207d71b Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 10:28:50 -0600 Subject: [PATCH 32/46] added logic to splice in bmv080 libraries --- .github/workflows/build-datalogger-iot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index d82e09d..83991c7 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -67,6 +67,18 @@ jobs: - name: Install datalogger libraries run: arduino-cli lib install FastLED "ESP Async WebServer" + - name: Checkout BMV080 libraries repo + uses: actions/checkout@v4 + with: + token: ${{ secrets.BMV080_LIBS_REPO_KEY }} + repository: sparkfun/sfe-datalogger-bmv080-libs + + ## copy in the BMV080 libraries + - name: Copy BMV080 libraries + run: | + cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/sfTk + cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/esp32 + # Compile time - build the Firmware for the data logger. # Note: # - The use of a full path to flux - this is needed or the build fails (relative paths get merged). From a0a27875947b67eddc31bfba924476efa6904576 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 10:29:52 -0600 Subject: [PATCH 33/46] upgrade checkout version --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 83991c7..a09c5df 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout Repo and submodules - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main From 517b125e5b570448732367d98c1670bc470cced7 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 10:31:16 -0600 Subject: [PATCH 34/46] upgrade upload version --- .github/workflows/build-datalogger-iot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index a09c5df..2ac8882 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -98,7 +98,7 @@ jobs: # mv sfeDataLoggerIoT.ino.bin SparkFun_DataLoggerIoT.bin # Upload the build files - bootloader, paritions, firmware - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: sfeDataLoggerIoT-build path: sfeDataLoggerIoT/build/esp32.esp32.esp32/sfeDataLoggerIoT.ino*.bin @@ -119,7 +119,7 @@ jobs: cd fuse_id python setup.py sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: Flash ID CLI Tool path: fuse_id/dist From 9d623cfc88c77306032a24d4feeeadb306181bf1 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 10:38:19 -0600 Subject: [PATCH 35/46] add path to checkout --- .github/workflows/build-datalogger-iot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 2ac8882..2bedc9d 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -72,6 +72,7 @@ jobs: with: token: ${{ secrets.BMV080_LIBS_REPO_KEY }} repository: sparkfun/sfe-datalogger-bmv080-libs + path: sfe-datalogger-bmv080-libs ## copy in the BMV080 libraries - name: Copy BMV080 libraries From 940bb7973124cc84dd4c45f1cffba3551a277295 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 10:46:05 -0600 Subject: [PATCH 36/46] debugging --- .github/workflows/build-datalogger-iot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 2bedc9d..0203ead 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -77,6 +77,7 @@ jobs: ## copy in the BMV080 libraries - name: Copy BMV080 libraries run: | + ls -la cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/sfTk cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/esp32 From bd58c9c8ed5fec0b6a61e45bbfb2f62d493fa496 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 11:23:03 -0600 Subject: [PATCH 37/46] finding a way to splice in a library --- .github/workflows/build-datalogger-iot.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 0203ead..a75d53b 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -67,6 +67,12 @@ jobs: - name: Install datalogger libraries run: arduino-cli lib install FastLED "ESP Async WebServer" + - name: Checkout BMV080 Arduino library repo + uses: actions/checkout@v4 + with: + repository: sparkfun/SparkFun_BMV080_Arduino_Library + path: SparkFun_BMV080_Arduino_Library + - name: Checkout BMV080 libraries repo uses: actions/checkout@v4 with: @@ -78,8 +84,8 @@ jobs: - name: Copy BMV080 libraries run: | ls -la - cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/sfTk - cp sfe-datalogger-bmv080-libs/esp32/* Arduino/libraries/SparkFun_BMV080_Arduino_Library/src/esp32 + cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/sfTk + cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/esp32 # Compile time - build the Firmware for the data logger. # Note: From 7b3fbd2752132a653092621a7fa8ce38c0001889 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 12:18:20 -0600 Subject: [PATCH 38/46] fix branch for checkout - dont use hardcoded main --- .github/workflows/build-datalogger-iot.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index a75d53b..12eef57 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -19,8 +19,6 @@ jobs: steps: - name: Checkout Repo and submodules uses: actions/checkout@v4 - with: - ref: main # setup the ssh key used to pull in the Flux SDK source. This was the # only way found to make this work when using private models (ssh private key here, public on Flux deploy keys @@ -33,7 +31,7 @@ jobs: # checkout flux-sdk - name: Checkout the flux-sdk run: | - git clone --branch main git@github.com:sparkfun/flux-sdk.git + git clone --branch feature/version-1.2.0 git@github.com:sparkfun/flux-sdk.git echo "FLUX_SDK_PATH=`pwd`/flux-sdk" >> $GITHUB_ENV # Run cmake - this will build a custom SparkFun_Flux library we can use with @@ -65,7 +63,7 @@ jobs: run: ./flux-sdk/install-libs.sh - name: Install datalogger libraries - run: arduino-cli lib install FastLED "ESP Async WebServer" + run: arduino-cli lib install FastLED "ESP Async WebServer" "Async TCP" - name: Checkout BMV080 Arduino library repo uses: actions/checkout@v4 @@ -83,7 +81,6 @@ jobs: ## copy in the BMV080 libraries - name: Copy BMV080 libraries run: | - ls -la cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/sfTk cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/esp32 @@ -98,7 +95,7 @@ jobs: --build-property upload.maximum_size=3145728 --build-property build.flash_size=16MB --build-property build.partitions=partitions --build-property build.flash_mode=dio --build-property build.flash_freq=80m --build-property "compiler.cpp.extra_flags=\"-DDATALOGGER_IOT_APP_KEY=$DATALOGGER_IOT_APP_KEY\" \"-DDATALOGGER_IOT_ID_KEY=$DATALOGGER_IOT_ID_KEY\" \"-DBUILD_NUMBER=$GITHUB_RUN_NUMBER\"" - --export-binaries --clean --library `pwd`/SparkFun_Flux + --export-binaries --clean --library `pwd`/SparkFun_Flux --library `pwd`/SparkFun_BMV080_Arduino_Library # - name: Rename Library # run: | From 9e5ed45bbf2b3264ac327ee8ec25c380011f02b0 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 12:30:43 -0600 Subject: [PATCH 39/46] fix library dirctory name issue --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 12eef57..619a29b 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -95,7 +95,7 @@ jobs: --build-property upload.maximum_size=3145728 --build-property build.flash_size=16MB --build-property build.partitions=partitions --build-property build.flash_mode=dio --build-property build.flash_freq=80m --build-property "compiler.cpp.extra_flags=\"-DDATALOGGER_IOT_APP_KEY=$DATALOGGER_IOT_APP_KEY\" \"-DDATALOGGER_IOT_ID_KEY=$DATALOGGER_IOT_ID_KEY\" \"-DBUILD_NUMBER=$GITHUB_RUN_NUMBER\"" - --export-binaries --clean --library `pwd`/SparkFun_Flux --library `pwd`/SparkFun_BMV080_Arduino_Library + --export-binaries --clean --library `pwd`/SparkFun_DataLoggerIoT --library `pwd`/SparkFun_BMV080_Arduino_Library # - name: Rename Library # run: | From 46e90f5786ba79117060308f14100e646b5bb505 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 13:06:01 -0600 Subject: [PATCH 40/46] debug --- .github/workflows/build-datalogger-iot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 619a29b..25ddca0 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -83,6 +83,7 @@ jobs: run: | cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/sfTk cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/esp32 + ls -la SparkFun_BMV080_Arduino_Library/src/./* # Compile time - build the Firmware for the data logger. # Note: From 4618b26a1f391019ab7b32c577fde28488b634a7 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 13:11:25 -0600 Subject: [PATCH 41/46] fix include issue --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 25ddca0..b97ab26 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -81,7 +81,7 @@ jobs: ## copy in the BMV080 libraries - name: Copy BMV080 libraries run: | - cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/sfTk + cp sfe-datalogger-bmv080-libs/inc/* ./SparkFun_BMV080_Arduino_Library/src/sfTk cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/esp32 ls -la SparkFun_BMV080_Arduino_Library/src/./* From ecdd414f1437341ec58cca39289b03e4691ec4a2 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 13:20:49 -0600 Subject: [PATCH 42/46] debug: getting link errors - bumping up cli install script version --- .github/workflows/build-datalogger-iot.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index b97ab26..7e7a44b 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -46,7 +46,7 @@ jobs: # Setup Arduino command line - install esp32 and all the libs flux needs - name: Arduino - Install and setup the Arduino CLI - uses: arduino/setup-arduino-cli@v1 + uses: arduino/setup-arduino-cli@v2 - name: Arduino - Start config file run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" @@ -83,7 +83,6 @@ jobs: run: | cp sfe-datalogger-bmv080-libs/inc/* ./SparkFun_BMV080_Arduino_Library/src/sfTk cp sfe-datalogger-bmv080-libs/esp32/* ./SparkFun_BMV080_Arduino_Library/src/esp32 - ls -la SparkFun_BMV080_Arduino_Library/src/./* # Compile time - build the Firmware for the data logger. # Note: From cb4c962c0fa526b16a067d310c97963f7df85e18 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 13:29:14 -0600 Subject: [PATCH 43/46] update max upload sizez --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 7e7a44b..214a123 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -92,7 +92,7 @@ jobs: - name: Compile DataLogger firmware binary run: arduino-cli compile --fqbn esp32:esp32:esp32 ./sfeDataLoggerIoT/sfeDataLoggerIoT.ino - --build-property upload.maximum_size=3145728 --build-property build.flash_size=16MB --build-property build.partitions=partitions + --build-property upload.maximum_size=4980736 --build-property build.flash_size=16MB --build-property build.partitions=partitions --build-property build.flash_mode=dio --build-property build.flash_freq=80m --build-property "compiler.cpp.extra_flags=\"-DDATALOGGER_IOT_APP_KEY=$DATALOGGER_IOT_APP_KEY\" \"-DDATALOGGER_IOT_ID_KEY=$DATALOGGER_IOT_ID_KEY\" \"-DBUILD_NUMBER=$GITHUB_RUN_NUMBER\"" --export-binaries --clean --library `pwd`/SparkFun_DataLoggerIoT --library `pwd`/SparkFun_BMV080_Arduino_Library From df95d0fb51ce1e6ee5d2cf2cd962f69f1e80dc5c Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 15 Aug 2025 13:42:02 -0600 Subject: [PATCH 44/46] debugging - esp core versions? --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 214a123..7b451f7 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -56,7 +56,7 @@ jobs: # Install ESP32 - v3.0.7 - working as of June 2025 (latest versions fail for various reasons) - name: Arduino - Install ESP32 platform - run: arduino-cli core install esp32:esp32@3.0.7 + run: arduino-cli core install esp32:esp32 # install the libraries Flux uses - name: Install Flux dependant libraries. From 62c0eceeec3ebe7abf770d1e35443e4da588fb17 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Sat, 16 Aug 2025 12:30:17 -0600 Subject: [PATCH 45/46] set esp32 core version --- .github/workflows/build-datalogger-iot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-datalogger-iot.yml b/.github/workflows/build-datalogger-iot.yml index 7b451f7..9114e46 100644 --- a/.github/workflows/build-datalogger-iot.yml +++ b/.github/workflows/build-datalogger-iot.yml @@ -56,7 +56,7 @@ jobs: # Install ESP32 - v3.0.7 - working as of June 2025 (latest versions fail for various reasons) - name: Arduino - Install ESP32 platform - run: arduino-cli core install esp32:esp32 + run: arduino-cli core install esp32:esp32@3.1.3 # install the libraries Flux uses - name: Install Flux dependant libraries. From 09edf2073785aa1645849bb1bc2ee0a3466de8a4 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Mon, 18 Aug 2025 11:25:50 -0600 Subject: [PATCH 46/46] added trigger for log event once startup is done --- sfeDataLoggerIoT/sfeDataLogger.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sfeDataLoggerIoT/sfeDataLogger.cpp b/sfeDataLoggerIoT/sfeDataLogger.cpp index 92593a7..2073666 100644 --- a/sfeDataLoggerIoT/sfeDataLogger.cpp +++ b/sfeDataLoggerIoT/sfeDataLogger.cpp @@ -831,6 +831,8 @@ bool sfeDataLogger::onStart() if (startupOutputMode() != kAppStartupMsgNormal) flxLog.setLogLevel(flxLogInfo); + // log now! + _timer.trigger(); return true; }