Hi, I recently discovered the service Healthchecks.io which I now use on my main HA configuration and this is working well. I would now like to extend this and use this to check one of my ESP32 devices to ensure it is still alive and active.
I simply need to do a call to HTTP to an address, example below.
Hi thank you for the pointer, I am very much a novice in this area and have through trial and error managed to get the code below installed on my ESP32 and installed without errors.
I’m uncertain which HTTP request method to use. I’ve tried a number of them but all show an error in the log as below. I can see the interval is working as the error only appears every minute. Any advice if I’m on the right track appreciated.
Literally I just need to ping that address.
Thanks
Hi Sorry for not coming back in the curl question. I’ll be honest and have no experience of using curl. It’s on my learning list…
So interesting developments on this. The code I posted used PUT but I had previously tried GET and POST without success. Thanks Ludeeus for confirming the correct method. This put me on the right path.
I was still having no joy so started again with a new ESP32. I was surprised to see this worked using the code below
Adding this to the ESP32 I have setup that I want to monitor still gave the connection refused error reported. Head scratching time!
Comparing ESP32’s the only difference is the one that did not work I had assigned a static i.p using the code:
Removing this code resulted in a success and I can now successfully ‘ping’ my Healthchecks.io dashboard. This is reporting correct operation.
This ESP32 is connected to hardware that monitors my wireless smoke alarms and can alert me on any alarm conditions to my mobile phone. Having the Healthchecks.io is an extra layer that the ESP32 is alive and connected to the internet. Pleased with this.
I’m confused however why fixing the i.p would cause an issue?
The only other question I have is the logging on esphome reports the following even though its working fine. Is this an area of concern ?
[11:55:53][D][http_request:099]: HTTP Request completed; URL: https://hc-ping.com/96775fbe-c3d3-4d38-b527-xxxx; Code: 200; Duration: 70 ms
[11:55:53][W][component:214]: Component interval took a long time for an operation (0.09 s).
[11:55:53][W][component:215]: Components should block for at most 20-30ms.
I really dont understand why are you complicating things. You can use uptime kuma and set all the monitoring you can think off. You can also configure it to send you notification on ie. telegram account.