GNSS Time Acquisition Testing
- Indoors, and even outdoors, it takes a while (more than a few seconds) for the time to resolve itself.
- When to call the time and date “good”:
- When
gnss.getTimeValid()andgnss.getDateValid()return true, then the time and dates provided can be trusted for our purposes. The only major thing to be aware of is that it doesn’t guarantee leap seconds are correct (which means you have a +/- 1 second uncertainty). - Even when this happens, the number of satellites reported seen might be zero.
- When inside the W3VC radio club near the window, it takes 1-2 minutes on average for the time and date to validate from a cold start. (This is different from simply resetting the MCU/code. When simply resetting code, time and date validation takes less time.)
- When
- A note about “valid” and “confirmed”:
- There are four functions available:
gnss.getTimeValid(),gnss.getDateValid(),gnss.getTimeConfirmed(), andgnss.getDateConfirmed(). - “Confirmed” is a more strict check than “valid”.
- There are four functions available:
- See GitHub repo for modifications on custom library this week.
BLE Schedule Uploading
- Define a struct for each event to be sent from the desktop app to Remigotchi
#include <stdint.h>
typedef struct {
// 32 bytes
char name[32];
// 2 bytes
uint16_t period;
uint16_t start_time;
uint16_t end_time;
// 1 byte
uint8_t days_of_week;
uint8_t padding[1];
} event_t;
- Rewrote BLE Serial testbench, there were some bugs with the code blocking until a total of 4 bytes were sent. Now, it doesn’t block, but continuously polls the serial buffer.
- Commit here: 4283f08
Battery Monitor
- I finally got around to testing the battery monitor, which is a 100 kOhm and 270 kOhm voltage divider connected to one of the ESP32’s GPIO pins.
- Luckily, the Arduino framework provides a function
analogReadMillivolts(), which does in fact work. So all I have to do is call that. - I confirmed with a Fluke 233 multimeter that values read by the aforementioned function are accurate.
New Tools and Knowledge
I needed to learn a bit more about how the SPI peripherals on the ESP32-S3 were set up. The main strategies I used were forums about ESP32 SPI usage, as well as ESP’s official documentation page and chip datasheets.
I also learned a bit about communicating with the GNSS module on the board. I learned how to use it by first looking up popular, well-tested libraries, and decided on the SparkFun GNSS V3 library. From there, I learned how to extract the time from the device by reading the library’s docs as well as the device’s datasheet.
Below is a photo of the LCD screen connected to a Remigotchi PCB used for field-testing the GNSS connectivity.

