Create ip-assignment-watchdog.js#74
Conversation
Mircho
left a comment
There was a problem hiding this comment.
Good solution. Can I ask you to also describe in the manifest - https://github.com/ALLTERCO/shelly-script-examples/blob/main/examples-manifest.json
ip-assignment-watchdog.js
Outdated
| let pingTimer = null; | ||
|
|
||
| function checkForWifi() { | ||
| Shelly.call("WiFi.GetStatus",{}, function (response) { |
There was a problem hiding this comment.
You can replace this with a synchronous call Shelly.getComponentStatus. It's more robust.
There was a problem hiding this comment.
@Mircho good suggestion. I didn't know about this utility function. Refactored.
|
Thank you for your contribution! |
|
Could you please expand this to include Ethernet in addition to WiFi? 🙏 My Shelly Pro 3EM is connected via Ethernet to a dumb switch, which is connected to my ISP's modem/router. In case of a power interruption, the Shelly boots faster than the modem/router — so essentially the same problem. |
I've got a triple TpLink Deco P9 mesh setup where every Shelly device has a DHCP address reservation in the mesh network.
But occasionally, whenever the mesh network is restarted, the routers get restarted in some weird order, so a bunch of the Shelly devices somehow connect to the "slave routers" in the mesh, but fail to acquire an IP address (presumably because of the address reservation).
As a result, the network is up and running, but those Shelly devices end up in a limbo state (without an IP assignment from DHCP), until they themselves are restarted. The problem is magnified when you've disabled the AP of those Shelly devices, because then you can no longer connect to them to restart from the web admin, and they also didn't get an IP from the router, so you can't access them by IP either. Essentially, you have to flip electrical breakers, which is a hardware fix, but the script here is a software auto-healing fix to the same problem.