Network Time Protocol On The ESP32

evan

[ad_1]

Network Time Protocol (NTP) is one of the best ways to keep networked computers synchronized to the same time. It’s simple, lightweight, and not only allows computers to maintain a time standard together, but it also allows some computer manufacturers to save some money on hardware costs. The Raspberry Pi is perhaps the most well-known example of a low-cost computer without the extra expense of a real-time clock (RTC). While the Pi sets up NTP essentially automatically, other microcontrollers like the ESP32 don’t, but it is possible to configure them to use this time standard with some work.

For this project the MicroPython implementation for the ESP32 is required. MicroPython is a way of running Python code on microcontrollers or other embedded systems without all of the overhead that Python would normally require. Luckily enough, the NTP libraries are built right in so once MicroPython is running on the ESP32 it’s nearly as easy as calling the library. Of course you will have to make sure there is an internet connection, and then grab the time, sync it to the machine, and then set the timezone.

For a bonus exercise, the project’s creator [Bhavesh] suggests attempting to configure Daylight Savings Time, although this can be a surprisingly difficult problem to solve. In the meantime, there are a few other ways of installing a clock on a microcontroller like this one. An RTC module is an obvious choice, but you can also get incredibly accurate time by using a GPS module as well.

[ad_2]

Source link

Next Post

Terra's Luna Plunges After Network Stablecoin Depegs From Dollar Again

[ad_1] Terra’s luna crypto crashed by 45% on Tuesday, after the network’s stablecoin lost its dollar peg again. Over the weekend, hefty selling drove TerraUSD below the $1 mark. In response, the project’s guiding group said it would sell some of its massive bitcoin reserves to prop up the token. […]
Terra’s Luna Plunges After Network Stablecoin Depegs From Dollar Again

You May Like

Subscribe US Now