@alteriom/painlessmesh 1.8.2 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +74 -11
  3. package/RELEASE_GUIDE.md +57 -16
  4. package/docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md +331 -0
  5. package/docs/features/DIAGNOSTICS_API.md +534 -0
  6. package/docs/getting-started/arduino-manual-install.md +313 -0
  7. package/docs/implementation/BRIDGE_ARCHITECTURE_IMPLEMENTATION.md +340 -0
  8. package/docs/implementation/BRIDGE_HEALTH_MONITORING_IMPLEMENTATION.md +213 -0
  9. package/docs/implementation/BRIDGE_STATUS_FEATURE.md +635 -0
  10. package/docs/implementation/DIAGNOSTICS_API_IMPLEMENTATION.md +232 -0
  11. package/docs/implementation/IMPLEMENTATION_COMPLETE.md +228 -0
  12. package/docs/implementation/IMPLEMENTATION_NTP_TIME_SYNC.md +325 -0
  13. package/docs/implementation/IMPLEMENTATION_SUMMARY.md +316 -0
  14. package/docs/implementation/MESSAGE_QUEUE_IMPLEMENTATION.md +405 -0
  15. package/docs/implementation/MULTI_BRIDGE_IMPLEMENTATION.md +520 -0
  16. package/docs/implementation/NTP_TIME_SYNC_FEATURE.md +392 -0
  17. package/docs/internal/CUSTOM_AGENT_ANALYSIS.md +391 -0
  18. package/docs/internal/ISSUE_65_VERIFICATION.md +947 -0
  19. package/docs/internal/ISSUE_66_CLOSURE.md +249 -0
  20. package/docs/internal/ISSUE_66_STATUS.md +316 -0
  21. package/docs/internal/PR_SUMMARY.md +315 -0
  22. package/docs/internal/REVIEW_SUMMARY.md +332 -0
  23. package/docs/releases/PUBLISH_v1.8.0_INSTRUCTIONS.md +163 -0
  24. package/docs/releases/QUICK_START_RELEASES.md +113 -0
  25. package/docs/releases/RELEASE_CHECKLIST_v1.8.0.md +331 -0
  26. package/docs/releases/RELEASE_CHECKLIST_v1.8.2.md +309 -0
  27. package/docs/releases/RELEASE_NOTES_v1.8.0.md +685 -0
  28. package/docs/releases/RELEASE_NOTES_v1.8.1.md +221 -0
  29. package/docs/releases/RELEASE_NOTES_v1.8.2.md +421 -0
  30. package/docs/releases/RELEASE_NOTES_v1.8.3.md +292 -0
  31. package/docs/releases/RELEASE_NOTES_v1.8.4.md +277 -0
  32. package/docs/troubleshooting/ARDUINO_IDE_VERSION_FIX_SUMMARY.md +229 -0
  33. package/docs/troubleshooting/ARDUINO_LIBRARY_NAME_FIX.md +197 -0
  34. package/docs/troubleshooting/NPM_PUBLISHING_ISSUE_SUMMARY.md +110 -0
  35. package/docs/troubleshooting/station-reconnection-issues.md +172 -0
  36. package/examples/bridge_failover/README.md +17 -1
  37. package/examples/priority/README.md +274 -0
  38. package/examples/priority/priority_basic_example.ino +115 -0
  39. package/examples/priority/priority_with_queue.ino +249 -0
  40. package/examples/routing_demo/README.md +172 -0
  41. package/examples/routing_demo/routing_demo.ino +102 -0
  42. package/library.json +1 -1
  43. package/library.properties +3 -3
  44. package/package.json +1 -1
  45. package/src/arduino/wifi.hpp +62 -16
  46. package/src/painlessMesh.h +15 -0
  47. package/src/painlessMeshSTA.cpp +7 -1
  48. package/src/painlessmesh/buffer.hpp +218 -37
  49. package/src/painlessmesh/connection.hpp +21 -1
  50. package/src/painlessmesh/mesh.hpp +253 -19
  51. package/src/painlessmesh/router.hpp +31 -0
