An alternative to webhooks

I have been using webhooks for my project that records the number of pulses made by my household power meter. The Core device uploads the pulse count once a minute. That was until my pseudo-static IP address changed and therefore the website that manages data uploads was temporarily unreachable. I updated the DNS zone files for my domain name with the new IP address and I could access the site again within a few minutes. However, the DNS server used by webhooks server took about a further 8 hours to have the new DNS setting propagated to it and therefore could not reach the target site. At least, that is what I think happened.

I was wondering if there was a way to have the Spark/Particle Core to bypass the webhook server and send an http request directly to my site. That way it would be using the DNS servers specified by my modem/router which would update faster than the DNS server used by the webhooks server. After all, all I want to send is a simple http request of the type: http://www.mydomain.com/reader.ashx?ID=1234&Pulses=10

Thanks!

If you don’t require https, you could perhaps use the http library to make direct requests. A quick forum search will show you plenty examples :smile:

3 Likes

Isn’t that done using Webhooks? Just use that URL you mentioned and hit it?

It’s hard to find something when you don’t know the keywords to look for :). Thanks for pointing me into the right direction!

1 Like

Not sure we are understanding each other. The point of this thread is to avoid using webhooks.

1 Like

You might find my code useful, it posts to my website at regular intervals. Previously I was only posting every 10 minutes, but I made a couple of changes recently to make it work at 1 minute intervals.

1 Like