Code Monkey home page Code Monkey logo

aviators-desk-clock's Introduction

Aviators Desk Clock

AviatorsBot

A custom desk clock for aviators showing the current UTC and local time as well as BCMT (beginning of civil morning twilight - the start of daytime) and ECET (end of civil evening twilight - the start of nighttime).

Introduction

The clock is kept accurate using NTP synchronization. And will show a failure if the sync becomes to old.

It is a custom firmware for the ESP32 based LILYGO T-Display-S3 hardware.

Installation

Clock configuration

Currently, the location and the timezone of the clocks local time need to be configured in the source code in config.h

The correct timezone strings can be looked up in the TZdef.h of the gmag11/ESPNtpClient project.

Configuration example:

// Set the location of the clock for BCMT and ECET calculation
// the default is Vöslau Airfield in Austria, LOAV
#define LATITUDE 47.964444 // in decimal degrees, with North being positive
#define LONGITUDE 16.259444 // in decimal degrees, with East being positive

// Set the timezone for the local time, the default is Vienna time.
#define TIMEZONE "CET-1CEST,M3.5.0,M10.5.0/3"

#define NTP_SERVER "0.pool.ntp.org"
### Build and upload

It can then be built and uploaded using platformio.

WiFi Configuration

The WiFi is configured dynamically using a web interface provided by WiFiManager. If no WiFi is configured or the WiFi connection times out an access point with the SSID "aviators-desk-clock" is opened for configuration management.

You can connect your device to this access point and use the provided web interface to set the WiFi SSID and password for the WiFi which the clock should use.

Usage

Initial Sync

After booting the clock it will perform it's first NTP sync, which can take a while, and you will see an INOP flag instead of the time.

Buttons

The top of the two front buttons shuts the clock down into a sleep mode and wakes it up again.

The bottom of the two front buttons can be used to switch between the debug information page and the clock.

BCMT and ECET

Display

BCMT and ECET are shown in UTC. Therefore, the BCMT or ECET shown might actually be for the previous or next day in the UTC timezone.

If no BCMT or ECET exists, as is e.g. the case for locations above the arctic circle on certain days, NONE is shown instead.

Calculation

The BCMT and ECET calculation are performed using the sunset library for Arduino.

BCMT and ECET are calculated for the current local date day but shown in UTC. Therefore, BCMT or ECET can actually be on a different UTC day.

Both are returned in fractional minutes, which are then floored and converted to hours and minutes. Therefore, a one-minute difference may be observed compared to other clocks or lists, depending on which treatment of seconds those sources choose. In this clock seconds are simply cut off, therefore for example 17:59:55 would be shown as 17:59 as would 17:59:01.

Please also note that some other sources report BCMT and ECET for average years, which will also cause a difference. The Austrian AIP for example states that a difference of up to 3 minutes is possible between an actual and average year for the tabulated times (GEN 2.7-1.4).

Customization

Fonts

By default, a font based upon a simulation of the A320 engine indication system is used.

To replace the font it needs to be converted using the lvgl online font converter and can then be loaded and used in clock_gui.cpp.

aviators-desk-clock's People

Contributors

fvalka avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.