@alteriom/painlessmesh 1.8.6 → 1.8.8

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.8",
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.8
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.8",
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,16 @@ 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 IP address
1190
+ // We check for valid local IP instead of gateway IP because:
1191
+ // 1. Gateway IP might not be immediately available after connection
1192
+ // 2. Some networks (mobile hotspots) may not provide gateway IP via DHCP
1193
+ // 3. Having a valid local IP + being connected is sufficient for internet access
1194
+ bool hasInternet = (WiFi.status() == WL_CONNECTED) &&
1195
+ (WiFi.localIP() != IPAddress(0, 0, 0, 0));
1196
+ obj["internetConnected"] = hasInternet;
1197
+
1189
1198
  obj["routerRSSI"] = WiFi.RSSI();
1190
1199
  obj["routerChannel"] = WiFi.channel();
1191
1200
  obj["uptime"] = millis();
@@ -1196,7 +1205,9 @@ class Mesh : public painlessmesh::Mesh<Connection> {
1196
1205
  serializeJson(doc, msg);
1197
1206
 
1198
1207
  Log(GENERAL, "sendBridgeStatus(): Broadcasting status (Internet: %s)\n",
1199
- (WiFi.status() == WL_CONNECTED) ? "Connected" : "Disconnected");
1208
+ hasInternet ? "Connected" : "Disconnected");
1209
+ Log(GENERAL, "sendBridgeStatus(): WiFi status=%d, localIP=%s, gatewayIP=%s\n",
1210
+ WiFi.status(), WiFi.localIP().toString().c_str(), WiFi.gatewayIP().toString().c_str());
1200
1211
 
1201
1212
  this->sendBroadcast(msg);
1202
1213
  }
@@ -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