Skip to content

Releases: Abasz/ESPRowingMonitor

Small updates and bug fixes

31 Jan 08:31
Compare
Choose a tag to compare

This minor release fixes a few bugs and updates some packages to their latest as well as includes the refactoring necessary to meet some API changes of the packages updates.

6.0.0

20 Dec 20:16
Compare
Choose a tag to compare

Version 6.0.0

This major release introduces new BLE functionality, adds experimental support for the FTMS Bluetooth profile, improves modularity through significant refactoring of the bluetooth core, and resolves several bugs. It also updates the Arduino framework to version 3.x and introduces compatibility with modern C++ standards for enhanced performance and maintainability.

Please note that this release completely removes any WebSocket or WebServer related feature from the codebase.

New Features

Experimental FTMS BLE Service

  • FTMS Compatibility: Introduced the FTMS bluetooth profile to enable compatibility with various rowing apps (currently experimental).

Over-the-Air Firmware Updates

  • BLE-Based OTA Updates: Users can now update firmware directly over Bluetooth, eliminating the need for physical connections.

Improved Stroke Detection

  • Enhanced the stroke detection algorithm by switching to the Theil-Sen Linear Regression model for increased resilience to outliers.
  • While this introduces a 5-10% execution time overhead, it provides significant accuracy improvements for stroke detection that is actually compensated by other improvements.

Updates and Improvements

  • Improved Execution Time and Support for Higher IMPULSE_DATA_ARRAY_LENGTH:

    • As part of the version 6 update, significant work has been done to improve the execution time of the main loop and better support higher values of IMPULSE_DATA_ARRAY_LENGTH.
    • Through various algorithmic optimizations, coupled with moving to Arduino Core 3., ESP-IDF 5., and a modern compiler/toolchain, there has been an approximate 6-10% improvement in execution time across all IMPULSE_DATA_ARRAY_LENGTH compared to version 5.
    • For example using double type: 3.3ms for a 15 data point set (v5: 3.4ms).
    • The most significant gains are seen in maximum execution times due to proper offloading of peripheral calculations to the second core of the ESP32.
  • Updated Framework: Upgraded to Arduino Core v3 and ESP-IDF v5.1, utilizing modern features such as the std::span and the xtensa toolchain v12.

  • Improved BLE Data Flow: Refactored BLE state management and data flow into separate structures for enhanced clarity and performance.

  • Generic Ergometer Profile Updates: Fine-tuned moment of inertia values and drag coefficients for improved calibration and detection accuracy.

Bug Fixes

  • Compile Date String: Fixed formatting issues for single-digit days in the compile date.
  • Failsafe Mechanisms: Added safeguards for torque-based stroke detection to handle edge cases with drive phases.

Code Refactoring and Maintenance

  • Restructured Codebase:

    • Grouped related files (e.g., SdCardService, utility classes) into dedicated folders for cleaner organization.
    • Restructured the test folder for better clarity between unit and end-to-end tests.
  • Enhanced Dependency Injection for BLE Services: Refactored the architecture of core BLE services (e.g., OtaBleService, BatteryBleService, SettingsBleService) to utilize dependency injection. This improves modularity and simplifies testing.

  • Optimized MTU Calculation: Centralized MTU logic for more efficient characteristic management.

  • BLE Controller Enhancements: Elevated BluetoothService to a controller managing sub-services, improving extensibility.

  • Constexpr Improvements: Adopted constexpr for constructors in various Series classes for better adherence to modern C++ practices.

  • Move to CMake and improve testing workflow: Improve both unit testing and calibration workflows by using CMake to generate a build system instead of using a traditional makefile.

Full Changelog: 5.2.0...6.0.0

Add new Extended BLE Metrics and deprecate WebSocket API

10 Jul 12:47
Compare
Choose a tag to compare

Version 5.2.0

This release focuses on expanding hardware support, enhancing BLE functionality, refining rower profiles, and improving code quality. Additionally, various bug fixes and optimizations are included to enhance overall performance and stability.

Note: This release deprecates the WebSocket API as well as serving up the WebGUI locally from the MCU in favor of the extended BLE metrics API and a progressive web app. However, the option to compile with the WebSocket API will be kept until that feature is stable.

New Features

Addition of New BLE Services

Creates proper services for extended metrics as well as settings and groups the related characteristics within the appropriate service. These enhancements enable the deprecation of the WebSocket server as all data can be accessed via Bluetooth.

  • Extended BLE Metrics API: Created a custom BLE profile to expose metrics via BLE that were originally available via WebSocket.
  • BLE Handle Forces: Exposes stroke handle force data via BLE.
  • Delta Time Logging via BLE: Added functionality to allow sending delta time data via Bluetooth for logging, debugging, and row data analysis purposes.
  • Settings BLE Service: Added functionality to allow sending settings data via Bluetooth, making potential future expansion of changeable settings more flexible. This includes enabling/disabling SD Card logging, improving flexibility and ease of use.

