Several days ago, I cobbled together a short bit of code to make an NTP enabled clock out of an ESP32/OLED module. I had previously used an ESP8266 and a separate module to make a little demo that predicted the location of the ISS. I thought that the ESP32 would make a better development platform, for a number of reasons:
- It’s faster.
- It is dual core.
- It includes a small real time operating system that allows you to create communicating tasks.
My early example didn’t make any use of that, it was just a clock. So today I spent a little more than an hour to expand the basic code outline to include some new features:
- It now links in my C++ library that implements the Plan 13 algorithm for doing satellite prediction.
- The previous
NTPClient
library wasn’t really very good: it didn’t include any way of accessing day/month/year. I switched it to useNTPClientLib
instead, which is much better. - I experimented with using the
xTaskCreate
call to create different tasks, one of who updates the current satellite position, and the other which updates the display. This proved to not be difficult and works remarkably well. I anticipate that this will make my final version of the code easier to write. I can implement one process whose job it is to scan forward in time, looking for the next satellite pass. When it finds one, it can use a queue to send it to the display task, and can continue. This makes the program easier to write and more modular. - I also did some work to fetch orbital elements directly from celestrak.com so that the display will always be up to date.
The code is not in a state to share yet but I think it is going to be pretty neat when I’m done. The gadget could easily be mounted in a small case and carried into the field, where it could be entirely battery powered.
Stay tuned for updates.