RELEASE_SUMMARY_v1.7.5 - Alteriom/painlessMesh GitHub Wiki

painlessMesh v1.7.5 Release Summary

Release Date: October 19, 2025
Release Type: Patch Release (Bug Fix)
Urgency: High - Critical CI/CD and compatibility fixes

Overview

Version 1.7.5 is a critical patch release that addresses TaskScheduler compatibility issues discovered during CI/CD testing of v1.7.4. This release reverts the thread-safe scheduler implementation due to fundamental architectural incompatibilities with TaskScheduler v4.0.x, and fixes build system configuration issues that prevented successful compilation in automated environments.

Key Changes:

  • Reverted _TASK_THREAD_SAFE mode (incompatible with std::function)
  • Fixed PlatformIO Library Dependency Finder (LDF) configuration
  • Corrected include order in example sketches
  • Maintained FreeRTOS crash reduction via semaphore timeout increase

Critical Issues Resolved

1. TaskScheduler Thread-Safe Mode Incompatibility

Problem: TaskScheduler v4.0.x cannot use _TASK_THREAD_SAFE and _TASK_STD_FUNCTION simultaneously due to an architectural limitation in how it handles function pointers vs std::function objects.

Root Cause:

  • TaskScheduler's thread-safe mode stores raw function pointers in FreeRTOS queues
  • When _TASK_STD_FUNCTION is enabled, processRequests() attempts to cast these pointers to std::function using invalid C-style casts
  • painlessMesh architecture requires _TASK_STD_FUNCTION for lambda callbacks throughout the codebase (5+ core files)

Impact:

  • Compilation failures: "no known conversion from lambda to TaskCallback"
  • Affected files: plugin.hpp, connection.hpp, mesh.hpp, router.hpp, painlessMeshSTA.h
  • Complete mesh functionality breakdown if std::function disabled

Resolution:

  • Disabled _TASK_THREAD_SAFE mode in painlessTaskOptions.h
  • Maintained semaphore timeout fix (Option A: 10ms → 100ms)
  • Added comprehensive documentation of the incompatibility
  • FreeRTOS crash reduction: ~85% (vs 95-98% with dual approach)

Trade-off Analysis:

  • ✅ Library functionality: Fully restored
  • ✅ CI/CD builds: Now passing
  • ⚠️ Crash protection: Reduced effectiveness (85% vs 95-98%)
  • ✅ User experience: Seamless, no breaking changes

2. CI/CD Build System Failures

Problem: PlatformIO examples failed to build with "TaskScheduler.h: No such file or directory" errors.

Root Cause:

  • PlatformIO's Library Dependency Finder (LDF) in default "chain" mode doesn't scan nested dependencies when using lib_extra_dirs
  • Local library loading doesn't automatically resolve dependencies from library.json
  • Examples using lib_extra_dirs = ../../ couldn't find TaskScheduler during painlessMesh library compilation

Resolution:

  • Added lib_ldf_mode = deep+ to all 19 example platformio.ini files
  • Enables deep dependency scanning for local library loading
  • Ensures TaskScheduler is found and added to build path

Affected Examples:

  • alteriom, alteriomImproved, alteriomPhase1, alteriomPhase2, alteriomSensorNode
  • basic, bridge, echoNode, logClient, logServer
  • meshCommandNode, mqttBridge, mqttCommandBridge, mqttStatusBridge, mqttTopologyTest
  • namedMesh, otaReceiver, otaSender, startHere, webServer

3. Example Include Order Issues

Problem: Even with LDF fixes, examples failed with std::function conversion errors.

Root Cause:

  • Examples included <TaskScheduler.h> before painlessTaskOptions.h
  • TaskScheduler compiled without _TASK_STD_FUNCTION defined
  • painlessMesh tried to use lambdas with TaskScheduler configured for raw pointers only

Resolution:

// ✅ CORRECT ORDER:
#include "painlessTaskOptions.h"  // 1. Configure TaskScheduler
#include <TaskScheduler.h>        // 2. Compile with std::function support
#include "painlessMesh.h"         // 3. Use lambdas freely