Support for Newer ESP32 Chips

  • ESP32-S3 Support: Added support for CDC-enabled ESP32 chips such as the S3.

Updates and Improvements

  • RGB LED Configuration: Introduced a setting option for EOrder to support different types of RGB LEDs with varying color orders (e.g., GBR).
  • Refine Current Rower Profiles: Updated inertia values for Generic Air rower and KayakFirst Blue rower profiles based on testing, which showed previously set values were too low. Necessary recalibration was performed.
  • Flash Usage Reduction: Reduced flash usage by disabling unused NimBle library functions.

Bug Fixes

  • SD Card Logging Bugs: Fixed issues where SD Card logging could not be reenabled after being disabled and where logging did not switch off when other delta time logging was active.
  • Weighted Average Calculation: Corrected a bug in the weighted average calculation that incorrectly summed values.
  • Float Precision Bug: Fixed a fatal float precision issue in ISR calculations causing crashes due to the lack of FPU in ESP32 interrupts. Updated configuration variables and tests accordingly.

Code Refactoring and Maintenance

  • Const Correctness: Improved const correctness by using constant iterators where possible.
  • Clean Up Includes: Cleaned up using and include statements to streamline code.
  • OpCode Enum Variable: Renamed OpCode enum variable for clarity.
  • Peripheral Service Refactoring: Refactored the Bluetooth service class functions into separate files for better maintainability and updated service setup.
  • Refactored Configurations Class: Removed the class name from static access within the Configurations class and added more defaults (e.g., default DEFAULT_BLE_SERVICE in line with the deprecation of the WebSocket API).

Full Changelog: 5.2.0...5.2.0

5.0.0

25 Feb 09:50
Compare
Choose a tag to compare

Version 5.0.0

This release introduce significant improvements to both functionality and performance. The update focuses on enhancing user experience, optimizing resource utilization, and introducing new features to elevate the overall capabilities of the system.

ESP Rowing Monitor now able to handle multiple boards and ergometers better via profiles as well as improved memory management (to avoid crashes) and regression algorithm (special thanks to the ORM project).

However this release includes breaking changes to the stroke detection algorithm (specificalyl the torque based) that may require re-calibration or slight adjustment of the used rowing profile if torque based stroke detection is used as well as to the WebSocket API.

Performance Optimizations

Improve algorithm

Achieved notable performance enhancements, reducing execution time for processing every new data point (saved approximately 21% for IMPULSE_DATA_ARRAY_LENGTH of 18) by the following changes:

  • Enhanced the accuracy of the Theil-Sen Quadratic regression algorithm by removing the median calculation (and use full set of data) for the TS Quadratic Regression calculation.
  • Implemented weighted average for angular velocity and acceleration calculation, enhancing torque-based stroke detection and smoothing force curves.
  • Appropriately reserved memory for all vectors.
  • Utilized swap (O(1)) instead of clear (O(N)) when resetting series.
  • Employed partial_sort_copy in the Series class to reduce the amount of copy.
  • Utilized a combination of nth_element and max_element to calculate the median.

Notes:

  • While swap was beneficial for resetting the driveHandleForces, it was found to result in regression compared to using clear for some scenarios, hence the decision to retain the existing approach in certain cases was made.
  • Benchmarking indicated that nth_element + max_element was less performant for the Series class, suggesting that the overhead of copying outweighs the benefits of O(n) complexity for small arrays.

Take proper advantage of dual core CPUs

  • Implemented RTOS xTask to offload data string creation (for SD and WebSocket) and broadcast to WebSocket clients to core 0.
  • Offload the writing to SD Card to core 0.

Memory Management Improvements

  • Optimized memory usage in the Series class for better performance during long recovery periods to save free heap (as well as free heap quicker).

Other improvements

  • Use binary data for WebSocket data transfer for metrics.
  • Enhanced performance by separating settings and rowing data in data broadcasts and do not send settings object on every broadcast (reducing broadcast size).
  • Simplify WebSocket metrics data API to reduce the amount bytes to be transferred.
  • Introduced BleSignalStrength setting for adjusting BLE TX_power to balance power consumption and dBm strength.

New Features

Reworked Structure of Settings

Completely restructured the settings framework to facilitate more flexible handling of different boards and rowing machines.

  • Split settings between board and machine-specific files, allowing for easier inclusion and combination, providing enhanced flexibility and extensibility.
  • Resolved bugs related to settings usage, improving overall code efficiency.
  • Added a profile for Blue KayakFirst ergo.
  • Added a profile for Orange KayakFirst ergo.
  • Added a profile for Generic ergo.
  • Added a profile for Generic ESP board.
  • Added a profile for FireBeetle board.

Delta Time Logging Feature

