No description
Find a file
2022-01-12 12:45:49 -06:00
esp-idf@8bf14a9238 simplify 2022-01-07 15:50:16 -06:00
main Add pulse per minute/hour and "per second, exclusive" 2022-01-12 12:45:49 -06:00
uf2@1421ca7fe7 Add pulse per minute/hour and "per second, exclusive" 2022-01-12 12:45:49 -06:00
.gitignore get it working 2022-01-07 15:08:09 -06:00
.gitmodules Add pulse per minute/hour and "per second, exclusive" 2022-01-12 12:45:49 -06:00
CMakeLists.txt Add neopixel for status 2022-01-07 16:34:13 -06:00
README.md cyan status LED for recently set 2022-01-08 09:16:56 -06:00
sdkconfig.defaults add an sdkconfig.defaults 2022-01-07 16:40:58 -06:00

wifi-ntp-pps

Produce a pps signal reasonably well synchronized to NTP. The duty cycle is 100ms on (starting at the top of the second), 900ms off. Jitter is very high relative to GPS or even WWVB, but long term accuracy should be extremely good thanks to NTP.

Installing and setting up esp-idf

One time set-up:

git submodule update --init
esp-idf/install.sh

(Note that this will fail if you've previously done . esp-idf/export.sh; use a fresh terminal if you have to (re)install esp-idf)

Set environment variables in current shell until exit:

. esp-idf/export.sh

Configuring wifi-ntp-pps

Open the project configuration menu (idf.py menuconfig):

  • Configure Wi-Fi under "Example Connection Configuration" menu. See "Establishing Wi-Fi or Ethernet Connection" section in examples/protocols/README.md for more details.

  • Select the board type (Adafruit QT Py or Adafruit Feather)

  • Select an ntp server. Ideally, a local server. Otherwise, pool.ntp.org can be used. The default will not work.

  • Optionally, turn down LWIP_SNTP_UPDATE_DELAY; the default is 1 hour. For a local NTP server something smaller like 30000 (30 seconds) is probably fine.

Compiling

idf.py all

Flashing

Plug in the device while holding the BOOT button. Alternately hold BOOT and press RESET once. Determine where the device has appeared, such as /dev/ttyACM1.

idf.py flash --after no_reset --port=/dev/ttyACM???

Once flash has finished, click the reset button once. (Technical limitations seem to prevent automatically resetting after loading the code, and it prints a scary failure message every time!)

PPS Output

The pin with silk "A0" gets a 1PPS output with the rising edge placed near the top of the second.

Status indicator

The on-board neopixel gives the board status:

  • Black: power off or crashed
  • Solid red: never connected to wifi or crashed
  • Blinking red: never got NTP sync since power on
  • Blinking green: connected & got NTP sync in last 10s
  • Blinking green: connected & got NTP sync since power on