@@ -0,0 +1,229 @@
1
+ # Arduino IDE Version Detection Issue - Resolution Summary
2
+
3
+ ## Issue Summary **[RESOLVED]**
4
+
5
+ **Problem**: Arduino IDE does not detect the current library version (1.8.2), shows old version (1.6.1).
6
+
7
+ **Root Cause**: The library name in `library.properties` was changed from `Alteriom PainlessMesh` (v1.6.1) to `AlteriomPainlessMesh` (v1.7.0+). Arduino Library Manager requires consistent library names and stopped indexing new releases when the name changed.
8
+
9
+ **Impact**: Users could only see and install version 1.6.1 via Arduino IDE Library Manager.
10
+
11
+ **Solution**: Reverted library name in `library.properties` back to original format with space: `Alteriom PainlessMesh`
12
+
13
+ ## Solution Overview
14
+
15
+ This issue has been **RESOLVED**. The library name has been corrected and Arduino Library Manager will resume indexing new releases.
16
+
17
+ ### What Has Been Done ✅
18
+
19
+ 1. **Identified Root Cause**: Library name changed from `Alteriom PainlessMesh` to `AlteriomPainlessMesh`
20
+ 2. **Verified Registration**: Confirmed library is already in arduino/library-registry
21
+ 3. **Fixed Library Name**: Reverted `library.properties` to use original name with space
22
+ 4. **Verified Compliance**: All Arduino Library Manager requirements are met
23
+ 5. **Updated Documentation**: Comprehensive explanation and validation tools
24
+ 6. **No Manual Action Required**: Arduino will automatically index new releases
25
+
26
+ ## What Happens Next (Automatic)
27
+
28
+ **Arduino Library Manager will automatically index the next release:**
29
+
30
+ ### Step-by-Step Submission Process
31
+
32
+ 1. **Open Browser** → https://github.com/arduino/library-registry
33
+ 2. **Click "Issues"** → "New Issue"
34
+ 3. **Copy Template** from `.github/ARDUINO_LIBRARY_REGISTRY_SUBMISSION.md`
35
+ 4. **Paste and Submit** the issue
36
+ 5. **Wait for Review** (1-2 weeks typical)
37
+ 6. **Verify Registration** in Arduino IDE
38
+
39
+ ### Quick Submission
40
+
41
+ Use this command to view the submission template:
42
+
43
+ ```bash
44
+ cat .github/ARDUINO_LIBRARY_REGISTRY_SUBMISSION.md
45
+ ```
46
+
47
+ Then copy the entire content and create an issue at https://github.com/arduino/library-registry
48
+
49
+ ## What Happens After Submission
50
+
51
+ ### Immediate (Upon Approval)
52
+ - ✅ Library appears in Arduino IDE Library Manager
53
+ - ✅ Users can search for "AlteriomPainlessMesh"
54
+ - ✅ One-click installation available
55
+ - ✅ Version 1.8.2 (and all future releases) automatically indexed
56
+
57
+ ### Future Releases
58
+ - **Automatic**: Arduino Library Manager checks for updates every 24-48 hours
59
+ - **No Manual Work**: Just create GitHub releases with proper version tags
60
+ - **Seamless Updates**: Users see "Update" button in Library Manager
61
+
62
+ ## Files Created
63
+
64
+ ### Documentation
65
+ 1. **`docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md`** (10KB)
66
+ - Complete submission guide
67
+ - Pre-submission checklist
68
+ - Testing procedures
69
+ - Troubleshooting guide
70
+ - Post-registration maintenance
71
+
72
+ 2. **`.github/ARDUINO_LIBRARY_REGISTRY_SUBMISSION.md`** (5KB)
73
+ - Ready-to-use submission template
74
+ - Includes all library features
75
+ - Highlights compliance status
76
+ - Lists all dependencies
77
+
78
+ ### Tools
79
+ 3. **`scripts/validate-arduino-compliance.sh`**
80
+ - Automated compliance checker
81
+ - Validates all requirements
82
+ - Checks version consistency
83
+ - Verifies file structure
84
+ - **Current Status**: ✅ All checks passing
85
+
86
+ ### Updated Documentation
87
+ 4. **`RELEASE_GUIDE.md`**
88
+ - Added Arduino Library Manager section
89
+ - Prominent registration warning
90
+ - Detailed submission instructions
91
+
92
+ 5. **`README.md`**
93
+ - Updated installation section
94
+ - Added registration status
95
+ - Provided temporary workarounds
96
+
97
+ ## Current Workarounds for Users
98
+
99
+ Until registration is complete, users can install the library via:
100
+
101
+ ### Option 1: PlatformIO (Recommended)
102
+ ```ini
103
+ [env:esp32dev]
104
+ lib_deps = alteriom/AlteriomPainlessMesh@^1.8.2
105
+ ```
106
+
107
+ ### Option 2: Manual ZIP Installation
108
+ 1. Download from https://github.com/Alteriom/painlessMesh/releases/latest
109
+ 2. Arduino IDE → Sketch → Include Library → Add .ZIP Library
110
+ 3. Select downloaded ZIP file
111
+
112
+ ### Option 3: Git Clone
113
+ ```bash
114
+ cd ~/Arduino/libraries/
115
+ git clone https://github.com/Alteriom/painlessMesh.git AlteriomPainlessMesh
116
+ ```
117
+
118
+ ### Option 4: NPM (for Node.js projects)
119
+ ```bash
120
+ npm install @alteriom/painlessmesh
121
+ ```
122
+
123
+ ## Validation Results
124
+
125
+ All Arduino Library Manager requirements verified:
126
+
127
+ ```
128
+ ✓ library.properties exists and is properly formatted
129
+ ✓ Version field set to 1.8.2
130
+ ✓ src/ directory with header files
131
+ ✓ examples/ directory with 29 examples
132
+ ✓ LICENSE file (LGPL-3.0)
133
+ ✓ README.md with comprehensive documentation
134
+ ✓ Git tags properly formatted (v1.8.2)
135
+ ✓ Version consistency across all files
136
+ ✓ Dependencies properly declared
137
+ ✓ keywords.txt present
138
+ ```
139
+
140
+ Run validation: `./scripts/validate-arduino-compliance.sh`
141
+
142
+ ## Expected Timeline
143
+
144
+ | Phase | Duration | Status |
145
+ |-------|----------|--------|
146
+ | Documentation & Validation | Complete | ✅ Done |
147
+ | Submission Creation | 5 minutes | ⏳ Pending |
148
+ | Arduino Team Review | 1-2 weeks | ⏳ Awaiting submission |
149
+ | Indexing & Availability | 24-48 hours | ⏳ After approval |
150
+
151
+ ## Benefits of Registration
152
+
153
+ ### For Users
154
+ - ✅ One-click installation via Arduino IDE
155
+ - ✅ Automatic update notifications
156
+ - ✅ Version selection in Library Manager
157
+ - ✅ Integration with Arduino's ecosystem
158
+
159
+ ### For Maintainers
160
+ - ✅ Wider user reach
161
+ - ✅ Automatic version indexing
162
+ - ✅ Reduced support burden
163
+ - ✅ Professional credibility
164
+
165
+ ## Support Resources
166
+
167
+ ### Documentation Files
168
+ - **Submission Guide**: `docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md`
169
+ - **Submission Template**: `.github/ARDUINO_LIBRARY_REGISTRY_SUBMISSION.md`
170
+ - **Release Guide**: `RELEASE_GUIDE.md`
171
+ - **Validation Script**: `scripts/validate-arduino-compliance.sh`
172
+
173
+ ### External Resources
174
+ - **Arduino Library Registry**: https://github.com/arduino/library-registry
175
+ - **Submission Guidelines**: https://support.arduino.cc/hc/en-us/articles/360012175419
176
+ - **Library Specification**: https://arduino.github.io/arduino-cli/latest/library-specification/
177
+
178
+ ### Getting Help
179
+ - **Issues**: https://github.com/Alteriom/painlessMesh/issues
180
+ - **Discussions**: https://github.com/Alteriom/painlessMesh/discussions
181
+ - **Arduino Forum**: https://forum.arduino.cc/c/using-arduino/libraries/67
182
+
183
+ ## Frequently Asked Questions
184
+
185
+ ### Q: Why isn't this automatic?
186
+ **A**: Arduino Library Manager requires one-time manual submission to their registry repository. After approval, all future releases are automatically indexed.
187
+
188
+ ### Q: How long does approval take?
189
+ **A**: Typically 1-2 weeks, but can vary depending on the Arduino team's review queue.
190
+
191
+ ### Q: Will this break existing users?
192
+ **A**: No. Users already using PlatformIO, manual installation, or NPM will continue working. This only adds Arduino IDE support.
193
+
194
+ ### Q: What if the submission is rejected?
195
+ **A**: Unlikely, as all requirements are met. If issues are found, the Arduino team will provide feedback to address them.
196
+
197
+ ### Q: Do we need to update library.properties?
198
+ **A**: No. The current library.properties is compliant and ready for submission.
199
+
200
+ ## Next Steps Summary
201
+
202
+ **For Repository Maintainer:**
203
+ 1. Review `.github/ARDUINO_LIBRARY_REGISTRY_SUBMISSION.md`
204
+ 2. Create issue at https://github.com/arduino/library-registry
205
+ 3. Monitor issue for Arduino team feedback
206
+ 4. Verify library appears in Arduino IDE after approval
207
+
208
+ **For Users (Current):**
209
+ - Use PlatformIO, manual ZIP, or git clone installation
210
+ - All features and updates available via these methods
211
+ - Arduino IDE support coming after registration
212
+
213
+ **For Future:**
214
+ - After registration, Arduino IDE installation works automatically
215
+ - No additional work needed for future releases
216
+ - Semantic version tags automatically indexed
217
+
218
+ ---
219
+
220
+ ## Summary
221
+
222
+ ✅ **Problem Identified**: Library not in Arduino Library Manager registry
223
+ ✅ **Solution Prepared**: Documentation and submission template ready
224
+ ✅ **Requirements Met**: All compliance checks passing
225
+ ✅ **Action Required**: One-time manual submission by maintainer
226
+ ✅ **Workarounds Available**: PlatformIO, ZIP, git clone all functional
227
+ ✅ **Future Automatic**: After registration, all releases auto-indexed
228
+
229
+ **Estimated Resolution**: 1-3 weeks after submission
@@ -0,0 +1,197 @@
1
+ # Arduino Library Manager - Library Name Fix
2
+
3
+ ## Issue Resolution Summary
4
+
5
+ **Date**: November 11, 2025
6
+ **Issue**: Arduino IDE showing version 1.6.1 instead of current version 1.8.2
7
+ **Status**: ✅ **RESOLVED**
8
+
9
+ ## Problem Analysis
10
+
11
+ ### Initial Diagnosis (Incorrect)
12
+ Initially believed the library was not registered in Arduino Library Manager.
13
+
14
+ ### Actual Root Cause (Correct)
15
+ The library IS registered, but the library name changed between releases:
16
+
17
+ | Version | Library Name | Arduino Indexing |
18
+ |---------|-------------|------------------|
19
+ | v1.6.1 (Sept 2025) | `Alteriom PainlessMesh` | ✅ Indexed |
20
+ | v1.7.0 - v1.8.2 | `AlteriomPainlessMesh` | ❌ Not indexed |
21
+
22
+ **Arduino Library Manager Requirement**: Library names must remain consistent after registration.
23
+
24
+ When the name changed from `Alteriom PainlessMesh` (with space) to `AlteriomPainlessMesh` (no space), the Arduino indexer stopped recognizing new releases as updates to the registered library.
25
+
26
+ ## Solution Applied
27
+
28
+ ### Change Made
29
+ Restored the library name in `library.properties` to match the original registration:
30
+
31
+ ```diff
32
+ - name=AlteriomPainlessMesh
33
+ + name=Alteriom PainlessMesh
34
+ ```
35
+
36
+ ### Verification
37
+ ```bash
38
+ # v1.6.1 (last indexed version)
39
+ name=Alteriom PainlessMesh
40
+
41
+ # Current (fixed)
42
+ name=Alteriom PainlessMesh
43
+
44
+ # Result: ✓ Names match
45
+ ```
46
+
47
+ ## Impact & Timeline
48
+
49
+ ### Immediate
50
+ - ✅ Library name corrected in repository
51
+ - ✅ Validation script updated to detect this issue
52
+ - ✅ Documentation updated with correct information
53
+
54
+ ### Next 24-48 Hours
55
+ - Arduino Library Manager will detect next release (v1.8.3 or v1.9.0)
56
+ - New version will appear in Arduino IDE Library Manager
57
+ - Users will see update notification
58
+
59
+ ### Going Forward
60
+ - All future releases will be automatically indexed
61
+ - No manual intervention required
62
+ - Library Manager will show latest versions within 24-48 hours of each GitHub release
63
+
64
+ ## Technical Details
65
+
66
+ ### Arduino Library Registry Status
67
+ - **Registered**: ✅ Yes
68
+ - **Repository URL**: https://github.com/Alteriom/painlessMesh
69
+ - **Registry Entry**: https://github.com/arduino/library-registry (repositories.txt)
70
+ - **Original Registration Name**: `Alteriom PainlessMesh`
71
+
72
+ ### How Arduino Library Manager Works
73
+ 1. Library is registered once in arduino/library-registry
74
+ 2. Arduino indexer checks registered repositories for new releases every 24-48 hours
75
+ 3. For each new release tag, indexer reads `library.properties`
76
+ 4. **Critical**: Library name in `library.properties` must match original registration
77
+ 5. If name matches, new version is added to index
78
+ 6. If name doesn't match, release is ignored
79
+
80
+ ### Why Name Changed
81
+ Between v1.6.1 and v1.7.0, the library name was changed (likely to remove the space for URL compatibility). However, this broke Arduino Library Manager indexing.
82
+
83
+ ### Versions Affected
84
+ **Not Indexed** (due to name mismatch):
85
+ - v1.7.0, v1.7.1, v1.7.2, v1.7.3, v1.7.4, v1.7.5, v1.7.6, v1.7.7, v1.7.8, v1.7.9
86
+ - v1.8.0, v1.8.1, v1.8.2
87
+
88
+ **Will Be Indexed** (after fix):
89
+ - v1.8.3+ (any future releases with corrected name)
90
+
91
+ ## What Users Will See
92
+
93
+ ### Before Fix
94
+ ```
95
+ Arduino IDE Library Manager:
96
+ ┌─────────────────────────────────┐
97
+ │ Alteriom PainlessMesh │
98
+ │ Version: 1.6.1 │
99
+ │ [Installed] │
100
+ └─────────────────────────────────┘
101
+ ```
102
+
103
+ ### After Fix (24-48 hours after v1.8.3 release)
104
+ ```
105
+ Arduino IDE Library Manager:
106
+ ┌─────────────────────────────────┐
107
+ │ Alteriom PainlessMesh │
108
+ │ Version: 1.8.3 (Update available)│
109
+ │ [Update] │
110
+ └─────────────────────────────────┘
111
+ ```
112
+
113
+ ## Validation
114
+
115
+ ### Automated Check
116
+ Run the validation script to confirm library name is correct:
117
+
118
+ ```bash
119
+ ./scripts/validate-arduino-compliance.sh
120
+ ```
121
+
122
+ Expected output:
123
+ ```
124
+ Checking library name format... ✓ CORRECT (name='Alteriom PainlessMesh')
125
+ ```
126
+
127
+ ### Manual Verification
128
+ Compare current name with v1.6.1:
129
+
130
+ ```bash
131
+ # Current
132
+ grep "^name=" library.properties
133
+ # Output: name=Alteriom PainlessMesh
134
+
135
+ # v1.6.1 (last indexed)
136
+ curl -s "https://raw.githubusercontent.com/Alteriom/painlessMesh/v1.6.1/library.properties" | grep "^name="
137
+ # Output: name=Alteriom PainlessMesh
138
+
139
+ # They should match ✓
140
+ ```
141
+
142
+ ## Lessons Learned
143
+
144
+ ### For Library Maintainers
145
+ 1. **Never change library name** after Arduino Library Manager registration
146
+ 2. Library name must remain exactly the same (including spaces, capitalization)
147
+ 3. Use validation scripts to catch name changes before release
148
+ 4. Check Arduino Library Manager indexing after each release
149
+
150
+ ### For This Repository
151
+ 1. Added library name validation to compliance script
152
+ 2. Documented the requirement clearly in release guide
153
+ 3. This issue is now prevented by automated checks
154
+
155
+ ## Related Files
156
+
157
+ ### Modified Files (Commit 5065fa5)
158
+ - `library.properties` - Restored correct library name
159
+ - `docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md` - Updated with resolution
160
+ - `README.md` - Fixed status and explanation
161
+ - `RELEASE_GUIDE.md` - Corrected registration information
162
+ - `ARDUINO_IDE_VERSION_FIX_SUMMARY.md` - Updated resolution details
163
+ - `scripts/validate-arduino-compliance.sh` - Added name consistency check
164
+
165
+ ### Documentation
166
+ - `docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md` - Complete guide
167
+ - `ARDUINO_IDE_VERSION_FIX_SUMMARY.md` - Issue summary
168
+ - This file - Detailed resolution documentation
169
+
170
+ ## References
171
+
172
+ ### Arduino Documentation
173
+ - [Arduino Library Manager FAQ](https://github.com/arduino/library-registry/blob/main/FAQ.md)
174
+ - [Library Specification](https://arduino.github.io/arduino-cli/latest/library-specification/)
175
+ - [Why libraries aren't updated](https://github.com/arduino/library-registry/issues/1002)
176
+
177
+ ### Repository Links
178
+ - [Arduino Library Registry](https://github.com/arduino/library-registry)
179
+ - [Library Registry repositories.txt](https://github.com/arduino/library-registry/blob/main/repositories.txt)
180
+ - [This Repository](https://github.com/Alteriom/painlessMesh)
181
+
182
+ ## Credits
183
+
184
+ **Issue Identified By**: @sparck75
185
+ **Resolution**: GitHub Copilot
186
+ **Date**: November 11, 2025
187
+ **Commit**: 5065fa5
188
+
189
+ ---
190
+
191
+ ## Summary
192
+
193
+ ✅ **Issue**: Library name changed, breaking Arduino indexing
194
+ ✅ **Fix**: Restored original name with space
195
+ ✅ **Result**: Automatic indexing will resume with next release
196
+ ✅ **Timeline**: 24-48 hours after v1.8.3+ release
197
+ ✅ **Prevention**: Validation script now checks library name
@@ -0,0 +1,110 @@
1
+ # NPM and GitHub Packages Publishing Issue - Summary
2
+
3
+ ## Issue Identified
4
+
5
+ When PR#19 was merged to main with the commit message:
6
+ ```
7
+ Release v1.7.7 - Complete mqtt-schema v0.7.2 implementation
8
+ ```
9
+
10
+ The automated release workflow created the tag and GitHub release successfully, **but the NPM and GitHub Packages publishing jobs were skipped**.
11
+
12
+ ## Root Cause
13
+
14
+ The automated workflow file `.github/workflows/release.yml` has a condition for NPM and GitHub Packages publishing:
15
+
16
+ ```yaml
17
+ npm-publish:
18
+ needs: [tag-and-release]
19
+ runs-on: ubuntu-latest
20
+ if: startsWith(github.event.head_commit.message, 'release:')
21
+ ```
22
+
23
+ **Problem**: The condition checks if the commit message starts with `release:` (lowercase with colon), but the merge commit was:
24
+ - Tag created: v1.7.7
25
+ - GitHub Release created
26
+ - NPM publish skipped (message started with "Release" not "release:")
27
+ - GitHub Packages publish skipped (same reason)
28
+
29
+ ## Solution Implemented
30
+
31
+ ### 1. Manual Publishing Workflow Created
32
+
33
+ Created `.github/workflows/manual-publish.yml` with:
34
+ - Manual trigger via GitHub Actions UI
35
+ - Checkboxes to select which registries to publish to:
36
+ - Publish to NPM Registry
37
+ - Publish to GitHub Packages
38
+ - Reads version from `library.properties` automatically
39
+ - Validates authentication tokens
40
+ - Provides clear success/failure feedback
41
+
42
+ ### 2. How to Use Manual Publishing
43
+
44
+ **Via GitHub UI:**
45
+ 1. Go to https://github.com/Alteriom/painlessMesh/actions
46
+ 2. Select "Manual Package Publishing" workflow
47
+ 3. Click "Run workflow" button
48
+ 4. Select desired options (both checked by default)
49
+ 5. Click "Run workflow"
50
+
51
+ **Via GitHub CLI:**
52
+ ```bash
53
+ gh workflow run manual-publish.yml
54
+ ```
55
+
56
+ ### 3. Documentation Updated
57
+
58
+ Updated `RELEASE_GUIDE.md` with:
59
+ - Explanation of the commit message requirement
60
+ - Troubleshooting section for this specific issue
61
+ - Instructions for using the manual publishing workflow
62
+ - Examples of correct vs incorrect commit messages
63
+
64
+ ## Immediate Action Required
65
+
66
+ To publish v1.7.7 to NPM and GitHub Packages:
67
+
68
+ 1. Navigate to: https://github.com/Alteriom/painlessMesh/actions/workflows/manual-publish.yml
69
+ 2. Click "Run workflow"
70
+ 3. Ensure both checkboxes are selected:
71
+ - Publish to NPM Registry
72
+ - Publish to GitHub Packages
73
+ 4. Click "Run workflow"
74
+
75
+ The workflow will:
76
+ - Read version 1.7.7 from library.properties
77
+ - Publish @alteriom/painlessmesh@1.7.7 to npmjs.org
78
+ - Publish to GitHub Packages registry
79
+
80
+ ## Prevention for Future Releases
81
+
82
+ To avoid this issue in future releases, ensure commit messages start with `release:` (lowercase with colon):
83
+
84
+ ** Correct:**
85
+ ```bash
86
+ git commit -m "release: v1.7.8 - Next version description"
87
+ ```
88
+
89
+ ** Wrong:**
90
+ ```bash
91
+ git commit -m "Release v1.7.8 - Next version description"
92
+ ```
93
+
94
+ ## Additional Notes
95
+
96
+ - The tag v1.7.7 exists and is correct
97
+ - GitHub Release exists and is correct
98
+ - Only NPM/GitHub Packages publishing needs to be done manually this time
99
+ - All other release channels (PlatformIO, Arduino Library Manager) are unaffected
100
+ - This is a one-time manual fix; future releases will work automatically if commit message is correct
101
+
102
+ ## Files Changed
103
+
104
+ 1. `.github/workflows/manual-publish.yml` - New manual publishing workflow
105
+ 2. `RELEASE_GUIDE.md` - Updated documentation with troubleshooting
106
+
107
+ ---
108
+
109
+ **Status**: Ready to manually publish v1.7.7 packages
110
+ **Action**: Run manual-publish.yml workflow via GitHub Actions UI
@@ -0,0 +1,172 @@
1
+ # Station Reconnection Issues in Bridge Mode
2
+
3
+ ## Problem Description
4
+
5
+ When using `stationManual()` to create a bridge node that connects to a router while also maintaining a mesh network, users may experience issues where the station (router) connection drops during mesh initialization and fails to reconnect automatically.
6
+
7
+ ### Symptoms
8
+
9
+ - Initial connection to router succeeds
10
+ - Mesh network initializes successfully
11
+ - Station connection drops with `ARDUINO_EVENT_WIFI_STA_DISCONNECTED` events
12
+ - Station never reconnects despite reconnection logic being triggered
13
+ - Serial output shows repeated disconnect events without successful reconnection
14
+
15
+ ### Example Serial Output
16
+
17
+ ```
18
+ === WiFi Connectivity Diagnostics ===
19
+ Step 1: Connecting to router to detect channel...
20
+ ✓ Successfully connected to router!
21
+ Router Channel: 6 ← Auto-detected!
22
+ Router IP: 192.168.18.11
23
+
24
+ Step 2: Initializing mesh on channel 6...
25
+ STARTUP: init(): 1
26
+ STARTUP: init(): Mesh channel set to 6
27
+ STARTUP: AP tcp server established on port 5555
28
+ STARTUP: stationManual(): Connecting to MyRouter
29
+ STARTUP: stationManual(): Connection initiated
30
+ ✓ Mesh initialized
31
+
32
+ Step 3: Waiting for station reconnection...
33
+ CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
34
+ CONNECTION: eraseClosedConnections():
35
+ CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
36
+ CONNECTION: eraseClosedConnections():
37
+ ⚠ Station not connected yet (may connect later)
38
+ ```
39
+
40
+ ## Root Cause
41
+
42
+ The issue was in the `connectToAP()` method in `src/painlessMeshSTA.cpp`. When operating in manual mode (for router connections via `stationManual()`):
43
+
44
+ 1. Station disconnects during mesh initialization (normal behavior in AP+STA mode)
45
+ 2. Disconnect callback triggers `yieldConnectToAP()` to reconnect
46
+ 3. `connectToAP()` checks if router SSID is in the scan results
47
+ 4. Router SSID is NOT in scan results (scan only looks for mesh nodes on mesh channel)
48
+ 5. Function returns without calling `WiFi.begin()` to reconnect
49
+ 6. Station remains disconnected indefinitely
50
+
51
+ ### Code Analysis
52
+
53
+ **Before Fix** (lines 192-195 in `painlessMeshSTA.cpp`):
54
+
55
+ ```cpp
56
+ } else if (aps.empty() || !ssid.equals(aps.begin()->ssid)) {
57
+ task.enableDelayed(SCAN_INTERVAL);
58
+ return; // ← Just delays, never attempts reconnection!
59
+ }
60
+ ```
61
+
62
+ The problem: This conditional assumes the router SSID will appear in the `aps` list from `stationScan()`. However, `stationScan()` only scans on the mesh channel for mesh nodes, not for routers which may be on the same or different channel.
63
+
64
+ ## Solution
65
+
66
+ **After Fix** (v1.8.1+):
67
+
68
+ ```cpp
69
+ } else {
70
+ // For manual router connections, reconnect directly using WiFi.begin()
71
+ // Don't rely on scan results since router may be on different channel
72
+ Log(CONNECTION,
73
+ "connectToAP(): Manual connection - attempting to reconnect to %s\n",
74
+ ssid.c_str());
75
+ WiFi.begin(ssid.c_str(), password.c_str());
76
+ task.enableDelayed(SCAN_INTERVAL);
77
+ return;
78
+ }
79
+ ```
80
+
81
+ The fix:
82
+ - Removes dependency on scan results for manual connections
83
+ - Calls `WiFi.begin()` directly to reconnect to the router
84
+ - Lets ESP hardware auto-detect the router's channel (as designed)
85
+ - Adds clear logging to show reconnection attempts
86
+
87
+ ## Verification
88
+
89
+ After applying the fix, the expected behavior is:
90
+
91
+ ```
92
+ Step 3: Waiting for station reconnection...
93
+ CONNECTION: eventSTADisconnectedHandler: ARDUINO_EVENT_WIFI_STA_DISCONNECTED
94
+ CONNECTION: eraseClosedConnections():
95
+ CONNECTION: connectToAP(): Manual connection - attempting to reconnect to MyRouter
96
+ ✓ Station reconnected successfully!
97
+ IP Address: 192.168.18.11
98
+ ```
99
+
100
+ ## Workaround (for older versions)
101
+
102
+ If you're using a version before v1.8.1, you can work around this issue by implementing explicit reconnection logic:
103
+
104
+ ```cpp
105
+ void setup() {
106
+ // ... mesh initialization ...
107
+
108
+ // Add a task to monitor and reconnect station
109
+ userScheduler.addTask(Task(5000, TASK_FOREVER, [](){
110
+ if (WiFi.status() != WL_CONNECTED) {
111
+ Serial.println("Station disconnected, reconnecting...");
112
+ WiFi.begin(ROUTER_SSID, ROUTER_PASSWORD);
113
+ }
114
+ }));
115
+ }
116
+ ```
117
+
118
+ ## Related Issues
119
+
120
+ - Issue #21: Original user report from @woodlist
121
+ - Issue #50: Bug tracking for stationManual() channel issues
122
+ - Issue #59: Bridge-centric architecture proposal
123
+ - PR #[number]: Fix implementation
124
+
125
+ ## Affected Versions
126
+
127
+ - **Affected**: v1.5.0 - v1.8.0
128
+ - **Fixed**: v1.8.1+
129
+
130
+ ## Platforms
131
+
132
+ This issue affects all ESP platforms:
133
+ - ESP32 (all variants including ESP32-C6, ESP32-S3)
134
+ - ESP8266
135
+
136
+ ## Additional Notes
137
+
138
+ ### Why Does Station Disconnect During Mesh Init?
139
+
140
+ When the ESP switches from pure STA mode to AP+STA mode during mesh initialization, the WiFi subsystem may briefly disconnect from the station to reconfigure. This is normal behavior and the library should automatically reconnect.
141
+
142
+ ### Channel Matching
143
+
144
+ Remember that in AP+STA mode, both the AP (mesh) and STA (router connection) **must use the same WiFi channel**. This is a hardware limitation. The fix ensures reconnection works regardless of channel, but both interfaces will still operate on the same channel.
145
+
146
+ ### Best Practice
147
+
148
+ For production bridge nodes, consider using the "Station First" pattern to auto-detect the router's channel before initializing the mesh:
149
+
150
+ ```cpp
151
+ void setup() {
152
+ // Step 1: Connect to router first to detect its channel
153
+ WiFi.mode(WIFI_STA);
154
+ WiFi.begin(ROUTER_SSID, ROUTER_PASSWORD);
155
+ while (WiFi.status() != WL_CONNECTED) {
156
+ delay(500);
157
+ }
158
+
159
+ uint8_t detectedChannel = WiFi.channel();
160
+ Serial.printf("Router channel: %d\n", detectedChannel);
161
+
162
+ WiFi.disconnect();
163
+ delay(1000);
164
+
165
+ // Step 2: Initialize mesh on the detected channel
166
+ mesh.init(MESH_SSID, MESH_PASSWORD, &userScheduler, MESH_PORT,
167
+ WIFI_AP_STA, detectedChannel);
168
+ mesh.stationManual(ROUTER_SSID, ROUTER_PASSWORD);
169
+ }
170
+ ```
171
+
172
+ This approach guarantees channel compatibility and more reliable connections.