Added the option to log delta times to the SD card (settable via WebSocket) and/or through the WebSocket (settable via WebSocket) to eliminate the need for Serial connection during calibration logging.

Simulation from File

Enabled simulation of rowing sessions from files uploaded to the MCU file system, offering longer session simulations and better benchmarking of memory usage.

Improve and simplify calibration run logging

Added a calibration logging setting to enable/disable extra calibration data on specific runs to output standard data that can be parsed.

General Updates and Fixes

Improve linting and refactoring

  • Fixed minor linting errors and updated linting rules.
  • Removed dead code and added missing consts.
  • Added sanity check to baud rate setting.
  • Utilized analogReadMilliVolts native function for battery measurements.
  • Reversed the if statement logic to follow code convention of using guard clauses.

Bug Fixes

  • Corrected time stamp usage for power management, addressing issues related to idle state detection.
  • Ensured consistency in the return type of the OLSLinearSeries size by using size_t.
  • Resolved a bug causing a crash when BLE service is disabled, ensuring proper initialization.
  • Removed a naive WiFi reconnect implementation, utilizing the built-in reconnect feature for better reliability.

Miscellaneous

  • Altered log levels for frequent messages to save on execution time.

Full Changelog: 4.2.0...5.0.0

Bug fixes and fine tuning

02 Sep 14:13
Compare
Choose a tag to compare

This is a minor release that contains some small fixes as well as cosmetic patches and fine tuning:

  • Enables WiFi reconnect on connection loss that bypasses the need to restart the device
  • Makes #4 issue clearer as well as squashes a bug regarding WebSocket OpCode processing
  • Improves the torque based stroke detection on machines that produces fewer number impulses during recovery (e.g. on Kayak ergos)
  • Other cosmetic improvements (e.g. settable hostname, update BLE services data, option to disable WebGUI, etc.)

Add static serving of Web GUI and other improvements - Version 1.1.0 (4.1.0)

14 May 08:07
Compare
Choose a tag to compare

This release adds certain improvements in terms of performance and control over the application as well as implements the static serving of the Web GUI.

Improvements

  • Add floating point precision settings options (to reduce main loop execution time)
  • Add settings to disable webserver and BLE service
  • Various performance improvements (including the time required for the data processing loop)
  • Fix bug on missing input pin setup (causing input pin to be floating and not detecting impulses properly)

Additions

  • Make stroke detection algorithm (slope, torque, both) selectable
  • Add static web serving capabilities of the Web GUI

New stroke detection algorithm and WebSocket connection

08 Apr 14:13
Compare
Choose a tag to compare

ESP Rowing Monitor Release Notes - Version 1.0.0 (4.0.0)

This is a major redesign of the original ble-csc-sensor project. This project now aims to provide a fully capable rowing monitor (hence the name change).

The ESP Rowing Monitor project is aimed at providing capabilities similar to Open Rowing Monitor (ORM) but built for the ESP32 microcontroller instead of the Rpi. The latest release, version 1.0.0, includes significant improvements in development tooling, underlying stroke detection algorithm, range of available peripherals and metrics, adds better documentation, as well as adds further improvements in other areas. The changes in this release can be categorized as follows:

Improvements on the rowing monitor algorithm

  • Metric calculation and change detection algorithm
    • Decouple the metric calculations and stroke detection algorithm from the Interrupt Service Routine to allow more complicated algorithms to be used (algorithms with longer execution times)
    • Changed the underlying stroke detection algorithm to use the Theil Sen Quadratic Regression model, similar to ORM, for determining torque which should increase metrics accuracy and robustness of stroke detection
    • Added a secondary fallback algorithm that fits a linear regression curve to the calculated slopes of the recovery regression lines for every "flank", which looks for the slope of slopes on every impulse.
  • Add new WebSocket based peripheral to be able to connect a WebGUI
    • Added network service with WebSocket handling and integrated it into the controller
    • Add operational commands via WebSocket for easier controlling the rowing monitor (change BLE Profile, change logging level)
    • Rework the peripheral code hierarchy to reflect new functionality and ensure better maintainability

Improvements in Development Tooling

  • Create makefile to make local testing and simulation easier
  • Create unit tests and end-to-end (e2e) tests
    • Add Catch2 as unit test framework and add tests
    • Make e2e test to be able handle external file as well as use compiled data array with delta time data for improved testing and simulation
  • Integrate clang-tidy to enable static code analysis and code linting
  • Move the code base to C++20

Documentation and Other Improvements

  • Create proper readme and add more extensive documentation of settings and installation
  • Restructure folders to reflect new functionality and ensure better maintainability
  • Add battery pin settings for improved functionality
  • Moved microsecond conversion of time-related settings to the settings file for easier and more consistent configuration

These are the major changes in the ESP Rowing Monitor project for version 1.0.0. For detailed information, please refer to the individual commit messages in the repository.