Skip to content

WiFi-enabled GNSS (GPS, BeiDou, GLONASS, Galileo) fed NTP/RDATE server based on ESP8266/ESP32 and Arduino

License

Notifications You must be signed in to change notification settings

Montecri/GNSSTimeServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Stratum-1 GNSS Time Server Built From Scratch-GNSSTimeServer

GitHub Actions Workflow Status GitHub language count GitHub Release GitHub commit activity GitHub Issues or Pull Requests

Answer Survey Answer the survey: Crowdfunding for GNSS Time Server


Watch the video - Watch the video

Ethernet/WiFi enabled, GNSS fed, NTP/RDATE server based on ESP8266/ESP32 and Arduino


๐ŸŽ–๏ธ Featured by Hackaday

๐ŸŽ–๏ธ Selected for and presented at Maker Faire Rome 2023


Maker Faire Rome 2023 pictures below:



"Buy Me A Coffee"

Functionalities:

  • Internal real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO), synched from Global Navigation Satellite System (GNSS) satellites constellation (GPS, BeiDou, GLONASS and Galileo; backed by CR2032 battery)
  • Real-time operating system (RTOS) multi-tasking (when used with ESP32); core tasks (GNSS synching, Clock updating, processing NTP/RFC868 requests) running with a higher priority than common tasks (display update, PPS led blinking, web page serving)
  • Rich dashboard with information about MCU, RTC, GNSS, WiFi (uptime, free heap, minimum heap, temperature, version, IP, mac address, network name, network type, signal strength, timestamp, lat, long, lock status, sats, precision, etc)
  • Highly optimized web page (minimalist single HTML with no external dependency, embedded graphics (as base64 encoded strings, including favicon), embedded script and layout, gzip-compressed - Python conversion/compression script supplied), requiring a password for critical functions. Only 32 Kb in size total, further reduced to ~20Kb through GZip compression. All modern browsers support gzipped pages, the compression takes place before firmware compiling, so no computing cycle is wasted by the device
    • Data separated from layout, once the page is loaded, data will be updated every 5 seconds from a lightweight JSON string, no full page reloads are needed
  • Over-The-Air (OTA) Web Based firmware upgrade
  • Dual voltage powered
  • Backup battery for the whole unit (18650)
  • NTP and RDATE (RFC868) protocols supported
  • WiFi functionality as a client or access point
  • 10/100 Mbps Ethernet support (W5500 hardwired TCP/IP embedded Ethernet controller)
  • Syslog logging
  • Configuration webpage for WiFi and Syslog, saving to persistent storage (LittleFS)
  • Informative display with a timestamp, satellites in view, accuracy, WiFi server, IP address
  • Dual function button, short press switch information on display, long press toggles WiFi
  • Status at a glance, with dedicated 5mm LEDs for GPS lock, PPS signal, and WiFi status, as well as visible internal leds for charging and GPS module statuses
    • Yellow LED will be on or off to indicate respective WiFi status
    • Green LED will blink/pulsate at different rates to indicate a lock is being acquired and stay steady green when locked
    • Red LED will blink once a second once the lock is acquired, in sync with the PPS signal
  • Diagnostics messages on boot
    • When turned on, the OLED will first display the reason for the last shutdown (if it was rebooted by the MCU itself due to a power oscillation or other reason or if it was a user-triggered shutdown) and proceed displaying the startup status of each module, so if it gets stuck on boot you can know which module is hanging and troubleshoot faster.

Note

Please note that some functionalities are available only on ESP32, due to either ESP8266 limitation or the functionality not being backported yet.


Parts list:

  • Amica NodeMCU (ESP8266 / ESP-12) or ESP32Duino (ESP32-WROOM-32)
  • DS3231 RTC
  • GNSS module. Tested with:
    • Neo-6m V2
    • ATGM336H
    • ZKMICRO AT6558D
    • TOPGNSS Allystar TAU1201
  • 1.3" SH1106 OLED Display
  • For mains powered:
    • Hi-Link 5V/3W
    • Mini-360 DC-DC Buck converter
    • TP4056 Module
    • 18650 battery holder
    • 0.5A/230v fuse
    • 10D561K varistor
  • For power adapter powered:
    • 18650 battery shield
    • 5.5mm x 2.1 mm or any other suitable socket
  • For the ethernet-enabled version:
    • WIZNet W5500 module
  • Resistors (150, 100, and 150 Ohms respectively for above LEDs)
  • Switch key and momentary push button

New dashboard screenshot:

And the new 3D printable case:





Check also the Dual Display PIR Enabled branch option: https://github.com/Montecri/GPSTimeServer/tree/Dual-Display


ATTENTION

Several DS3231 modules being sold today contain a hazardous design flaw in which it supplies a voltage to the battery cradle regardless if it came with a rechargeable battery or not. If it came with a CR2032 battery (non-rechargeable) the consequence is that it will swell, explode, or worse. If it comes with a LIR2032 battery (rechargeable), the module is fed with 5v will generate an unsafe charging voltage for that battery.

There are workarounds for that so you don't need to toss your module away, the most popular being removing a diode and/or resistor.

There's a long discussion on the thread below about the root cause and possible fixes:

https://forum.arduino.cc/t/zs-042-ds3231-rtc-module/268862/33


Libraries:

  • paulstoffregen/Time@^1.6
  • makuna/RTC@^2.3.5
  • mikalhart/TinyGPSPlus@^1.0.3
  • olikraus/U8g2@^2.28.8
  • arcao/Syslog@^2.0.0

Source code based on:

Contributions from:

@mmarkin @sjthespian

sketch_bb-menor power supply - UPDATED_bb-menor

https://www.linkedin.com/pulse/iot-maker-tale-stratum-1-time-server-built-from-scratch-monteiro/