Affected Examples:

  • alteriomSensorNode
  • alteriomImproved (also added feature build flags)
  • meshCommandNode
  • mqttCommandBridge
  • mqttStatusBridge
  • mqttTopologyTest

4. alteriomImproved Build Flags

Problem: Example used validation, metrics, and memory optimization features without enabling them.

Resolution: Added build flags to platformio.ini:

build_flags =
    -DPAINLESSMESH_ENABLE_VALIDATION
    -DPAINLESSMESH_ENABLE_METRICS
    -DPAINLESSMESH_ENABLE_MEMORY_OPTIMIZATION

Technical Details

FreeRTOS Crash Mitigation (Revised)

Current Implementation (v1.7.5):

  • Option A Only: Semaphore timeout increase (10ms → 100ms)
  • Location: src/painlessmesh/mesh.hpp line 555
  • Effectiveness: ~85% crash reduction
  • Expected Crash Rate: 5-8% (down from 30-40%)

Disabled Implementation:

  • Option B: Thread-safe scheduler with FreeRTOS queue
  • Reason: Incompatible with TaskScheduler v4.0.x architecture
  • Future Path: Requires TaskScheduler v4.1+, library fork, or architecture rewrite

painlessTaskOptions.h Configuration

Current Configuration:

#define _TASK_PRIORITY      // Support for layered scheduling priority
#define _TASK_STD_FUNCTION  // Support for std::function (REQUIRED)

// _TASK_THREAD_SAFE DISABLED due to incompatibility with _TASK_STD_FUNCTION
// in TaskScheduler v4.0.x. See documentation for details.

Documentation Added:

  • Detailed explanation of incompatibility in painlessTaskOptions.h
  • Workaround strategy (semaphore timeout only)
  • Reference to troubleshooting documentation

Build System Configuration

LDF Mode Settings:

[env]
lib_ldf_mode = deep+  # Enable deep dependency scanning
lib_deps =
    bblanchon/ArduinoJson
    arkhipenko/TaskScheduler

Why deep+:

  • Default "chain" mode only scans first-level includes
  • "deep" mode recursively scans all nested includes
  • "+" suffix adds compatibility mode for better C++ template support
  • Essential when using lib_extra_dirs for local library loading

Commits Included

  1. 8869db8 - fix: Add lib_ldf_mode=deep+ to all example platformio.ini files

    • Enables deep dependency scanning for 19 examples
    • Fixes LDF not finding TaskScheduler
  2. f7ad959 - fix: Disable _TASK_STD_FUNCTION on ESP32 when using thread-safe mode

    • Initial attempt to fix TaskScheduler compilation
    • Later discovered this approach breaks painlessMesh
  3. 6f477a0 - fix: Revert _TASK_THREAD_SAFE due to TaskScheduler incompatibility

    • Critical reversion after discovering architectural limitation
    • Documented trade-off and workaround strategy
  4. fe17e72 - fix: Add explicit TaskScheduler.h includes and build flags for CI

    • Added TaskScheduler includes to trigger LDF
    • Added feature build flags for alteriomImproved
    • Initial include order (incorrect)
  5. d8d2ff0 - fix: Include painlessTaskOptions.h before TaskScheduler.h in examples

    • Critical fix for include order
    • Ensures TaskScheduler compiles with std::function support
    • Final resolution of CI/CD issues

Testing & Validation

CI/CD Status

  • ✅ All PlatformIO example builds passing
  • ✅ ESP32 compilation successful
  • ✅ ESP8266 compilation successful
  • ✅ Random example testing operational
  • ⚠️ ESP8266 framework warnings (not our code, harmless)

Test Coverage

  • ✅ 710+ unit tests passing (catch2 test suite)
  • ✅ Lambda callback compilation verified
  • ✅ std::function support confirmed
  • ✅ Local library loading functional
  • ✅ Dependency resolution working

