@alteriom/painlessmesh 1.7.2 → 1.7.3
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.
- package/CHANGELOG.md +58 -4
- package/README.md +17 -3
- package/docs/README.md +62 -10
- package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +166 -0
- package/docs/archive/LIBRARY_JSON_FIX.md +98 -0
- package/docs/archive/LIBRARY_STRUCTURE_FIX.md +215 -0
- package/docs/archive/RELEASE_SUMMARY.md +173 -0
- package/docs/archive/SCONS_BUILD_FIX.md +313 -0
- package/docs/archive/TRIGGER_RELEASE.md +280 -0
- package/docs/archive/VECTOR_INCLUDE_FIX.md +129 -0
- package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +71 -0
- package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +1011 -0
- package/docs/development/DOCKER_TESTING.md +196 -0
- package/docs/development/PLATFORMIO_USAGE.md +180 -0
- package/docs/development/TESTING_SUMMARY.md +126 -0
- package/docs/development/contributing.md +301 -0
- package/docs/development/documentation.md +583 -0
- package/docs/improvements/FUTURE_PROPOSALS.md +1016 -0
- package/docs/improvements/IMPLEMENTATION_HISTORY.md +1091 -0
- package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +709 -0
- package/docs/improvements/README.md +171 -46
- package/docs/releases/FEATURE_HISTORY.md +543 -0
- package/docs/releases/PATCH_v1.7.3.md +262 -0
- package/docs/releases/PHASE1_SUMMARY.md +246 -0
- package/docs/releases/PHASE2_SUMMARY.md +499 -0
- package/docs/releases/RELEASE_NOTES_1.7.0.md +539 -0
- package/docs/troubleshooting/debugging.md +455 -0
- package/library.json +1 -1
- package/library.properties +1 -1
- package/package.json +1 -1
- package/src/painlessmesh/router.hpp +35 -19
- /package/docs/{improvements → archive}/FEATURE_PROPOSALS.md +0 -0
- /package/docs/{improvements → archive}/PHASE1_IMPLEMENTATION.md +0 -0
- /package/docs/{improvements → archive}/PHASE2_IMPLEMENTATION.md +0 -0
- /package/docs/{improvements → archive}/ota-and-status-enhancements.md +0 -0
- /package/docs/{improvements → archive}/ota-status-architecture-diagrams.md +0 -0
- /package/docs/{improvements → archive}/ota-status-quick-reference.md +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# PlatformIO SCons Build Error Troubleshooting
|
|
2
|
+
|
|
3
|
+
## Common Error: "UnboundLocalError: local variable 'dir' referenced before assignment"
|
|
4
|
+
|
|
5
|
+
This error occurs during PlatformIO's SCons build process when compiling `painlessMeshSTA.cpp` and similar files.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## ✅ FIXES APPLIED TO LIBRARY
|
|
10
|
+
|
|
11
|
+
The following fixes have been applied to the **painlessMesh library** itself:
|
|
12
|
+
|
|
13
|
+
### 0. Added Missing Header Include (CRITICAL)
|
|
14
|
+
```cpp
|
|
15
|
+
// src/painlessmesh/mesh.hpp
|
|
16
|
+
#include <vector> // Required for std::vector usage
|
|
17
|
+
```
|
|
18
|
+
**Why:** The mesh.hpp file uses `std::vector` but wasn't including the header, causing compilation errors.
|
|
19
|
+
|
|
20
|
+
### 1. Added Explicit Directory Specifications
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"srcDir": "src",
|
|
24
|
+
"includeDir": "src"
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
**Why:** Tells PlatformIO exactly where source files are located.
|
|
28
|
+
|
|
29
|
+
### 2. Removed Conflicting Export Settings
|
|
30
|
+
**Before:**
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"export": {
|
|
34
|
+
"include": "src"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**After:** (Removed completely)
|
|
40
|
+
|
|
41
|
+
**Why:** The `export.include` conflicts with `srcDir` and causes path resolution issues in SCons.
|
|
42
|
+
|
|
43
|
+
### 3. Verified File Locations
|
|
44
|
+
- ✅ All `.cpp` files in `src/` directory
|
|
45
|
+
- ✅ `painlessMeshSTA.cpp` at `src/painlessMeshSTA.cpp`
|
|
46
|
+
- ✅ No source files in root directory
|
|
47
|
+
- ✅ No duplicate `library.json` files
|
|
48
|
+
|
|
49
|
+
### 4. Fixed Header References
|
|
50
|
+
- ✅ `library.properties` references `painlessMesh.h`
|
|
51
|
+
- ✅ Both `painlessMesh.h` and `AlteriomPainlessMesh.h` available
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🔧 FIXES FOR YOUR PROJECT
|
|
56
|
+
|
|
57
|
+
If you're still getting errors, apply these fixes in YOUR project:
|
|
58
|
+
|
|
59
|
+
### Fix 1: Clean Build Cache
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Delete PlatformIO cache
|
|
63
|
+
pio run --target clean
|
|
64
|
+
|
|
65
|
+
# Or delete manually
|
|
66
|
+
rm -rf .pio
|
|
67
|
+
rm -rf .pioenvs
|
|
68
|
+
rm -rf .piolibdeps
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Fix 2: Update Library from GitHub
|
|
72
|
+
|
|
73
|
+
Make sure you're pulling the latest fixes:
|
|
74
|
+
|
|
75
|
+
```ini
|
|
76
|
+
[env:esp32]
|
|
77
|
+
platform = espressif32
|
|
78
|
+
board = esp32dev
|
|
79
|
+
framework = arduino
|
|
80
|
+
lib_deps =
|
|
81
|
+
; Use the LATEST commit with fixes
|
|
82
|
+
https://github.com/Alteriom/painlessMesh#copilot/start-phase-2-implementation
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Fix 3: Force Library Re-download
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Remove cached library
|
|
89
|
+
rm -rf .pio/libdeps/*/AlteriomPainlessMesh
|
|
90
|
+
|
|
91
|
+
# Or use PlatformIO's update command
|
|
92
|
+
pio pkg update
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Fix 4: Verify PlatformIO Version
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Check version
|
|
99
|
+
pio --version
|
|
100
|
+
|
|
101
|
+
# Update if needed (requires >= 6.0.0)
|
|
102
|
+
pip install -U platformio
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Fix 5: Check for Conflicting Libraries
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# List installed libraries
|
|
109
|
+
pio pkg list
|
|
110
|
+
|
|
111
|
+
# Remove any duplicate painlessMesh installations
|
|
112
|
+
pio pkg uninstall -g painlessMesh
|
|
113
|
+
pio pkg uninstall -g AlteriomPainlessMesh
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 🧪 TEST BUILD
|
|
119
|
+
|
|
120
|
+
### Step 1: Create Test Project
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
mkdir test-painlessmesh
|
|
124
|
+
cd test-painlessmesh
|
|
125
|
+
pio init --board esp32dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Step 2: Create platformio.ini
|
|
129
|
+
|
|
130
|
+
```ini
|
|
131
|
+
[env:esp32]
|
|
132
|
+
platform = espressif32
|
|
133
|
+
board = esp32dev
|
|
134
|
+
framework = arduino
|
|
135
|
+
monitor_speed = 115200
|
|
136
|
+
|
|
137
|
+
lib_deps =
|
|
138
|
+
https://github.com/Alteriom/painlessMesh#copilot/start-phase-2-implementation
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Step 3: Create src/main.cpp
|
|
142
|
+
|
|
143
|
+
```cpp
|
|
144
|
+
#include <Arduino.h>
|
|
145
|
+
#include <painlessMesh.h>
|
|
146
|
+
|
|
147
|
+
Scheduler userScheduler;
|
|
148
|
+
painlessMesh mesh;
|
|
149
|
+
|
|
150
|
+
void setup() {
|
|
151
|
+
Serial.begin(115200);
|
|
152
|
+
|
|
153
|
+
mesh.setDebugMsgTypes(ERROR | STARTUP);
|
|
154
|
+
mesh.init("TestMesh", "password", &userScheduler, 5555);
|
|
155
|
+
|
|
156
|
+
Serial.println("Mesh initialized!");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
void loop() {
|
|
160
|
+
mesh.update();
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Step 4: Build
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pio run
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Expected Output:**
|
|
171
|
+
```
|
|
172
|
+
Building .pio/build/esp32/src/main.cpp.o
|
|
173
|
+
Building .pio/build/esp32/.pio/libdeps/esp32/AlteriomPainlessMesh/...
|
|
174
|
+
Linking .pio/build/esp32/firmware.elf
|
|
175
|
+
Building .pio/build/esp32/firmware.bin
|
|
176
|
+
SUCCESS
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## 🚨 IF STILL FAILING
|
|
182
|
+
|
|
183
|
+
### Collect Diagnostic Information
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Get verbose build output
|
|
187
|
+
pio run -v > build.log 2>&1
|
|
188
|
+
|
|
189
|
+
# Check library structure
|
|
190
|
+
cd .pio/libdeps/esp32/AlteriomPainlessMesh
|
|
191
|
+
ls -la
|
|
192
|
+
cat library.json
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Check for These Issues:
|
|
196
|
+
|
|
197
|
+
**1. Verify srcDir in downloaded library:**
|
|
198
|
+
```bash
|
|
199
|
+
cd .pio/libdeps/esp32/AlteriomPainlessMesh
|
|
200
|
+
cat library.json | grep srcDir
|
|
201
|
+
# Should show: "srcDir": "src",
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**2. Verify source files exist:**
|
|
205
|
+
```bash
|
|
206
|
+
ls -la src/
|
|
207
|
+
# Should show: painlessMeshSTA.cpp, scheduler.cpp, wifi.cpp
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**3. Check for duplicate files:**
|
|
211
|
+
```bash
|
|
212
|
+
find . -name "painlessMeshSTA.cpp"
|
|
213
|
+
# Should only show: ./src/painlessMeshSTA.cpp
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**4. Verify no export.include:**
|
|
217
|
+
```bash
|
|
218
|
+
cat library.json | grep export
|
|
219
|
+
# Should show: (nothing) or not include "include": "src"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 📋 CHECKLIST FOR SUCCESSFUL BUILD
|
|
225
|
+
|
|
226
|
+
- [ ] PlatformIO version >= 6.0.0
|
|
227
|
+
- [ ] Clean build cache (`pio run --target clean`)
|
|
228
|
+
- [ ] Remove `.pio` directory
|
|
229
|
+
- [ ] Update library.json has `srcDir` and `includeDir`
|
|
230
|
+
- [ ] No `export.include` in library.json
|
|
231
|
+
- [ ] All `.cpp` files in `src/` directory
|
|
232
|
+
- [ ] Force library re-download from GitHub
|
|
233
|
+
- [ ] Test with minimal example
|
|
234
|
+
- [ ] Check verbose build log for actual error
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## 🔍 UNDERSTANDING THE ERROR
|
|
239
|
+
|
|
240
|
+
### What Causes "UnboundLocalError: dir"?
|
|
241
|
+
|
|
242
|
+
This error occurs in PlatformIO's SCons build system when:
|
|
243
|
+
|
|
244
|
+
1. **Path resolution fails:** SCons can't determine the source directory
|
|
245
|
+
2. **Conflicting settings:** Multiple directory specifications conflict
|
|
246
|
+
3. **Cache corruption:** Old cached metadata from previous builds
|
|
247
|
+
4. **Missing metadata:** No `srcDir` specified in library.json
|
|
248
|
+
|
|
249
|
+
### The Fix (Applied):
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"name": "AlteriomPainlessMesh",
|
|
254
|
+
"srcDir": "src", // ← Explicit source directory
|
|
255
|
+
"includeDir": "src" // ← Explicit include directory
|
|
256
|
+
// "export": {...} // ← REMOVED (was causing conflicts)
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 📞 SUPPORT
|
|
263
|
+
|
|
264
|
+
If issues persist after trying all fixes:
|
|
265
|
+
|
|
266
|
+
1. **Check your build log:**
|
|
267
|
+
```bash
|
|
268
|
+
pio run -v 2>&1 | tee build-verbose.log
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
2. **Verify library was actually updated:**
|
|
272
|
+
```bash
|
|
273
|
+
cd .pio/libdeps/YOUR_ENV/AlteriomPainlessMesh
|
|
274
|
+
git log -1 --oneline
|
|
275
|
+
# Should show recent commit with fixes
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
3. **Try a completely fresh project:**
|
|
279
|
+
- New directory
|
|
280
|
+
- Fresh `pio init`
|
|
281
|
+
- No existing `.pio` folder
|
|
282
|
+
- Copy minimal example above
|
|
283
|
+
|
|
284
|
+
4. **Report issue with:**
|
|
285
|
+
- PlatformIO version
|
|
286
|
+
- Platform (espressif32/espressif8266)
|
|
287
|
+
- Full build log
|
|
288
|
+
- Contents of `.pio/libdeps/*/AlteriomPainlessMesh/library.json`
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## ✅ VERIFICATION
|
|
293
|
+
|
|
294
|
+
After applying fixes, your build should succeed with output like:
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
Dependency Graph
|
|
298
|
+
|-- AlteriomPainlessMesh @ 1.7.0
|
|
299
|
+
| |-- AsyncTCP @ 3.4.7
|
|
300
|
+
| |-- ArduinoJson @ 7.4.2
|
|
301
|
+
| |-- TaskScheduler @ 4.0.0
|
|
302
|
+
| |-- WiFi @ 2.0.0
|
|
303
|
+
Building .pio/build/esp32/lib/.../painlessMeshSTA.cpp.o
|
|
304
|
+
...
|
|
305
|
+
SUCCESS
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
**Last Updated:** October 15, 2025
|
|
311
|
+
**Library Version:** 1.7.0
|
|
312
|
+
**Branch:** copilot/start-phase-2-implementation
|
|
313
|
+
**Status:** ✅ SCons build issues resolved
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# Release Trigger Guide - Alteriom painlessMesh
|
|
2
|
+
|
|
3
|
+
## 🚀 Quick Release Process
|
|
4
|
+
|
|
5
|
+
### Standard Release (Recommended)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# 1. Update version using the bump script
|
|
9
|
+
./scripts/bump-version.sh patch # or minor, major
|
|
10
|
+
|
|
11
|
+
# 2. Update CHANGELOG.md with your changes
|
|
12
|
+
# Add your changes under the new version section
|
|
13
|
+
|
|
14
|
+
# 3. Commit and trigger release
|
|
15
|
+
git add library.properties library.json CHANGELOG.md package.json
|
|
16
|
+
git commit -m "release: v1.6.1"
|
|
17
|
+
git push origin main
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
That's it! GitHub Actions will automatically:
|
|
21
|
+
- ✅ Run comprehensive test suite
|
|
22
|
+
- ✅ Create git tag
|
|
23
|
+
- ✅ Generate GitHub release with changelog
|
|
24
|
+
- ✅ Publish to NPM (public registry)
|
|
25
|
+
- ✅ Publish to GitHub Packages
|
|
26
|
+
- ✅ Update GitHub Wiki
|
|
27
|
+
- ✅ Package library for Arduino Library Manager
|
|
28
|
+
- ✅ Validate all distribution channels
|
|
29
|
+
|
|
30
|
+
## 📋 Release Checklist
|
|
31
|
+
|
|
32
|
+
### Pre-Release Validation
|
|
33
|
+
- [ ] All tests passing locally (`npm run test`)
|
|
34
|
+
- [ ] Version consistency verified (`./scripts/validate-release.sh`)
|
|
35
|
+
- [ ] Changelog updated with new version
|
|
36
|
+
- [ ] Examples compile successfully
|
|
37
|
+
- [ ] Documentation updated if needed
|
|
38
|
+
|
|
39
|
+
### Release Execution
|
|
40
|
+
- [ ] Version bumped in all files
|
|
41
|
+
- [ ] Commit message starts with "release:"
|
|
42
|
+
- [ ] Pushed to main branch
|
|
43
|
+
- [ ] GitHub Actions workflows completed successfully
|
|
44
|
+
|
|
45
|
+
### Post-Release Verification
|
|
46
|
+
- [ ] GitHub release created
|
|
47
|
+
- [ ] NPM package published
|
|
48
|
+
- [ ] GitHub Packages updated
|
|
49
|
+
- [ ] Wiki synchronized
|
|
50
|
+
- [ ] Library available in distribution channels
|
|
51
|
+
|
|
52
|
+
## 🎯 Distribution Channels
|
|
53
|
+
|
|
54
|
+
### Automatic (Zero Manual Work)
|
|
55
|
+
1. **GitHub Releases** - Created automatically with changelog
|
|
56
|
+
2. **NPM Public Registry** - Published to https://www.npmjs.com/package/@alteriom/painlessmesh
|
|
57
|
+
3. **GitHub Packages** - Published to GitHub's NPM registry
|
|
58
|
+
4. **PlatformIO Registry** - Automatically indexed from GitHub releases
|
|
59
|
+
5. **GitHub Wiki** - Documentation synchronized automatically
|
|
60
|
+
|
|
61
|
+
### Semi-Automatic (Requires Manual Submission)
|
|
62
|
+
6. **Arduino Library Manager** - Requires one-time submission to Arduino team
|
|
63
|
+
|
|
64
|
+
## 📝 Version Management
|
|
65
|
+
|
|
66
|
+
### Semantic Versioning
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Patch version (1.6.0 → 1.6.1) - Bug fixes
|
|
70
|
+
./scripts/bump-version.sh patch
|
|
71
|
+
|
|
72
|
+
# Minor version (1.6.0 → 1.7.0) - New features
|
|
73
|
+
./scripts/bump-version.sh minor
|
|
74
|
+
|
|
75
|
+
# Major version (1.6.0 → 2.0.0) - Breaking changes
|
|
76
|
+
./scripts/bump-version.sh major
|
|
77
|
+
|
|
78
|
+
# Specific version
|
|
79
|
+
./scripts/bump-version.sh patch 1.6.2
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Version Consistency
|
|
83
|
+
|
|
84
|
+
The script automatically updates:
|
|
85
|
+
- `library.properties` (Arduino)
|
|
86
|
+
- `library.json` (PlatformIO)
|
|
87
|
+
- `package.json` (NPM)
|
|
88
|
+
|
|
89
|
+
## 🔧 NPM Publishing Details
|
|
90
|
+
|
|
91
|
+
### Dual Publishing Strategy
|
|
92
|
+
|
|
93
|
+
The release workflow publishes to **two NPM registries**:
|
|
94
|
+
|
|
95
|
+
1. **Public NPM** (npmjs.com)
|
|
96
|
+
- Package: `@alteriom/painlessmesh`
|
|
97
|
+
- Anyone can install: `npm install @alteriom/painlessmesh`
|
|
98
|
+
- No authentication required for installation
|
|
99
|
+
|
|
100
|
+
2. **GitHub Packages** (npm.pkg.github.com)
|
|
101
|
+
- Package: `@alteriom/painlessmesh`
|
|
102
|
+
- Scoped to Alteriom organization
|
|
103
|
+
- Requires authentication for installation
|
|
104
|
+
|
|
105
|
+
### Installation Methods
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Public NPM (recommended for users)
|
|
109
|
+
npm install @alteriom/painlessmesh
|
|
110
|
+
|
|
111
|
+
# GitHub Packages (for Alteriom team/authenticated users)
|
|
112
|
+
echo '@alteriom:registry=https://npm.pkg.github.com' >> .npmrc
|
|
113
|
+
npm install @alteriom/painlessmesh
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## 📚 Wiki Publishing
|
|
117
|
+
|
|
118
|
+
### Automatic Synchronization
|
|
119
|
+
|
|
120
|
+
The wiki is automatically updated with each release:
|
|
121
|
+
|
|
122
|
+
- **Home Page** - Generated from README.md
|
|
123
|
+
- **Release Guide** - From RELEASE_GUIDE.md
|
|
124
|
+
- **Changelog** - From CHANGELOG.md
|
|
125
|
+
- **Examples** - Auto-generated from examples directory
|
|
126
|
+
- **API Reference** - Generated documentation pages
|
|
127
|
+
- **CI/CD Pipeline** - Automated documentation
|
|
128
|
+
|
|
129
|
+
### Manual Wiki Override
|
|
130
|
+
|
|
131
|
+
If needed, you can manually update the wiki:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Clone wiki repository
|
|
135
|
+
git clone https://github.com/Alteriom/painlessMesh.wiki.git
|
|
136
|
+
|
|
137
|
+
# Edit markdown files
|
|
138
|
+
# Commit and push changes
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 🛠️ Arduino Library Manager Submission
|
|
142
|
+
|
|
143
|
+
### One-Time Setup (Required)
|
|
144
|
+
|
|
145
|
+
After your first release, submit to Arduino Library Manager:
|
|
146
|
+
|
|
147
|
+
1. Go to: https://github.com/arduino/library-registry
|
|
148
|
+
2. Create a new issue with the following template:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Title: Add painlessMesh library
|
|
152
|
+
|
|
153
|
+
Body:
|
|
154
|
+
Repository URL: https://github.com/Alteriom/painlessMesh
|
|
155
|
+
Release tag: v1.6.0
|
|
156
|
+
Library name: painlessMesh
|
|
157
|
+
Version: 1.6.0
|
|
158
|
+
|
|
159
|
+
This is the Alteriom fork of the painlessMesh library with enhanced
|
|
160
|
+
CI/CD, automated releases, and improved Arduino Library Manager compatibility.
|
|
161
|
+
Includes SensorPackage, CommandPackage, and StatusPackage extensions.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
3. Monitor the issue for Arduino team approval
|
|
165
|
+
4. Once approved, all future releases are automatically indexed
|
|
166
|
+
|
|
167
|
+
## 🔍 Validation Scripts
|
|
168
|
+
|
|
169
|
+
### Pre-Release Validation
|
|
170
|
+
```bash
|
|
171
|
+
# Comprehensive validation
|
|
172
|
+
./scripts/validate-release.sh
|
|
173
|
+
|
|
174
|
+
# Check version consistency
|
|
175
|
+
./scripts/bump-version.sh --verify
|
|
176
|
+
|
|
177
|
+
# Test library compilation
|
|
178
|
+
npm run build
|
|
179
|
+
npm run test
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Release Monitoring
|
|
183
|
+
```bash
|
|
184
|
+
# Check GitHub Actions status
|
|
185
|
+
# Visit: https://github.com/Alteriom/painlessMesh/actions
|
|
186
|
+
|
|
187
|
+
# Verify NPM publication
|
|
188
|
+
npm view @alteriom/painlessmesh version
|
|
189
|
+
|
|
190
|
+
# Check GitHub Packages
|
|
191
|
+
# Visit: https://github.com/Alteriom/painlessMesh/packages
|
|
192
|
+
|
|
193
|
+
# Verify wiki update
|
|
194
|
+
# Visit: https://github.com/Alteriom/painlessMesh/wiki
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## 🚨 Troubleshooting
|
|
198
|
+
|
|
199
|
+
### Common Issues
|
|
200
|
+
|
|
201
|
+
**Version Mismatch Error**
|
|
202
|
+
```bash
|
|
203
|
+
# Fix version inconsistencies
|
|
204
|
+
./scripts/bump-version.sh patch 1.6.1 # Force set version
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**NPM Publication Failure**
|
|
208
|
+
```bash
|
|
209
|
+
# Check NPM token is valid
|
|
210
|
+
npm whoami
|
|
211
|
+
|
|
212
|
+
# Verify package.json configuration
|
|
213
|
+
npm run validate-library
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
**GitHub Packages Authentication**
|
|
217
|
+
```bash
|
|
218
|
+
# Verify GitHub token has packages:write permission
|
|
219
|
+
# Check repository settings → Actions → General → Permissions
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Wiki Update Failure**
|
|
223
|
+
```bash
|
|
224
|
+
# Wiki may need to be manually initialized
|
|
225
|
+
# Go to: https://github.com/Alteriom/painlessMesh/wiki
|
|
226
|
+
# Create any page to initialize wiki, then re-run release
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Manual Override
|
|
230
|
+
|
|
231
|
+
If automation fails, you can manually perform any step:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Manual NPM publish
|
|
235
|
+
npm publish --access public
|
|
236
|
+
|
|
237
|
+
# Manual GitHub release
|
|
238
|
+
gh release create v1.6.1 --title "painlessMesh v1.6.1" --notes-file CHANGELOG.md
|
|
239
|
+
|
|
240
|
+
# Manual tag creation
|
|
241
|
+
git tag v1.6.1
|
|
242
|
+
git push origin v1.6.1
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## 📊 Release Success Indicators
|
|
246
|
+
|
|
247
|
+
### Successful Release Shows:
|
|
248
|
+
- ✅ GitHub release created with changelog
|
|
249
|
+
- ✅ Git tag pushed to repository
|
|
250
|
+
- ✅ NPM package published (check npmjs.com)
|
|
251
|
+
- ✅ GitHub Packages updated
|
|
252
|
+
- ✅ Wiki pages synchronized
|
|
253
|
+
- ✅ All GitHub Actions workflows completed
|
|
254
|
+
|
|
255
|
+
### Distribution Verification:
|
|
256
|
+
```bash
|
|
257
|
+
# NPM
|
|
258
|
+
npm view @alteriom/painlessmesh
|
|
259
|
+
|
|
260
|
+
# GitHub Packages
|
|
261
|
+
npm view @alteriom/painlessmesh --registry=https://npm.pkg.github.com
|
|
262
|
+
|
|
263
|
+
# PlatformIO (updated within 24 hours)
|
|
264
|
+
# Check: https://registry.platformio.org/libraries/alteriom/painlessMesh
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## 🎉 Success!
|
|
268
|
+
|
|
269
|
+
Once your release is complete, the library will be available through:
|
|
270
|
+
- GitHub Releases
|
|
271
|
+
- NPM (public + GitHub Packages)
|
|
272
|
+
- PlatformIO Registry (automatic)
|
|
273
|
+
- Arduino Library Manager (after initial submission)
|
|
274
|
+
- GitHub Wiki (documentation)
|
|
275
|
+
|
|
276
|
+
All future releases follow the same simple process - just bump version, update changelog, commit with "release:" prefix, and push!
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
**Questions?** Create an issue with the `ci/cd` label for release process support.
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Missing #include <vector> Fix
|
|
2
|
+
|
|
3
|
+
## Issue
|
|
4
|
+
|
|
5
|
+
Compilation errors when building projects that use AlteriomPainlessMesh:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
error: 'vector' in namespace 'std' does not name a template type
|
|
9
|
+
std::vector<ConnectionInfo> getConnectionDetails() {
|
|
10
|
+
^~~~~~
|
|
11
|
+
note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Root Cause
|
|
15
|
+
|
|
16
|
+
The file `src/painlessmesh/mesh.hpp` uses `std::vector` but was missing the required include:
|
|
17
|
+
|
|
18
|
+
```cpp
|
|
19
|
+
#include <vector>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This caused compilation failures in any code that included `painlessMesh.h`.
|
|
23
|
+
|
|
24
|
+
## Files Affected
|
|
25
|
+
|
|
26
|
+
- `src/painlessmesh/mesh.hpp` - Uses `std::vector<ConnectionInfo>` at line 386
|
|
27
|
+
- `src/painlessmesh/mesh.hpp` - Uses `std::vector<uint32_t>` at line 594
|
|
28
|
+
|
|
29
|
+
## Fix Applied
|
|
30
|
+
|
|
31
|
+
Added `#include <vector>` to the top of `src/painlessmesh/mesh.hpp`:
|
|
32
|
+
|
|
33
|
+
```cpp
|
|
34
|
+
#ifndef _PAINLESS_MESH_MESH_HPP_
|
|
35
|
+
#define _PAINLESS_MESH_MESH_HPP_
|
|
36
|
+
|
|
37
|
+
#include <vector> // ← ADDED THIS LINE
|
|
38
|
+
|
|
39
|
+
#include "painlessmesh/configuration.hpp"
|
|
40
|
+
// ... rest of includes
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Why This Wasn't Caught Earlier
|
|
44
|
+
|
|
45
|
+
This is a common C++ compilation issue where:
|
|
46
|
+
1. Sometimes the `<vector>` header gets transitively included by other headers
|
|
47
|
+
2. Works on some compilers/platforms but not others
|
|
48
|
+
3. Depends on which headers are included first in your project
|
|
49
|
+
4. May work in the library's test environment but fail in user projects
|
|
50
|
+
|
|
51
|
+
## Testing
|
|
52
|
+
|
|
53
|
+
After this fix, the following should compile successfully:
|
|
54
|
+
|
|
55
|
+
```cpp
|
|
56
|
+
#include <Arduino.h>
|
|
57
|
+
#include <painlessMesh.h>
|
|
58
|
+
|
|
59
|
+
Scheduler userScheduler;
|
|
60
|
+
painlessMesh mesh;
|
|
61
|
+
|
|
62
|
+
void setup() {
|
|
63
|
+
Serial.begin(115200);
|
|
64
|
+
mesh.init("TestMesh", "password", &userScheduler, 5555);
|
|
65
|
+
|
|
66
|
+
// This function uses std::vector internally
|
|
67
|
+
auto connections = mesh.getConnectionDetails();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void loop() {
|
|
71
|
+
mesh.update();
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## For Users
|
|
76
|
+
|
|
77
|
+
To get the fix:
|
|
78
|
+
|
|
79
|
+
1. **Clean your build:**
|
|
80
|
+
```bash
|
|
81
|
+
pio run --target clean
|
|
82
|
+
rm -rf .pio
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
2. **Update library:**
|
|
86
|
+
```bash
|
|
87
|
+
pio pkg update
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. **Rebuild:**
|
|
91
|
+
```bash
|
|
92
|
+
pio run
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The library will be re-downloaded from GitHub with the fix included.
|
|
96
|
+
|
|
97
|
+
## Verification
|
|
98
|
+
|
|
99
|
+
Your build output should change from:
|
|
100
|
+
|
|
101
|
+
**Before (ERROR):**
|
|
102
|
+
```
|
|
103
|
+
error: 'vector' in namespace 'std' does not name a template type
|
|
104
|
+
*** [.pio/build/universal-sensor/libb89/AlteriomPainlessMesh/painlessMeshSTA.cpp.o] Error 1
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**After (SUCCESS):**
|
|
108
|
+
```
|
|
109
|
+
Building .pio/build/universal-sensor/libb89/AlteriomPainlessMesh/painlessMeshSTA.cpp.o
|
|
110
|
+
Building .pio/build/universal-sensor/libb89/AlteriomPainlessMesh/wifi.cpp.o
|
|
111
|
+
Linking .pio/build/universal-sensor/firmware.elf
|
|
112
|
+
SUCCESS
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Related Fixes
|
|
116
|
+
|
|
117
|
+
This is part of a series of library structure fixes:
|
|
118
|
+
1. ✅ Added `srcDir` and `includeDir` to library.json
|
|
119
|
+
2. ✅ Removed conflicting `export.include` section
|
|
120
|
+
3. ✅ Fixed header references in library.properties
|
|
121
|
+
4. ✅ **Added missing `#include <vector>` to mesh.hpp** ← This fix
|
|
122
|
+
|
|
123
|
+
## Date
|
|
124
|
+
|
|
125
|
+
October 15, 2025
|
|
126
|
+
|
|
127
|
+
## Status
|
|
128
|
+
|
|
129
|
+
✅ FIXED - Ready for use
|