@alteriom/painlessmesh 1.8.6 → 1.8.7

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.
@@ -46,7 +46,12 @@ Task taskBroadcastNTP(NTP_INTERVAL, TASK_FOREVER, [](){
46
46
  pkg.timestamp = millis();
47
47
 
48
48
  // Serialize and broadcast to mesh
49
- String msg = pkg.toJson();
49
+ JsonDocument doc;
50
+ JsonObject obj = doc.to<JsonObject>();
51
+ pkg.addTo(std::move(obj));
52
+
53
+ String msg;
54
+ serializeJson(doc, msg);
50
55
  mesh.sendBroadcast(msg);
51
56
 
52
57
  Serial.printf("Broadcast NTP time: %u from %s (accuracy: %ums)\n",
package/library.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "type": "git",
7
7
  "url": "https://github.com/Alteriom/painlessMesh"
8
8
  },
9
- "version": "1.8.6",
9
+ "version": "1.8.7",
10
10
  "frameworks": [
11
11
  "arduino"
12
12
  ],
@@ -1,5 +1,5 @@
1
1
  name=Alteriom PainlessMesh
2
- version=1.8.6
2
+ version=1.8.7
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alteriom/painlessmesh",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
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",
@@ -29,10 +29,10 @@
29
29
  /**
30
30
  * @brief AlteriomPainlessMesh library version information
31
31
  */
32
- #define ALTERIOM_PAINLESS_MESH_VERSION "1.6.1"
32
+ #define ALTERIOM_PAINLESS_MESH_VERSION "1.8.7"
33
33
  #define ALTERIOM_PAINLESS_MESH_VERSION_MAJOR 1
34
- #define ALTERIOM_PAINLESS_MESH_VERSION_MINOR 6
35
- #define ALTERIOM_PAINLESS_MESH_VERSION_PATCH 1
34
+ #define ALTERIOM_PAINLESS_MESH_VERSION_MINOR 8
35
+ #define ALTERIOM_PAINLESS_MESH_VERSION_PATCH 7
36
36
 
37
37
  /**
38
38
  * @brief Library description and usage information
@@ -1185,7 +1185,12 @@ class Mesh : public painlessmesh::Mesh<Connection> {
1185
1185
  obj["from"] = this->nodeId;
1186
1186
  obj["routing"] = 2; // BROADCAST routing
1187
1187
  obj["timestamp"] = this->getNodeTime();
1188
- obj["internetConnected"] = (WiFi.status() == WL_CONNECTED);
1188
+
1189
+ // Check Internet connectivity: WiFi connected AND valid gateway IP
1190
+ bool hasInternet = (WiFi.status() == WL_CONNECTED) &&
1191
+ (WiFi.gatewayIP() != IPAddress(0, 0, 0, 0));
1192
+ obj["internetConnected"] = hasInternet;
1193
+
1189
1194
  obj["routerRSSI"] = WiFi.RSSI();
1190
1195
  obj["routerChannel"] = WiFi.channel();
1191
1196
  obj["uptime"] = millis();
@@ -1196,7 +1201,7 @@ class Mesh : public painlessmesh::Mesh<Connection> {
1196
1201
  serializeJson(doc, msg);
1197
1202
 
1198
1203
  Log(GENERAL, "sendBridgeStatus(): Broadcasting status (Internet: %s)\n",
1199
- (WiFi.status() == WL_CONNECTED) ? "Connected" : "Disconnected");
1204
+ hasInternet ? "Connected" : "Disconnected");
1200
1205
 
1201
1206
  this->sendBroadcast(msg);
1202
1207
  }
@@ -5,7 +5,7 @@
5
5
  * @file painlessMesh.h
6
6
  * @brief Main header file for Alteriom painlessMesh library
7
7
  *
8
- * @version 1.8.4
8
+ * @version 1.8.7
9
9
  * @date 2025-11-12
10
10
  *
11
11
  * painlessMesh is a user-friendly library for creating mesh networks with