Sunday, 13 March 2016

Introducing the Epoch WebService for Low-Power IoT devices without RTC

Today I was working on the OakPowerBoard project and I asked myself: why isn't there a web service that just allows you to get the current Unix Timestamp without having to parse loads of response data? Well, I couldn't find it! So I built it and deployed it to Azure! Until I find a shorter domain you can use the following URL as you see fit!

  http://tiwtieapp.azurewebsites.net/now?format=json

This will return the server time. No padding, no trimming, just the time! Neat, right? I've contacted the owner of epo.ch, but haven't had a response yet.

So why did I do this?
The OakPowerBoard firmware does HTTP requests anyway, so doing a request to this web service does not cost a lot of extra code. Implementing a bare-bones NTP client is probably a lot more work! And of course, nearly every internet-connected platform has examples for a simple HTTP GET request, this cannot be said for NTP. Enjoy!