@alteriom/painlessmesh 1.8.15 → 1.9.0
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 +229 -0
- package/CHANGELOG.md +61 -1
- package/CONTRIBUTING.md +79 -0
- package/README.md +69 -144
- package/docs/README.md +1 -0
- package/docs/api/shared-gateway.md +1207 -0
- package/examples/bridge_failover/README.md +81 -0
- package/examples/bridge_failover/bridge_failover.ino +35 -4
- package/examples/sharedGateway/README.md +235 -0
- package/examples/{meshCommandNode → sharedGateway}/platformio.ini +3 -2
- package/examples/sharedGateway/sharedGateway.ino +303 -0
- package/library.json +3 -22
- package/library.properties +1 -1
- package/package.json +3 -6
- package/src/arduino/wifi.hpp +342 -4
- package/src/painlessmesh/gateway.hpp +2120 -0
- package/src/painlessmesh/mesh.hpp +1034 -6
- package/src/painlessmesh/message_tracker.hpp +311 -0
- package/src/painlessmesh/protocol.hpp +6 -0
- package/DOCUMENTATION_INDEX.md +0 -146
- package/RELEASE_NOTES_1.8.15.md +0 -160
- package/RELEASE_READINESS_PLAN.md +0 -323
- package/TESTING_WITH_SIMULATOR.md +0 -259
- package/docs/API_DESIGN_GUIDELINES.md +0 -414
- package/docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md +0 -331
- package/docs/BOOLEAN_NAMING_CONVENTION.md +0 -235
- package/docs/BRIDGE_FAILOVER.md +0 -512
- package/docs/BRIDGE_HEALTH_MONITORING.md +0 -293
- package/docs/BRIDGE_INITIALIZATION_FALLBACK.md +0 -357
- package/docs/CHANNEL_SYNCHRONIZATION.md +0 -209
- package/docs/CREATE_MISSING_RELEASES.md +0 -321
- package/docs/DOCUMENTATION_MIGRATION_PLAN.md +0 -176
- package/docs/FAQ_VERSION_NUMBERS.md +0 -152
- package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +0 -1062
- package/docs/MESH_TOPOLOGY_GUIDE.md +0 -992
- package/docs/MESH_TOPOLOGY_PROGRESS.md +0 -422
- package/docs/MQTT_BRIDGE_COMMANDS.md +0 -894
- package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +0 -324
- package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +0 -576
- package/docs/MQTT_SCHEMA_COMPLIANCE.md +0 -340
- package/docs/MQTT_SCHEMA_PROPOSALS.md +0 -446
- package/docs/MQTT_SCHEMA_REVIEW.md +0 -690
- package/docs/OTA_COMMANDS_REFERENCE.md +0 -554
- package/docs/PHASE1_GUIDE.md +0 -349
- package/docs/PHASE2_GUIDE.md +0 -543
- package/docs/QUICK_REFERENCE_VERSIONING.md +0 -127
- package/docs/RELEASE_AGENT_SUMMARY.md +0 -386
- package/docs/SCHEMA_VALIDATION_CHECKLIST.md +0 -222
- package/docs/SIMULATOR_TESTING.md +0 -408
- package/docs/VERSION_MANAGEMENT.md +0 -213
- package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +0 -166
- package/docs/archive/FEATURE_PROPOSALS.md +0 -337
- package/docs/archive/LIBRARY_JSON_FIX.md +0 -98
- package/docs/archive/LIBRARY_STRUCTURE_FIX.md +0 -215
- package/docs/archive/PHASE1_IMPLEMENTATION.md +0 -325
- package/docs/archive/PHASE2_IMPLEMENTATION.md +0 -567
- package/docs/archive/RELEASE_SUMMARY.md +0 -173
- package/docs/archive/SCONS_BUILD_FIX.md +0 -313
- package/docs/archive/TRIGGER_RELEASE.md +0 -280
- package/docs/archive/VECTOR_INCLUDE_FIX.md +0 -129
- package/docs/archive/ota-and-status-enhancements.md +0 -911
- package/docs/archive/ota-status-architecture-diagrams.md +0 -658
- package/docs/archive/ota-status-quick-reference.md +0 -284
- package/docs/design/.gitkeep +0 -1
- package/docs/design/STATION_CREDENTIALS_DESIGN.md +0 -182
- package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +0 -71
- package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +0 -1011
- package/docs/development/DOCKER_TESTING.md +0 -196
- package/docs/development/PLATFORMIO_USAGE.md +0 -180
- package/docs/development/TESTING_SUMMARY.md +0 -126
- package/docs/development/contributing.md +0 -301
- package/docs/development/documentation.md +0 -583
- package/docs/features/DIAGNOSTICS_API.md +0 -534
- package/docs/implementation/BRIDGE_ARCHITECTURE_IMPLEMENTATION.md +0 -340
- package/docs/implementation/BRIDGE_HEALTH_MONITORING_IMPLEMENTATION.md +0 -213
- package/docs/implementation/BRIDGE_STATUS_FEATURE.md +0 -635
- package/docs/implementation/DIAGNOSTICS_API_IMPLEMENTATION.md +0 -232
- package/docs/implementation/IMPLEMENTATION_COMPLETE.md +0 -228
- package/docs/implementation/IMPLEMENTATION_NTP_TIME_SYNC.md +0 -325
- package/docs/implementation/IMPLEMENTATION_SUMMARY.md +0 -316
- package/docs/implementation/MESSAGE_QUEUE_IMPLEMENTATION.md +0 -405
- package/docs/implementation/MULTI_BRIDGE_IMPLEMENTATION.md +0 -520
- package/docs/implementation/NTP_TIME_SYNC_FEATURE.md +0 -392
- package/docs/improvements/FUTURE_PROPOSALS.md +0 -1016
- package/docs/improvements/IMPLEMENTATION_HISTORY.md +0 -1091
- package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +0 -709
- package/docs/improvements/README.md +0 -212
- package/docs/internal/CUSTOM_AGENT_ANALYSIS.md +0 -391
- package/docs/internal/ISSUE_65_VERIFICATION.md +0 -947
- package/docs/internal/ISSUE_66_CLOSURE.md +0 -249
- package/docs/internal/ISSUE_66_STATUS.md +0 -316
- package/docs/internal/PR_SUMMARY.md +0 -315
- package/docs/internal/REVIEW_SUMMARY.md +0 -332
- package/docs/multi-bridge-setup.md +0 -1025
- package/docs/platformio-publishing.md +0 -255
- package/docs/platformio-setup-summary.md +0 -121
- package/docs/releases/ANNOUNCEMENT_v1.8.6.md +0 -63
- package/docs/releases/ANNOUNCEMENT_v1.8.7.md +0 -113
- package/docs/releases/BRIDGE_STATUS_SELF_REGISTRATION_FIX.md +0 -221
- package/docs/releases/FEATURE_HISTORY.md +0 -543
- package/docs/releases/GITHUB_RELEASE_v1.8.6.md +0 -71
- package/docs/releases/GITHUB_RELEASE_v1.8.7.md +0 -90
- package/docs/releases/PATCH_v1.7.2.md +0 -262
- package/docs/releases/PATCH_v1.7.3.md +0 -262
- package/docs/releases/PATCH_v1.7.4.md +0 -219
- package/docs/releases/PHASE1_SUMMARY.md +0 -246
- package/docs/releases/PHASE2_SUMMARY.md +0 -499
- package/docs/releases/PUBLISH_v1.8.0_INSTRUCTIONS.md +0 -163
- package/docs/releases/QUICK_START_RELEASES.md +0 -113
- package/docs/releases/RELEASE_CHECKLIST_1.8.10.md +0 -331
- package/docs/releases/RELEASE_CHECKLIST_1.8.9.md +0 -207
- package/docs/releases/RELEASE_CHECKLIST_v1.7.4.md +0 -253
- package/docs/releases/RELEASE_CHECKLIST_v1.7.5.md +0 -315
- package/docs/releases/RELEASE_CHECKLIST_v1.7.6.md +0 -389
- package/docs/releases/RELEASE_CHECKLIST_v1.8.0.md +0 -331
- package/docs/releases/RELEASE_CHECKLIST_v1.8.2.md +0 -309
- package/docs/releases/RELEASE_NOTES_1.7.0.md +0 -539
- package/docs/releases/RELEASE_NOTES_1.8.10.md +0 -239
- package/docs/releases/RELEASE_NOTES_1.8.9.md +0 -213
- package/docs/releases/RELEASE_NOTES_v1.8.0.md +0 -685
- package/docs/releases/RELEASE_NOTES_v1.8.1.md +0 -221
- package/docs/releases/RELEASE_NOTES_v1.8.2.md +0 -421
- package/docs/releases/RELEASE_NOTES_v1.8.3.md +0 -292
- package/docs/releases/RELEASE_NOTES_v1.8.4.md +0 -277
- package/docs/releases/RELEASE_NOTES_v1.8.6.md +0 -205
- package/docs/releases/RELEASE_NOTES_v1.8.7.md +0 -184
- package/docs/releases/RELEASE_PLAN_v1.7.6.md +0 -816
- package/docs/releases/RELEASE_SUMMARY_1.8.10.md +0 -193
- package/docs/releases/RELEASE_SUMMARY_v1.7.4.md +0 -276
- package/docs/releases/RELEASE_SUMMARY_v1.7.5.md +0 -322
- package/docs/releases/RELEASE_SUMMARY_v1.7.6.md +0 -436
- package/docs/releases/RELEASE_SUMMARY_v1.7.7.md +0 -391
- package/docs/releases/RELEASE_SUMMARY_v1.7.8.md +0 -523
- package/docs/releases/RELEASE_SUMMARY_v1.7.9.md +0 -542
- package/docs/troubleshooting/ARDUINO_IDE_VERSION_FIX_SUMMARY.md +0 -229
- package/docs/troubleshooting/ARDUINO_LIBRARY_NAME_FIX.md +0 -197
- package/docs/troubleshooting/CRASH_QUICK_REF.md +0 -93
- package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +0 -157
- package/docs/troubleshooting/FREERTOS_ASSERTION_FAILURE.md +0 -288
- package/docs/troubleshooting/FREERTOS_FIX_IMPLEMENTATION.md +0 -267
- package/docs/troubleshooting/NPM_PUBLISHING_ISSUE_SUMMARY.md +0 -110
- package/docs/troubleshooting/PAINLESSMESH_V1.7.4_COMPILATION_ISSUES.md +0 -547
- package/docs/troubleshooting/QUICK_FIX_FREERTOS.md +0 -164
- package/docs/troubleshooting/SENSOR_NODE_CONNECTION_CRASH.md +0 -264
- package/docs/troubleshooting/common-architecture-mistakes.md +0 -438
- package/docs/troubleshooting/internet-access-faq.md +0 -299
- package/docs/troubleshooting/station-reconnection-issues.md +0 -172
- package/docs/v1.7.7_MQTT_IMPROVEMENTS.md +0 -794
- package/docs/wiki/API-Reference.md +0 -246
- package/docs/wiki/Complete-Documentation.md +0 -123
- package/examples/alteriomImproved/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomImproved/improved_sensor_node.ino +0 -248
- package/examples/alteriomImproved/platformio.ini +0 -32
- package/examples/alteriomMetricsHealth/alteriom_sensor_package.hpp +0 -796
- package/examples/alteriomMetricsHealth/metrics_health_node.ino +0 -429
- package/examples/alteriomMetricsHealth/platformio.ini +0 -26
- package/examples/alteriomPhase1/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomPhase1/phase1_features.ino +0 -242
- package/examples/alteriomPhase1/platformio.ini +0 -26
- package/examples/alteriomPhase2/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomPhase2/phase2_features.ino +0 -186
- package/examples/alteriomPhase2/platformio.ini +0 -26
- package/examples/alteriomSensorNode/alteriom_sensor_node.ino +0 -186
- package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +0 -1227
- package/examples/alteriomSensorNode/platformio.ini +0 -26
- package/examples/bridge/alteriom_sensor_package.hpp +0 -1170
- package/examples/bridge/bridge_health_monitoring_example.ino +0 -188
- package/examples/bridge/enhanced_mqtt_bridge.hpp +0 -610
- package/examples/bridge/enhanced_mqtt_bridge_example.ino +0 -226
- package/examples/bridge/mesh_event_publisher.hpp +0 -253
- package/examples/bridge/mesh_topology_reporter.hpp +0 -303
- package/examples/bridge/mqtt_command_bridge.hpp +0 -459
- package/examples/bridge/mqtt_status_bridge.hpp +0 -519
- package/examples/bridgeAwareSensorNode/alteriom_sensor_package.hpp +0 -1227
- package/examples/bridgeAwareSensorNode/bridgeAwareSensorNode.ino +0 -342
- package/examples/bridgeAwareSensorNode/platformio.ini +0 -26
- package/examples/diagnosticsExample/diagnosticsExample.ino +0 -171
- package/examples/diagnosticsExample/platformio.ini +0 -26
- package/examples/echoNode/echoNode.ino +0 -33
- package/examples/echoNode/platformio.ini +0 -26
- package/examples/meshCommandNode/alteriom_sensor_package.hpp +0 -235
- package/examples/meshCommandNode/meshCommandNode.ino +0 -265
- package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +0 -235
- package/examples/mqttCommandBridge/mesh_event_publisher.hpp +0 -253
- package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +0 -303
- package/examples/mqttCommandBridge/mqttCommandBridge.ino +0 -254
- package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +0 -462
- package/examples/mqttCommandBridge/platformio.ini +0 -27
- package/examples/mqttStatusBridge/mqttStatusBridge.ino +0 -218
- package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +0 -522
- package/examples/mqttStatusBridge/platformio.ini +0 -27
- package/examples/mqttTopologyTest/README.md +0 -467
- package/examples/mqttTopologyTest/mqttTopologyTest.ino +0 -754
- package/examples/mqttTopologyTest/platformio.ini +0 -27
- package/examples/multi_bridge/README.md +0 -346
- package/examples/multi_bridge/primary_bridge.ino +0 -108
- package/examples/multi_bridge/regular_node.ino +0 -141
- package/examples/multi_bridge/secondary_bridge.ino +0 -123
- package/examples/ntpTimeSyncBridge/alteriom_sensor_package.hpp +0 -1383
- package/examples/ntpTimeSyncBridge/ntpTimeSyncBridge.ino +0 -86
- package/examples/ntpTimeSyncNode/alteriom_sensor_package.hpp +0 -1383
- package/examples/ntpTimeSyncNode/ntpTimeSyncNode.ino +0 -109
- package/examples/queued_alarms/README.md +0 -390
- package/examples/queued_alarms/queued_alarms.ino +0 -265
- package/examples/routing_demo/README.md +0 -172
- package/examples/routing_demo/routing_demo.ino +0 -102
- package/examples/rtcIntegration/README.md +0 -294
- package/examples/rtcIntegration/rtcIntegration.ino +0 -210
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
//************************************************************
|
|
2
|
-
// Bridge-Aware Sensor Node Example
|
|
3
|
-
//
|
|
4
|
-
// This example demonstrates how to use the bridge status
|
|
5
|
-
// callback feature to implement intelligent message queueing.
|
|
6
|
-
//
|
|
7
|
-
// Features:
|
|
8
|
-
// - Monitors bridge Internet connectivity status
|
|
9
|
-
// - Queues critical messages when Internet is unavailable
|
|
10
|
-
// - Automatically sends queued messages when Internet returns
|
|
11
|
-
// - Implements failover logic for multiple bridges
|
|
12
|
-
//
|
|
13
|
-
// Use case: Fish farm monitoring system that needs to ensure
|
|
14
|
-
// critical alarms are delivered even during Internet outages
|
|
15
|
-
//************************************************************
|
|
16
|
-
|
|
17
|
-
#include "painlessTaskOptions.h" // Must be first to configure TaskScheduler
|
|
18
|
-
#include <TaskScheduler.h> // Required for LDF to find TaskScheduler dependency
|
|
19
|
-
#include "alteriom_sensor_package.hpp"
|
|
20
|
-
#include "painlessMesh.h"
|
|
21
|
-
|
|
22
|
-
#define MESH_PREFIX "AlteriomMesh"
|
|
23
|
-
#define MESH_PASSWORD "somethingSneaky"
|
|
24
|
-
#define MESH_PORT 5555
|
|
25
|
-
|
|
26
|
-
Scheduler userScheduler;
|
|
27
|
-
painlessMesh mesh;
|
|
28
|
-
|
|
29
|
-
// Alteriom package handlers
|
|
30
|
-
using namespace alteriom;
|
|
31
|
-
|
|
32
|
-
// Message queue for offline mode
|
|
33
|
-
struct QueuedMessage {
|
|
34
|
-
uint32_t timestamp;
|
|
35
|
-
bool isCritical;
|
|
36
|
-
SensorPackage data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
std::vector<QueuedMessage> messageQueue;
|
|
40
|
-
const size_t MAX_QUEUE_SIZE = 100; // Prevent memory overflow
|
|
41
|
-
|
|
42
|
-
// Bridge connectivity tracking
|
|
43
|
-
bool internetAvailable = false;
|
|
44
|
-
uint32_t primaryBridgeId = 0;
|
|
45
|
-
|
|
46
|
-
// Simulation variables
|
|
47
|
-
float currentTemperature = 25.0;
|
|
48
|
-
float currentOxygenLevel = 7.5; // mg/L - critical threshold is 5.0
|
|
49
|
-
|
|
50
|
-
// Function prototypes
|
|
51
|
-
void sendSensorData();
|
|
52
|
-
void handleIncomingPackage(uint32_t from, String& msg);
|
|
53
|
-
void bridgeStatusCallback(uint32_t bridgeNodeId, bool hasInternet);
|
|
54
|
-
void checkCriticalConditions();
|
|
55
|
-
void flushMessageQueue();
|
|
56
|
-
void queueMessage(const SensorPackage& data, bool isCritical);
|
|
57
|
-
|
|
58
|
-
Task taskSendSensorData(30000, TASK_FOREVER, &sendSensorData);
|
|
59
|
-
Task taskCheckCritical(5000, TASK_FOREVER, &checkCriticalConditions);
|
|
60
|
-
|
|
61
|
-
void setup() {
|
|
62
|
-
Serial.begin(115200);
|
|
63
|
-
|
|
64
|
-
// Initialize mesh
|
|
65
|
-
mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
|
|
66
|
-
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
67
|
-
|
|
68
|
-
// Setup callbacks
|
|
69
|
-
mesh.onReceive(&handleIncomingPackage);
|
|
70
|
-
mesh.onBridgeStatusChanged(&bridgeStatusCallback);
|
|
71
|
-
|
|
72
|
-
mesh.onNewConnection([](uint32_t nodeId) {
|
|
73
|
-
Serial.printf("✓ New connection: %u\n", nodeId);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
mesh.onChangedConnections([]() {
|
|
77
|
-
Serial.println("ℹ Mesh connections changed");
|
|
78
|
-
|
|
79
|
-
// Check if we have a primary bridge
|
|
80
|
-
auto primaryBridge = mesh.getPrimaryBridge();
|
|
81
|
-
if (primaryBridge) {
|
|
82
|
-
Serial.printf(" Primary bridge: %u (RSSI: %d dBm, Internet: %s)\n",
|
|
83
|
-
primaryBridge->nodeId,
|
|
84
|
-
primaryBridge->routerRSSI,
|
|
85
|
-
primaryBridge->internetConnected ? "Yes" : "No");
|
|
86
|
-
} else {
|
|
87
|
-
Serial.println(" ⚠ No healthy bridges available");
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// Add tasks
|
|
92
|
-
userScheduler.addTask(taskSendSensorData);
|
|
93
|
-
taskSendSensorData.enable();
|
|
94
|
-
|
|
95
|
-
userScheduler.addTask(taskCheckCritical);
|
|
96
|
-
taskCheckCritical.enable();
|
|
97
|
-
|
|
98
|
-
Serial.println("═══════════════════════════════════════════");
|
|
99
|
-
Serial.println(" Bridge-Aware Sensor Node");
|
|
100
|
-
Serial.println(" Fish Farm Monitoring System");
|
|
101
|
-
Serial.println("═══════════════════════════════════════════");
|
|
102
|
-
Serial.printf(" Node ID: %u\n", mesh.getNodeId());
|
|
103
|
-
Serial.println(" Monitoring: Temperature, Dissolved Oxygen");
|
|
104
|
-
Serial.println(" Critical O₂ threshold: 5.0 mg/L");
|
|
105
|
-
Serial.println("═══════════════════════════════════════════\n");
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
void loop() {
|
|
109
|
-
mesh.update();
|
|
110
|
-
|
|
111
|
-
// Simulate sensor drift
|
|
112
|
-
static uint32_t lastSimUpdate = 0;
|
|
113
|
-
if (millis() - lastSimUpdate > 10000) {
|
|
114
|
-
// Randomly vary oxygen level (can go critical)
|
|
115
|
-
currentOxygenLevel += random(-20, 15) / 10.0;
|
|
116
|
-
currentOxygenLevel = constrain(currentOxygenLevel, 3.0, 9.0);
|
|
117
|
-
|
|
118
|
-
currentTemperature += random(-10, 10) / 10.0;
|
|
119
|
-
currentTemperature = constrain(currentTemperature, 20.0, 30.0);
|
|
120
|
-
|
|
121
|
-
lastSimUpdate = millis();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
void sendSensorData() {
|
|
126
|
-
// Create sensor package
|
|
127
|
-
SensorPackage sensorData;
|
|
128
|
-
sensorData.from = mesh.getNodeId();
|
|
129
|
-
sensorData.sensorId = mesh.getNodeId();
|
|
130
|
-
sensorData.timestamp = mesh.getNodeTime();
|
|
131
|
-
sensorData.temperature = currentTemperature;
|
|
132
|
-
sensorData.humidity = 65.0 + random(-50, 50) / 10.0; // Not critical for fish farm
|
|
133
|
-
sensorData.pressure = currentOxygenLevel; // Abuse pressure field for O₂ level
|
|
134
|
-
sensorData.batteryLevel = 85 + random(-10, 5);
|
|
135
|
-
|
|
136
|
-
// Determine if this is critical data (low oxygen)
|
|
137
|
-
bool isCritical = (currentOxygenLevel < 5.5); // Early warning threshold
|
|
138
|
-
|
|
139
|
-
if (internetAvailable) {
|
|
140
|
-
// Internet available - send immediately
|
|
141
|
-
JsonDocument doc;
|
|
142
|
-
JsonObject obj = doc.to<JsonObject>();
|
|
143
|
-
sensorData.addTo(std::move(obj));
|
|
144
|
-
|
|
145
|
-
String msg;
|
|
146
|
-
serializeJson(doc, msg);
|
|
147
|
-
mesh.sendBroadcast(msg);
|
|
148
|
-
|
|
149
|
-
Serial.printf("📤 Sent: T=%.1f°C, O₂=%.1f mg/L, Bat=%d%% %s\n",
|
|
150
|
-
sensorData.temperature,
|
|
151
|
-
currentOxygenLevel,
|
|
152
|
-
sensorData.batteryLevel,
|
|
153
|
-
isCritical ? "⚠ CRITICAL" : "");
|
|
154
|
-
} else {
|
|
155
|
-
// Internet offline - queue message
|
|
156
|
-
queueMessage(sensorData, isCritical);
|
|
157
|
-
|
|
158
|
-
Serial.printf("💾 Queued: T=%.1f°C, O₂=%.1f mg/L %s [Queue: %d/%d]\n",
|
|
159
|
-
sensorData.temperature,
|
|
160
|
-
currentOxygenLevel,
|
|
161
|
-
isCritical ? "⚠ CRITICAL" : "",
|
|
162
|
-
messageQueue.size(),
|
|
163
|
-
MAX_QUEUE_SIZE);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
void checkCriticalConditions() {
|
|
168
|
-
// Check for critical low oxygen
|
|
169
|
-
if (currentOxygenLevel < 5.0) {
|
|
170
|
-
Serial.printf("🚨 CRITICAL ALARM: Low Oxygen = %.1f mg/L!\n", currentOxygenLevel);
|
|
171
|
-
|
|
172
|
-
// Create critical alarm package
|
|
173
|
-
SensorPackage alarm;
|
|
174
|
-
alarm.from = mesh.getNodeId();
|
|
175
|
-
alarm.sensorId = mesh.getNodeId();
|
|
176
|
-
alarm.timestamp = mesh.getNodeTime();
|
|
177
|
-
alarm.temperature = currentTemperature;
|
|
178
|
-
alarm.pressure = currentOxygenLevel;
|
|
179
|
-
alarm.batteryLevel = 85;
|
|
180
|
-
|
|
181
|
-
if (internetAvailable) {
|
|
182
|
-
// Send immediately
|
|
183
|
-
JsonDocument doc;
|
|
184
|
-
JsonObject obj = doc.to<JsonObject>();
|
|
185
|
-
alarm.addTo(std::move(obj));
|
|
186
|
-
|
|
187
|
-
String msg;
|
|
188
|
-
serializeJson(doc, msg);
|
|
189
|
-
mesh.sendBroadcast(msg);
|
|
190
|
-
Serial.println(" ↪ Critical alarm sent immediately");
|
|
191
|
-
} else {
|
|
192
|
-
// Queue with high priority
|
|
193
|
-
queueMessage(alarm, true);
|
|
194
|
-
Serial.printf(" ↪ Critical alarm queued [Queue: %d/%d]\n",
|
|
195
|
-
messageQueue.size(), MAX_QUEUE_SIZE);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
void queueMessage(const SensorPackage& data, bool isCritical) {
|
|
201
|
-
if (messageQueue.size() >= MAX_QUEUE_SIZE) {
|
|
202
|
-
Serial.println("⚠ Queue full - dropping oldest message");
|
|
203
|
-
messageQueue.erase(messageQueue.begin());
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
QueuedMessage qMsg;
|
|
207
|
-
qMsg.timestamp = millis();
|
|
208
|
-
qMsg.isCritical = isCritical;
|
|
209
|
-
qMsg.data = data;
|
|
210
|
-
|
|
211
|
-
messageQueue.push_back(qMsg);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
void flushMessageQueue() {
|
|
215
|
-
if (messageQueue.empty()) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
Serial.printf("\n📤 Flushing message queue (%d messages)...\n", messageQueue.size());
|
|
220
|
-
|
|
221
|
-
size_t sentCount = 0;
|
|
222
|
-
size_t criticalCount = 0;
|
|
223
|
-
|
|
224
|
-
for (const auto& qMsg : messageQueue) {
|
|
225
|
-
JsonDocument doc;
|
|
226
|
-
JsonObject obj = doc.to<JsonObject>();
|
|
227
|
-
qMsg.data.addTo(std::move(obj));
|
|
228
|
-
|
|
229
|
-
String msg;
|
|
230
|
-
serializeJson(doc, msg);
|
|
231
|
-
mesh.sendBroadcast(msg);
|
|
232
|
-
|
|
233
|
-
sentCount++;
|
|
234
|
-
if (qMsg.isCritical) criticalCount++;
|
|
235
|
-
|
|
236
|
-
delay(100); // Small delay to avoid flooding
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
messageQueue.clear();
|
|
240
|
-
|
|
241
|
-
Serial.printf("✓ Queue flushed: %d messages (%d critical)\n\n",
|
|
242
|
-
sentCount, criticalCount);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
void bridgeStatusCallback(uint32_t bridgeNodeId, bool hasInternet) {
|
|
246
|
-
bool wasAvailable = internetAvailable;
|
|
247
|
-
internetAvailable = hasInternet;
|
|
248
|
-
primaryBridgeId = bridgeNodeId;
|
|
249
|
-
|
|
250
|
-
Serial.println("\n════════════════════════════════════════════");
|
|
251
|
-
if (hasInternet) {
|
|
252
|
-
Serial.printf("✓ Bridge %u: Internet CONNECTED\n", bridgeNodeId);
|
|
253
|
-
|
|
254
|
-
// Get bridge details
|
|
255
|
-
auto bridges = mesh.getBridges();
|
|
256
|
-
for (const auto& bridge : bridges) {
|
|
257
|
-
if (bridge.nodeId == bridgeNodeId) {
|
|
258
|
-
Serial.printf(" Router: %s (RSSI: %d dBm, Ch: %d)\n",
|
|
259
|
-
bridge.gatewayIP.c_str(),
|
|
260
|
-
bridge.routerRSSI,
|
|
261
|
-
bridge.routerChannel);
|
|
262
|
-
Serial.printf(" Bridge uptime: %u seconds\n", bridge.uptime / 1000);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// If Internet was restored, flush queued messages
|
|
267
|
-
if (!wasAvailable) {
|
|
268
|
-
Serial.println(" → Internet restored - processing queue");
|
|
269
|
-
flushMessageQueue();
|
|
270
|
-
}
|
|
271
|
-
} else {
|
|
272
|
-
Serial.printf("⚠ Bridge %u: Internet OFFLINE\n", bridgeNodeId);
|
|
273
|
-
Serial.println(" → Entering offline mode");
|
|
274
|
-
Serial.println(" → Critical alarms will be queued");
|
|
275
|
-
}
|
|
276
|
-
Serial.println("════════════════════════════════════════════\n");
|
|
277
|
-
|
|
278
|
-
// Show overall mesh status
|
|
279
|
-
if (mesh.hasInternetConnection()) {
|
|
280
|
-
Serial.println("✓ Mesh has Internet connectivity");
|
|
281
|
-
} else {
|
|
282
|
-
Serial.println("⚠ No Internet connectivity in mesh");
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Show all known bridges
|
|
286
|
-
auto bridges = mesh.getBridges();
|
|
287
|
-
if (!bridges.empty()) {
|
|
288
|
-
Serial.printf("Known bridges: %d\n", bridges.size());
|
|
289
|
-
for (const auto& bridge : bridges) {
|
|
290
|
-
Serial.printf(" - Bridge %u: %s (RSSI: %d dBm)\n",
|
|
291
|
-
bridge.nodeId,
|
|
292
|
-
bridge.internetConnected ? "Online" : "Offline",
|
|
293
|
-
bridge.routerRSSI);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
Serial.println();
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
void handleIncomingPackage(uint32_t from, String& msg) {
|
|
300
|
-
// Parse the JSON message
|
|
301
|
-
JsonDocument doc;
|
|
302
|
-
deserializeJson(doc, msg);
|
|
303
|
-
JsonObject obj = doc.as<JsonObject>();
|
|
304
|
-
|
|
305
|
-
// Check message type
|
|
306
|
-
uint8_t msgType = obj["type"];
|
|
307
|
-
|
|
308
|
-
switch (msgType) {
|
|
309
|
-
case 200: // SensorPackage
|
|
310
|
-
{
|
|
311
|
-
SensorPackage receivedSensor(obj);
|
|
312
|
-
Serial.printf("📥 Sensor from %u: T=%.1f°C, O₂=%.1f mg/L\n",
|
|
313
|
-
receivedSensor.from,
|
|
314
|
-
receivedSensor.temperature,
|
|
315
|
-
receivedSensor.pressure); // Using pressure for O₂
|
|
316
|
-
} break;
|
|
317
|
-
|
|
318
|
-
case 400: // CommandPackage
|
|
319
|
-
{
|
|
320
|
-
CommandPackage receivedCmd(obj);
|
|
321
|
-
if (receivedCmd.dest == mesh.getNodeId()) {
|
|
322
|
-
Serial.printf("📥 Command %d received\n", receivedCmd.command);
|
|
323
|
-
|
|
324
|
-
// Handle commands (e.g., request status, change thresholds)
|
|
325
|
-
if (receivedCmd.command == 3) {
|
|
326
|
-
// Data request - send immediately even if offline
|
|
327
|
-
sendSensorData();
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
} break;
|
|
331
|
-
|
|
332
|
-
case 610: // BridgeStatusPackage
|
|
333
|
-
// Handled automatically by mesh's internal callback
|
|
334
|
-
// But we can log that we received it
|
|
335
|
-
Serial.printf("📡 Bridge status update from %u\n", from);
|
|
336
|
-
break;
|
|
337
|
-
|
|
338
|
-
default:
|
|
339
|
-
// Unknown message type
|
|
340
|
-
break;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[platformio]
|
|
2
|
-
src_dir = .
|
|
3
|
-
|
|
4
|
-
[env]
|
|
5
|
-
lib_ldf_mode = deep+
|
|
6
|
-
lib_deps =
|
|
7
|
-
bblanchon/ArduinoJson
|
|
8
|
-
arkhipenko/TaskScheduler
|
|
9
|
-
|
|
10
|
-
[env:esp8266]
|
|
11
|
-
platform = espressif8266
|
|
12
|
-
board = nodemcuv2
|
|
13
|
-
framework = arduino
|
|
14
|
-
lib_extra_dirs = ../../ ; Load the local copy of painlessmesh. For your own example add painlessmesh to the lib_deps
|
|
15
|
-
lib_deps =
|
|
16
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
17
|
-
esp32async/ESPAsyncTCP@^2.0.0 ; Only for ESP8266
|
|
18
|
-
|
|
19
|
-
[env:esp32]
|
|
20
|
-
platform = espressif32
|
|
21
|
-
board = esp32dev
|
|
22
|
-
framework = arduino
|
|
23
|
-
lib_extra_dirs = ../../ ; Load the local copy of painlessmesh. For your own example add painlessmesh to the lib_deps
|
|
24
|
-
lib_deps =
|
|
25
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
26
|
-
esp32async/AsyncTCP
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* painlessMesh Diagnostics API Example
|
|
3
|
-
*
|
|
4
|
-
* This example demonstrates the enhanced diagnostics API for bridge operations.
|
|
5
|
-
* It shows how to:
|
|
6
|
-
* - Enable diagnostics tracking
|
|
7
|
-
* - Get bridge status information
|
|
8
|
-
* - Monitor election history
|
|
9
|
-
* - Test bridge connectivity
|
|
10
|
-
* - Generate diagnostic reports
|
|
11
|
-
* - Export topology for visualization
|
|
12
|
-
*
|
|
13
|
-
* Hardware: ESP32 or ESP8266
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* 1. Upload to multiple devices
|
|
17
|
-
* 2. Configure one device as a bridge (see bridgeExample)
|
|
18
|
-
* 3. Regular nodes will use this diagnostics API to monitor mesh health
|
|
19
|
-
* 4. Open Serial Monitor to see diagnostic information
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
#include "painlessMesh.h"
|
|
23
|
-
|
|
24
|
-
#define MESH_PREFIX "DiagnosticsMesh"
|
|
25
|
-
#define MESH_PASSWORD "diagnostic123"
|
|
26
|
-
#define MESH_PORT 5555
|
|
27
|
-
|
|
28
|
-
Scheduler userScheduler;
|
|
29
|
-
painlessMesh mesh;
|
|
30
|
-
|
|
31
|
-
// Task to periodically print diagnostics
|
|
32
|
-
Task taskPrintDiagnostics(30000, TASK_FOREVER, []() {
|
|
33
|
-
Serial.println("\n" + mesh.getDiagnosticReport());
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Task to test bridge connectivity
|
|
37
|
-
Task taskTestBridge(60000, TASK_FOREVER, []() {
|
|
38
|
-
Serial.println("\n=== Testing Bridge Connectivity ===");
|
|
39
|
-
auto result = mesh.testBridgeConnectivity();
|
|
40
|
-
|
|
41
|
-
if (result.success) {
|
|
42
|
-
Serial.printf("✓ Bridge test PASSED: %s\n", result.message.c_str());
|
|
43
|
-
Serial.printf(" Latency: %u ms\n", result.latencyMs);
|
|
44
|
-
Serial.printf(" Internet available: %s\n", result.internetReachable ? "Yes" : "No");
|
|
45
|
-
} else {
|
|
46
|
-
Serial.printf("✗ Bridge test FAILED: %s\n", result.message.c_str());
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Task to monitor bridge status
|
|
51
|
-
Task taskMonitorBridge(15000, TASK_FOREVER, []() {
|
|
52
|
-
auto status = mesh.getBridgeStatus();
|
|
53
|
-
|
|
54
|
-
Serial.println("\n=== Bridge Status ===");
|
|
55
|
-
Serial.printf("Node ID: %u\n", mesh.getNodeId());
|
|
56
|
-
Serial.printf("Role: %s\n", status.role.c_str());
|
|
57
|
-
Serial.printf("Is Bridge: %s\n", status.isBridge ? "Yes" : "No");
|
|
58
|
-
Serial.printf("Internet Connected: %s\n", status.internetConnected ? "Yes" : "No");
|
|
59
|
-
|
|
60
|
-
if (status.bridgeNodeId != 0) {
|
|
61
|
-
Serial.printf("Bridge Node: %u (RSSI: %d dBm)\n",
|
|
62
|
-
status.bridgeNodeId, status.bridgeRSSI);
|
|
63
|
-
Serial.printf("Time since bridge change: %u seconds\n",
|
|
64
|
-
status.timeSinceBridgeChange / 1000);
|
|
65
|
-
} else {
|
|
66
|
-
Serial.println("No bridge available");
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// Task to show election history
|
|
71
|
-
Task taskShowElections(120000, TASK_FOREVER, []() {
|
|
72
|
-
auto history = mesh.getElectionHistory();
|
|
73
|
-
|
|
74
|
-
if (history.size() > 0) {
|
|
75
|
-
Serial.println("\n=== Election History ===");
|
|
76
|
-
for (const auto& election : history) {
|
|
77
|
-
Serial.printf("Winner: %u (RSSI: %d dBm, %u candidates) - %s\n",
|
|
78
|
-
election.winnerNodeId, election.winnerRSSI,
|
|
79
|
-
election.candidateCount, election.reason.c_str());
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
// Task to export topology for visualization
|
|
85
|
-
Task taskExportTopology(300000, TASK_FOREVER, []() {
|
|
86
|
-
Serial.println("\n=== Mesh Topology (GraphViz DOT format) ===");
|
|
87
|
-
Serial.println(mesh.exportTopologyDOT());
|
|
88
|
-
Serial.println("Copy above to http://www.webgraphviz.com/ to visualize");
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
void receivedCallback(uint32_t from, String &msg) {
|
|
92
|
-
Serial.printf("Received from %u: %s\n", from, msg.c_str());
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
void newConnectionCallback(uint32_t nodeId) {
|
|
96
|
-
Serial.printf("New Connection: %u\n", nodeId);
|
|
97
|
-
|
|
98
|
-
// Get last bridge change when new node connects
|
|
99
|
-
auto event = mesh.getLastBridgeChange();
|
|
100
|
-
if (event.timestamp > 0) {
|
|
101
|
-
Serial.printf("Last bridge change: %u -> %u (%s)\n",
|
|
102
|
-
event.oldBridgeId, event.newBridgeId, event.reason.c_str());
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
void changedConnectionCallback() {
|
|
107
|
-
Serial.println("Connections changed");
|
|
108
|
-
Serial.printf("Mesh nodes: %d\n", mesh.getNodeList().size());
|
|
109
|
-
|
|
110
|
-
// Show Internet path for this node
|
|
111
|
-
auto path = mesh.getInternetPath(mesh.getNodeId());
|
|
112
|
-
if (path.size() > 0) {
|
|
113
|
-
Serial.print("Path to Internet: ");
|
|
114
|
-
for (auto nodeId : path) {
|
|
115
|
-
Serial.printf("%u -> ", nodeId);
|
|
116
|
-
}
|
|
117
|
-
Serial.println("Internet");
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
void bridgeStatusChangedCallback(uint32_t bridgeNodeId, bool hasInternet) {
|
|
122
|
-
Serial.printf("\n!!! Bridge Status Changed !!!\n");
|
|
123
|
-
Serial.printf("Bridge %u Internet: %s\n",
|
|
124
|
-
bridgeNodeId, hasInternet ? "Connected" : "Disconnected");
|
|
125
|
-
|
|
126
|
-
// Run immediate connectivity test
|
|
127
|
-
auto result = mesh.testBridgeConnectivity();
|
|
128
|
-
Serial.printf("Connectivity test: %s\n", result.message.c_str());
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
void setup() {
|
|
132
|
-
Serial.begin(115200);
|
|
133
|
-
|
|
134
|
-
Serial.println("\n\n=== painlessMesh Diagnostics Example ===");
|
|
135
|
-
Serial.println("Initializing mesh network...");
|
|
136
|
-
|
|
137
|
-
// Initialize mesh
|
|
138
|
-
mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
|
|
139
|
-
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
140
|
-
|
|
141
|
-
// Enable diagnostics tracking
|
|
142
|
-
Serial.println("Enabling diagnostics...");
|
|
143
|
-
mesh.enableDiagnostics(true);
|
|
144
|
-
|
|
145
|
-
// Setup callbacks
|
|
146
|
-
mesh.onReceive(&receivedCallback);
|
|
147
|
-
mesh.onNewConnection(&newConnectionCallback);
|
|
148
|
-
mesh.onChangedConnections(&changedConnectionCallback);
|
|
149
|
-
mesh.onBridgeStatusChanged(&bridgeStatusChangedCallback);
|
|
150
|
-
|
|
151
|
-
// Add diagnostic tasks
|
|
152
|
-
userScheduler.addTask(taskPrintDiagnostics);
|
|
153
|
-
userScheduler.addTask(taskTestBridge);
|
|
154
|
-
userScheduler.addTask(taskMonitorBridge);
|
|
155
|
-
userScheduler.addTask(taskShowElections);
|
|
156
|
-
userScheduler.addTask(taskExportTopology);
|
|
157
|
-
|
|
158
|
-
// Enable tasks
|
|
159
|
-
taskPrintDiagnostics.enable();
|
|
160
|
-
taskTestBridge.enable();
|
|
161
|
-
taskMonitorBridge.enable();
|
|
162
|
-
taskShowElections.enable();
|
|
163
|
-
taskExportTopology.enable();
|
|
164
|
-
|
|
165
|
-
Serial.println("Setup complete!");
|
|
166
|
-
Serial.printf("Node ID: %u\n", mesh.getNodeId());
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
void loop() {
|
|
170
|
-
mesh.update();
|
|
171
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[platformio]
|
|
2
|
-
src_dir = .
|
|
3
|
-
|
|
4
|
-
[env]
|
|
5
|
-
lib_deps =
|
|
6
|
-
bblanchon/ArduinoJson
|
|
7
|
-
arkhipenko/TaskScheduler
|
|
8
|
-
|
|
9
|
-
lib_ldf_mode = deep+
|
|
10
|
-
[env:esp8266]
|
|
11
|
-
platform = espressif8266
|
|
12
|
-
board = nodemcuv2
|
|
13
|
-
framework = arduino
|
|
14
|
-
lib_extra_dirs = ../../
|
|
15
|
-
lib_deps =
|
|
16
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
17
|
-
esp32async/ESPAsyncTCP@^2.0.0 ; Only for ESP8266
|
|
18
|
-
|
|
19
|
-
[env:esp32]
|
|
20
|
-
platform = espressif32
|
|
21
|
-
board = esp32dev
|
|
22
|
-
framework = arduino
|
|
23
|
-
lib_extra_dirs = ../../
|
|
24
|
-
lib_deps =
|
|
25
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
26
|
-
esp32async/AsyncTCP
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//************************************************************
|
|
2
|
-
// this is a simple example that uses the painlessMesh library and echos any
|
|
3
|
-
// messages it receives
|
|
4
|
-
//
|
|
5
|
-
//************************************************************
|
|
6
|
-
#include "painlessMesh.h"
|
|
7
|
-
|
|
8
|
-
#define MESH_PREFIX "whateverYouLike"
|
|
9
|
-
#define MESH_PASSWORD "somethingSneaky"
|
|
10
|
-
#define MESH_PORT 5555
|
|
11
|
-
|
|
12
|
-
// Prototypes
|
|
13
|
-
void receivedCallback( uint32_t from, String &msg );
|
|
14
|
-
|
|
15
|
-
painlessMesh mesh;
|
|
16
|
-
|
|
17
|
-
void setup() {
|
|
18
|
-
Serial.begin(115200);
|
|
19
|
-
|
|
20
|
-
mesh.setDebugMsgTypes( ERROR | STARTUP | CONNECTION ); // set before init() so that you can see startup messages
|
|
21
|
-
|
|
22
|
-
mesh.init( MESH_PREFIX, MESH_PASSWORD, MESH_PORT );
|
|
23
|
-
mesh.onReceive(&receivedCallback);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
void loop() {
|
|
27
|
-
mesh.update();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
void receivedCallback( uint32_t from, String &msg ) {
|
|
31
|
-
Serial.printf("echoNode: Received from %u msg=%s\n", from, msg.c_str());
|
|
32
|
-
mesh.sendSingle(from, msg);
|
|
33
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[platformio]
|
|
2
|
-
src_dir = .
|
|
3
|
-
|
|
4
|
-
[env]
|
|
5
|
-
lib_deps =
|
|
6
|
-
bblanchon/ArduinoJson
|
|
7
|
-
arkhipenko/TaskScheduler
|
|
8
|
-
|
|
9
|
-
lib_ldf_mode = deep+
|
|
10
|
-
[env:esp8266]
|
|
11
|
-
platform = espressif8266
|
|
12
|
-
board = nodemcuv2
|
|
13
|
-
framework = arduino
|
|
14
|
-
lib_extra_dirs = ../../
|
|
15
|
-
lib_deps =
|
|
16
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
17
|
-
esp32async/ESPAsyncTCP@^2.0.0 ; Only for ESP8266
|
|
18
|
-
|
|
19
|
-
[env:esp32]
|
|
20
|
-
platform = espressif32
|
|
21
|
-
board = esp32dev
|
|
22
|
-
framework = arduino
|
|
23
|
-
lib_extra_dirs = ../../
|
|
24
|
-
lib_deps =
|
|
25
|
-
${env.lib_deps} ; Inherit common dependencies
|
|
26
|
-
esp32async/AsyncTCP
|