PyPortal Auto Rebooting Endless Loop

A few years back I made a NTP clock for my station.  I was always obsessed with time accuracy, and a RPi running NTP services filled the bill quite well.  That clock was always within a fraction of a second of spot on.  And it automatically adjusted for DST/STD plus recovered from power failures nicely.  I have found it far more dependable than Windows (which has a crude implementation of a NTP process to automatically set Windows time).

Time has passed (pun), and a potential replacement is a “PyPortal” from Adafruit.  With a nice stand, this device sells for about $65, a bit cheaper than the original part list for the RPi version.  It has a nice graphical touch screen too.  It is about 3.5″x3.0″ with the case.

In the photo above, it is running a tide chart program for today (can be found here).

The jury is still out, as it is not clear that this board is capable of sustaining accurate time keeping without frequent NTP calls (which is a very bad thing).   It has been gaining about 80 seconds in an hours time (at which point a call is made to refresh the NTP time).  That’s about 3% accuracy.  Initial investigation reveals that Adafruit’s designers chose NOT to use a 32 KHz crystal (saved them about $0.40).  The Microchip specification is that the internal RC oscillator is only accurate to about 40 parts per thousand out of the box and improves only slightly to 30 parts per thousand when “software calibrated” by the user.  Clearly NOT adequate for timekeeping by any stretch of the imagination.

=============================================================

The other issue I ran into today when trying to load the graphical tide chart program, is that my unit kept resetting over and over again when attached to a Win10 machine.  I would see “Autoreload is on. Simply save files over USB to run them or enter REPL to disable.” endlessly on the PyPortal Screen.  Something was badong

I fixed the issue by clearing the PyPortal flash drive back to default value.  I did this by using the MU Environment, opening up the Serial Console and issuing typing <Ctrl><C> to stop the endless reload cycle.  At that point two lines of code were entered using the serial console:

Of course the above blows away the contents of the flash drive, so you will need to upload all the libraries, fonts, icons, and code (don’t forget the “secrets.py” file too).  When I did that the problem went away.

BTW: The board pulls about 160ma from a 5 VDC supply (MicroUSB cable).  That’s about 6.5 KWH per year.  I will explore power reduction options.  This is a “low power” device, of course, but it points out that even low power devices add up when running 24×7.

This entry was posted in From the OM, Projects, Time. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *