@alteriom/painlessmesh 1.10.0 → 2.0.1
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/BRIDGE_TO_INTERNET.md +167 -29
- package/CHANGELOG.md +542 -0
- package/CONTRIBUTING.md +56 -53
- package/README.md +102 -95
- package/RELEASE_GUIDE.md +94 -788
- package/examples/alteriom/README.md +8 -10
- package/examples/alteriom/alteriom.ino +2 -2
- package/examples/alteriom/alteriom_sensor_package.hpp +17 -11
- package/examples/alteriom/mppt_example/alteriom_custom_package_template.hpp +320 -0
- package/examples/alteriom/mppt_example/alteriom_sensor_package.hpp +1389 -0
- package/examples/alteriom/mppt_example/{alteriom_mppt_example.ino → mppt_example.ino} +4 -0
- package/examples/basic/test/simulator/README.md +3 -3
- package/examples/bridge_failover/README.md +51 -14
- package/examples/commandControl/commandControl.ino +86 -0
- package/examples/commandControl/platformio.ini +26 -0
- package/examples/mqttBridge/mqttBridge.ino +4 -0
- package/examples/mqttBridge/platformio.ini +1 -1
- package/examples/otaSender/otaSender.ino +5 -1
- package/examples/priority/README.md +1 -1
- package/examples/priority/{priority_basic_example.ino → priority_basic_example/priority_basic_example.ino} +4 -4
- package/examples/priority/{priority_with_queue.ino → priority_with_queue/priority_with_queue.ino} +20 -2
- package/examples/reliableSensorLogging/platformio.ini +26 -0
- package/examples/reliableSensorLogging/reliableSensorLogging.ino +151 -0
- package/examples/sendToInternet/README.md +12 -5
- package/examples/sendToInternet/{CMakeLists.txt → pc_node/CMakeLists.txt} +7 -7
- package/examples/sendToInternet/{PC_NODE_README.md → pc_node/PC_NODE_README.md} +15 -15
- package/examples/sendToInternet/{build.sh → pc_node/build.sh} +5 -5
- package/examples/sendToInternet/{pc_mesh_node.cpp → pc_node/pc_mesh_node.cpp} +12 -1
- package/examples/sendToInternet/platformio.ini +2 -2
- package/examples/sharedGateway/README.md +1 -2
- package/keywords.txt +50 -1
- package/library.json +8 -6
- package/library.properties +2 -2
- package/package.json +3 -3
- package/src/AlteriomPainlessMesh.h +4 -4
- package/src/arduino/wifi.hpp +556 -126
- package/src/painlessMesh.h +2 -2
- package/src/painlessMeshSTA.cpp +607 -87
- package/src/painlessMeshSTA.h +135 -3
- package/src/painlessmesh/ack.hpp +283 -0
- package/src/painlessmesh/buffer.hpp +70 -8
- package/src/painlessmesh/callback.hpp +38 -5
- package/src/painlessmesh/configuration.hpp +69 -1
- package/src/painlessmesh/connection.hpp +12 -5
- package/src/painlessmesh/gateway.hpp +270 -5
- package/src/painlessmesh/layout.hpp +70 -2
- package/src/painlessmesh/logger.hpp +15 -0
- package/src/painlessmesh/mesh.hpp +552 -48
- package/src/painlessmesh/ntp.hpp +2 -4
- package/src/painlessmesh/plugin.hpp +30 -6
- package/src/painlessmesh/protocol.hpp +55 -2
- package/src/painlessmesh/router.hpp +192 -77
- package/src/painlessmesh/tcp.hpp +10 -0
- package/src/painlessmesh/message_tracker.hpp +0 -311
- /package/examples/sendToInternet/{mock_server_test.ino → mock_server_test/mock_server_test.ino} +0 -0
|
@@ -6,7 +6,7 @@ This example provides a **PC-based mesh node** that can join a painlessMesh netw
|
|
|
6
6
|
|
|
7
7
|
### The Problem This Solves
|
|
8
8
|
|
|
9
|
-
Previous examples (
|
|
9
|
+
Previous examples (`../mock_server_test/mock_server_test.ino`) tested the bridge making HTTP requests directly, but did **NOT** test the complete flow:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
Regular Node → Mesh Network → Bridge → Internet → Bridge → Mesh Network → Regular Node
|
|
@@ -90,7 +90,7 @@ brew install cmake boost
|
|
|
90
90
|
For testing, start the mock HTTP server:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
cd
|
|
93
|
+
cd ../../../test/mock-http-server
|
|
94
94
|
python3 server.py
|
|
95
95
|
```
|
|
96
96
|
|
|
@@ -101,13 +101,13 @@ The server will run on `http://localhost:8080` by default.
|
|
|
101
101
|
### Quick Build (Using make)
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
cd examples/sendToInternet
|
|
104
|
+
cd examples/sendToInternet/pc_node
|
|
105
105
|
|
|
106
106
|
# Initialize dependencies (if not already done)
|
|
107
|
-
cd
|
|
107
|
+
cd ../../../test
|
|
108
108
|
git clone https://github.com/bblanchon/ArduinoJson.git
|
|
109
109
|
git clone https://github.com/arkhipenko/TaskScheduler
|
|
110
|
-
cd ../examples/sendToInternet
|
|
110
|
+
cd ../examples/sendToInternet/pc_node
|
|
111
111
|
|
|
112
112
|
# Build
|
|
113
113
|
cmake .
|
|
@@ -131,9 +131,9 @@ make
|
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
133
|
g++ -std=c++14 -o pc_mesh_node pc_mesh_node.cpp \
|
|
134
|
-
-I
|
|
135
|
-
-I
|
|
136
|
-
|
|
134
|
+
-I../../../src -I../../../test/include -I../../../test/ArduinoJson/src \
|
|
135
|
+
-I../../../test/TaskScheduler/src -I../../../test/boost \
|
|
136
|
+
../../../test/catch/fake_serial.cpp ../../../src/scheduler.cpp \
|
|
137
137
|
-lboost_system -pthread
|
|
138
138
|
```
|
|
139
139
|
|
|
@@ -371,14 +371,14 @@ brew install boost
|
|
|
371
371
|
#### "ArduinoJson not found"
|
|
372
372
|
|
|
373
373
|
```bash
|
|
374
|
-
cd
|
|
374
|
+
cd ../../../test
|
|
375
375
|
git clone https://github.com/bblanchon/ArduinoJson.git
|
|
376
376
|
```
|
|
377
377
|
|
|
378
378
|
#### "TaskScheduler not found"
|
|
379
379
|
|
|
380
380
|
```bash
|
|
381
|
-
cd
|
|
381
|
+
cd ../../../test
|
|
382
382
|
git clone https://github.com/arkhipenko/TaskScheduler
|
|
383
383
|
```
|
|
384
384
|
|
|
@@ -476,7 +476,7 @@ python3 test/mock-http-server/server.py &
|
|
|
476
476
|
SERVER_PID=$!
|
|
477
477
|
|
|
478
478
|
# Build PC node
|
|
479
|
-
cd examples/sendToInternet
|
|
479
|
+
cd examples/sendToInternet/pc_node
|
|
480
480
|
cmake . && make
|
|
481
481
|
|
|
482
482
|
# Run test (assuming bridge is running at known IP)
|
|
@@ -501,10 +501,10 @@ kill $SERVER_PID
|
|
|
501
501
|
|
|
502
502
|
## Related Documentation
|
|
503
503
|
|
|
504
|
-
- [sendToInternet Example](sendToInternet.ino) - ESP32/ESP8266 example
|
|
505
|
-
- [Mock HTTP Server](
|
|
506
|
-
- [Bridge Documentation](
|
|
507
|
-
- [Testing Guide](
|
|
504
|
+
- [sendToInternet Example](../sendToInternet.ino) - ESP32/ESP8266 example
|
|
505
|
+
- [Mock HTTP Server](../../../test/mock-http-server/README.md) - Testing endpoint
|
|
506
|
+
- [Bridge Documentation](../../../BRIDGE_TO_INTERNET.md) - Bridge setup guide
|
|
507
|
+
- [Testing Guide](../../../test/mock-http-server/TESTING_GUIDE.md) - Complete testing workflow
|
|
508
508
|
|
|
509
509
|
## Credits
|
|
510
510
|
|
|
@@ -73,10 +73,10 @@ echo " - Windows: See https://www.boost.org/"
|
|
|
73
73
|
echo ""
|
|
74
74
|
echo "Checking test dependencies..."
|
|
75
75
|
|
|
76
|
-
if [ ! -d "
|
|
76
|
+
if [ ! -d "../../../test/ArduinoJson/src" ]; then
|
|
77
77
|
echo "⚠️ ArduinoJson not found"
|
|
78
78
|
echo " Cloning ArduinoJson..."
|
|
79
|
-
cd
|
|
79
|
+
cd ../../../test
|
|
80
80
|
if [ -d "ArduinoJson" ]; then
|
|
81
81
|
rm -rf ArduinoJson
|
|
82
82
|
fi
|
|
@@ -86,10 +86,10 @@ else
|
|
|
86
86
|
echo "✓ ArduinoJson found"
|
|
87
87
|
fi
|
|
88
88
|
|
|
89
|
-
if [ ! -d "
|
|
89
|
+
if [ ! -d "../../../test/TaskScheduler/src" ]; then
|
|
90
90
|
echo "⚠️ TaskScheduler not found"
|
|
91
91
|
echo " Cloning TaskScheduler..."
|
|
92
|
-
cd
|
|
92
|
+
cd ../../../test
|
|
93
93
|
if [ -d "TaskScheduler" ]; then
|
|
94
94
|
rm -rf TaskScheduler
|
|
95
95
|
fi
|
|
@@ -135,7 +135,7 @@ if make 2>&1; then
|
|
|
135
135
|
echo ""
|
|
136
136
|
echo "Next steps:"
|
|
137
137
|
echo " 1. Start mock HTTP server:"
|
|
138
|
-
echo " cd
|
|
138
|
+
echo " cd ../../../test/mock-http-server && python3 server.py"
|
|
139
139
|
echo ""
|
|
140
140
|
echo " 2. Configure and upload bridge to ESP32/ESP8266"
|
|
141
141
|
echo " (see sendToInternet.ino with IS_BRIDGE_NODE=true)"
|
|
@@ -38,6 +38,15 @@
|
|
|
38
38
|
* - 5555 is the TCP port the bridge is listening on (MESH_PORT)
|
|
39
39
|
**/
|
|
40
40
|
|
|
41
|
+
// This is a PC-side (desktop) program: it needs Boost and the Arduino
|
|
42
|
+
// emulation layer under test/, neither of which exists for an embedded
|
|
43
|
+
// target. Both the Arduino IDE and arduino-cli compile *every* .cpp in a
|
|
44
|
+
// sketch folder, so without this guard they try to build this file for the
|
|
45
|
+
// ESP and fail on <boost/asio/ip/address.hpp>. ARDUINO is defined by every
|
|
46
|
+
// Arduino toolchain, so the whole file collapses to an empty translation
|
|
47
|
+
// unit there and is left to the CMake/g++ build described above.
|
|
48
|
+
#ifndef ARDUINO
|
|
49
|
+
|
|
41
50
|
#include <iostream>
|
|
42
51
|
#include <string>
|
|
43
52
|
#include <memory>
|
|
@@ -356,6 +365,8 @@ int main(int argc, char* argv[]) {
|
|
|
356
365
|
node.runUpdateLoop(10);
|
|
357
366
|
|
|
358
367
|
std::cout << "\n✓ PC Mesh Node shutting down..." << std::endl;
|
|
359
|
-
|
|
368
|
+
|
|
360
369
|
return 0;
|
|
361
370
|
}
|
|
371
|
+
|
|
372
|
+
#endif // !ARDUINO
|
|
@@ -9,7 +9,7 @@ platform = espressif32
|
|
|
9
9
|
board = esp32dev
|
|
10
10
|
framework = arduino
|
|
11
11
|
lib_deps =
|
|
12
|
-
|
|
12
|
+
sparck75/AlteriomPainlessMesh
|
|
13
13
|
bblanchon/ArduinoJson@^7.0.0
|
|
14
14
|
monitor_speed = 115200
|
|
15
15
|
|
|
@@ -18,6 +18,6 @@ platform = espressif8266
|
|
|
18
18
|
board = nodemcuv2
|
|
19
19
|
framework = arduino
|
|
20
20
|
lib_deps =
|
|
21
|
-
|
|
21
|
+
sparck75/AlteriomPainlessMesh
|
|
22
22
|
bblanchon/ArduinoJson@^7.0.0
|
|
23
23
|
monitor_speed = 115200
|
|
@@ -225,8 +225,7 @@ WiFi.channel()
|
|
|
225
225
|
|
|
226
226
|
## Related Documentation
|
|
227
227
|
|
|
228
|
-
- [
|
|
229
|
-
- [Bridge Mode Example](../bridge/README.md)
|
|
228
|
+
- [Bridge Mode Example](../bridge/bridge.ino)
|
|
230
229
|
- [Bridge Failover Example](../bridge_failover/README.md)
|
|
231
230
|
- [painlessMesh Documentation](https://gitlab.com/painlessMesh/painlessMesh/-/wikis/home)
|
|
232
231
|
|
package/keywords.txt
CHANGED
|
@@ -5,6 +5,7 @@ painlessMesh KEYWORD1
|
|
|
5
5
|
Scheduler KEYWORD1
|
|
6
6
|
Task KEYWORD1
|
|
7
7
|
TcpRetryConfig KEYWORD1
|
|
8
|
+
SendOptions KEYWORD1
|
|
8
9
|
|
|
9
10
|
# Methods and Functions (KEYWORD2)
|
|
10
11
|
init KEYWORD2
|
|
@@ -19,13 +20,57 @@ getNodeList KEYWORD2
|
|
|
19
20
|
getNodeId KEYWORD2
|
|
20
21
|
getNodeTime KEYWORD2
|
|
21
22
|
setDebugMsgTypes KEYWORD2
|
|
23
|
+
checkAcks KEYWORD2
|
|
24
|
+
pendingAcks KEYWORD2
|
|
22
25
|
setTcpRetryConfig KEYWORD2
|
|
23
26
|
getTcpRetryConfig KEYWORD2
|
|
27
|
+
stop KEYWORD2
|
|
28
|
+
isConnected KEYWORD2
|
|
29
|
+
subConnectionJson KEYWORD2
|
|
30
|
+
startDelayMeas KEYWORD2
|
|
31
|
+
onNodeDelayReceived KEYWORD2
|
|
32
|
+
setRoot KEYWORD2
|
|
33
|
+
setContainsRoot KEYWORD2
|
|
34
|
+
isRoot KEYWORD2
|
|
35
|
+
stationManual KEYWORD2
|
|
36
|
+
setHostname KEYWORD2
|
|
37
|
+
initAsBridge KEYWORD2
|
|
38
|
+
initAsSharedGateway KEYWORD2
|
|
39
|
+
isBridge KEYWORD2
|
|
40
|
+
setRouterCredentials KEYWORD2
|
|
41
|
+
enableBridgeFailover KEYWORD2
|
|
42
|
+
onBridgeRoleChanged KEYWORD2
|
|
43
|
+
onBridgeStatusChanged KEYWORD2
|
|
44
|
+
onGatewayChanged KEYWORD2
|
|
45
|
+
setElectionStartupDelay KEYWORD2
|
|
46
|
+
setElectionRandomDelay KEYWORD2
|
|
47
|
+
setElectionTimeout KEYWORD2
|
|
48
|
+
setMinimumBridgeRSSI KEYWORD2
|
|
49
|
+
setBridgeStatusInterval KEYWORD2
|
|
50
|
+
setBridgeTimeout KEYWORD2
|
|
51
|
+
hasInternetConnection KEYWORD2
|
|
52
|
+
hasLocalInternet KEYWORD2
|
|
53
|
+
getBridges KEYWORD2
|
|
54
|
+
getPrimaryBridge KEYWORD2
|
|
55
|
+
getPrimaryGateway KEYWORD2
|
|
56
|
+
enableSendToInternet KEYWORD2
|
|
57
|
+
sendToInternet KEYWORD2
|
|
58
|
+
enableMessageQueue KEYWORD2
|
|
59
|
+
queueMessage KEYWORD2
|
|
60
|
+
flushMessageQueue KEYWORD2
|
|
61
|
+
getQueueStats KEYWORD2
|
|
62
|
+
initOTASend KEYWORD2
|
|
63
|
+
initOTAReceive KEYWORD2
|
|
64
|
+
overCapacity KEYWORD2
|
|
65
|
+
apChildren KEYWORD2
|
|
66
|
+
getTcpRetryConfig KEYWORD2
|
|
24
67
|
subConnectionJson KEYWORD2
|
|
25
68
|
asNodeTree KEYWORD2
|
|
26
69
|
|
|
27
70
|
# Alteriom Extensions (KEYWORD1)
|
|
28
71
|
SensorPackage KEYWORD1
|
|
72
|
+
MessageAckPackage KEYWORD1
|
|
73
|
+
deliveryCallback_t KEYWORD1
|
|
29
74
|
CommandPackage KEYWORD1
|
|
30
75
|
StatusPackage KEYWORD1
|
|
31
76
|
|
|
@@ -49,4 +94,8 @@ COMMUNICATION LITERAL1
|
|
|
49
94
|
GENERAL LITERAL1
|
|
50
95
|
MSG_TYPES LITERAL1
|
|
51
96
|
REMOTE LITERAL1
|
|
52
|
-
DEBUG LITERAL1
|
|
97
|
+
DEBUG LITERAL1
|
|
98
|
+
PRIORITY_CRITICAL LITERAL1
|
|
99
|
+
PRIORITY_HIGH LITERAL1
|
|
100
|
+
PRIORITY_NORMAL LITERAL1
|
|
101
|
+
PRIORITY_LOW LITERAL1
|
package/library.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/Alteriom/painlessMesh"
|
|
8
8
|
},
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "2.0.1",
|
|
10
10
|
"frameworks": [
|
|
11
11
|
"arduino"
|
|
12
12
|
],
|
|
@@ -87,13 +87,15 @@
|
|
|
87
87
|
"examples/namedMesh/namedMesh.ino",
|
|
88
88
|
"examples/otaReceiver/otaReceiver.ino",
|
|
89
89
|
"examples/otaSender/otaSender.ino",
|
|
90
|
-
"examples/alteriom/mppt_example/
|
|
91
|
-
"examples/priority/priority_basic_example.ino",
|
|
92
|
-
"examples/priority/priority_with_queue.ino",
|
|
93
|
-
"examples/sendToInternet/mock_server_test.ino",
|
|
90
|
+
"examples/alteriom/mppt_example/mppt_example.ino",
|
|
91
|
+
"examples/priority/priority_basic_example/priority_basic_example.ino",
|
|
92
|
+
"examples/priority/priority_with_queue/priority_with_queue.ino",
|
|
93
|
+
"examples/sendToInternet/mock_server_test/mock_server_test.ino",
|
|
94
94
|
"examples/sendToInternet/sendToInternet.ino",
|
|
95
95
|
"examples/sharedGateway/sharedGateway.ino",
|
|
96
96
|
"examples/startHere/startHere.ino",
|
|
97
|
-
"examples/webServer/webServer.ino"
|
|
97
|
+
"examples/webServer/webServer.ino",
|
|
98
|
+
"examples/commandControl/commandControl.ino",
|
|
99
|
+
"examples/reliableSensorLogging/reliableSensorLogging.ino"
|
|
98
100
|
]
|
|
99
101
|
}
|
package/library.properties
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
name=Alteriom PainlessMesh
|
|
2
|
-
version=
|
|
2
|
+
version=2.0.1
|
|
3
3
|
author=Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh,Alteriom
|
|
4
4
|
maintainer=Alteriom
|
|
5
5
|
sentence=A painless way to setup a mesh with ESP8266 and ESP32 devices with Alteriom extensions
|
|
@@ -8,4 +8,4 @@ category=Communication
|
|
|
8
8
|
url=https://github.com/Alteriom/painlessMesh
|
|
9
9
|
architectures=esp8266,esp32
|
|
10
10
|
includes=painlessMesh.h,AlteriomPainlessMesh.h
|
|
11
|
-
depends=ArduinoJson, TaskScheduler
|
|
11
|
+
depends=ArduinoJson, TaskScheduler, PubSubClient
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alteriom/painlessmesh",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arduino",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@alteriom/mqtt-schema": "^0.8.0",
|
|
43
43
|
"@eslint/js": "^10.0.1",
|
|
44
|
-
"ajv": "^8.
|
|
44
|
+
"ajv": "^8.20.0",
|
|
45
45
|
"ajv-formats": "^3.0.1",
|
|
46
|
-
"prettier": "^3.
|
|
46
|
+
"prettier": "^3.9.6"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"test": "run-parts --regex catch_ bin/ || echo 'Tests completed'",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
/**
|
|
30
30
|
* @brief AlteriomPainlessMesh library version information
|
|
31
31
|
*/
|
|
32
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION "
|
|
33
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_MAJOR
|
|
34
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_MINOR
|
|
35
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_PATCH
|
|
32
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION "2.0.1"
|
|
33
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_MAJOR 2
|
|
34
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_MINOR 0
|
|
35
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_PATCH 1
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @brief Library description and usage information
|