Shelly watchdog - restart

  • Hi,

    at first I wanted to say, I'm not a coder by any means ;) (this is double of this post Shelly watchdog - restart), but maybe here is more suitable place for it.

    So my goal is to have a script which checks if a Shelly is able to reach the Internet and if not, Shelly should be restarted. Sometimes a few Shellies lose their connection and the only way to reconnect is to restart a Shelly itself.

    I have tried to modify existing script and my outcome looks like:

    I have checked and it looks like the script works. Maybe someone could check/advise if it is ok. Maybe some improvement could be made.

    Thanks in advance.

    Einmal editiert, zuletzt von Kolo Kolo (20. Februar 2023 um 09:19)

  • This script is my version of the official script from here: ALLTERCO.

    It doesn't really do a real PING. It tries to simply GET a resource from the provided endpoints. If your router has, for example WEB login page then it is probably possible to add/replace provided endpoints with your own addresses. It must make a response with 200 code.

    Code
    shelly_http.cpp:71 0x3ffd709c HTTP got 200 OK and 672 byte response

    I have checked and it looks like it may work. My router's login page address inside my LAN is: http://192.168.13.254

    Code
    endpoints: [
        "http://192.168.13.254",
        //"https://us-central1-5tkroniexa-uc.a.run.app/ping",
      ],

    4 Mal editiert, zuletzt von Kolo Kolo (14. März 2023 um 06:56)

  • Hi,

    I'm looking for something like this but I need it to do a real ping :saint: The device is behind to much firewalls but it can ping google for example. the http get method doesn't work for me.

    I've searched but so far no luck. can some one point me in the right direction?

    tks,

    Rijolo