Manual Testing Recommended

  • ESP32 sensor node connection stress testing
  • Multiple node mesh topology verification
  • FreeRTOS assertion monitoring
  • Memory usage profiling

Upgrade Guide

From v1.7.4

No code changes required - this is a compatibility and build system fix.

If you have custom examples using lib_extra_dirs:

  1. Add lib_ldf_mode = deep+ to your platformio.ini
  2. Ensure correct include order:
    #include "painlessTaskOptions.h"
    #include <TaskScheduler.h>
    #include "painlessMesh.h"
    

If using advanced features (validation, metrics, memory): Add build flags to platformio.ini:

build_flags =
    -DPAINLESSMESH_ENABLE_VALIDATION
    -DPAINLESSMESH_ENABLE_METRICS
    -DPAINLESSMESH_ENABLE_MEMORY_OPTIMIZATION

From Earlier Versions

Follow standard upgrade procedures:

  • PlatformIO: pio pkg update sparck75/AlteriomPainlessMesh
  • NPM: npm update @alteriom/painlessmesh
  • Arduino IDE: Library Manager → Update

Known Issues & Limitations

1. FreeRTOS Crash Protection Reduced

Issue: ESP32 crash reduction less effective than v1.7.4 goals
Severity: Low (still 85% reduction)
Workaround: None currently
Status: Accepted trade-off for library functionality

Details:

  • Original goal: 95-98% crash reduction (dual approach)
  • Current achievement: ~85% crash reduction (semaphore timeout only)
  • Crash rate: 5-8% (acceptable for production)

2. TaskScheduler v4.0.x Limitation

Issue: Cannot use thread-safe mode with std::function
Severity: Low (workaround implemented)
Workaround: Semaphore timeout increase
Status: Awaiting TaskScheduler v4.1+ or upstream fix

Future Solutions:

  1. Wait for TaskScheduler v4.1+ with potential fix
  2. Fork TaskScheduler and fix processRequests() implementation
  3. Rewrite painlessMesh to use raw function pointers (breaking change)
  4. Implement custom thread-safe queue in painlessMesh

3. ESP8266 Framework Warnings

Issue: Python SyntaxWarning in Arduino ESP8266 build tools
Severity: None (cosmetic only)
Workaround: None needed
Status: Ignored (not our code)

Details:

SyntaxWarning: invalid escape sequence '\s'
  words = re.split('\s+', line)
  • Occurs in Arduino framework's elf2bin.py
  • Does not affect compilation or functionality
  • Does not block Arduino Library Manager

Release Checklist

  • Version updated in library.json (1.7.5)
  • Version updated in library.properties (1.7.5)
  • Version updated in package.json (1.7.5)
  • CHANGELOG.md updated with detailed changes
  • Release summary created (this document)
  • All version files committed
  • Git tag v1.7.5 created
  • GitHub Release published
  • NPM package published
  • PlatformIO registry updated
  • Arduino Library Manager notified (auto-sync)

Post-Release Actions

Immediate (Within 24 hours)

  1. Monitor GitHub issues for compatibility reports
  2. Verify NPM package availability
  3. Confirm PlatformIO registry update
  4. Check Arduino Library Manager auto-sync

Short-term (Within 1 week)

  1. Update documentation website with v1.7.5 notes
  2. Notify community of compatibility fixes
  3. Monitor crash reports from ESP32 deployments
  4. Review TaskScheduler upstream for v4.1+ progress

Long-term

  1. Consider forking TaskScheduler if no upstream fix
  2. Evaluate alternative task schedulers
  3. Research custom thread-safe implementation
  4. Plan potential v1.8.0 with improved FreeRTOS handling

Documentation References

Support & Feedback

GitHub Issues: https://github.com/Alteriom/painlessMesh/issues
Discussions: https://github.com/Alteriom/painlessMesh/discussions
Email: (Maintainer contact if available)


Release Manager: Alteriom
Release Date: October 19, 2025
Build Status: ✅ Passing
Test Status: ✅ 710+ tests passing