rwpalmer / tzLib

Manages local time and DST settings for IOT devices. Device user must provide a time-zone ID. Data is obtained from a private server (virtual or physical). Server build instructions included.
GNU General Public License v3.0
0 stars 0 forks source link

tzLib

Automatically maintains the device's local time settings.

So, what does "Automatically" mean?

tzLib does not automatically set a device's local time based upon the device's physical location ... but it does make it possible for developers and users to change the device's time zone in real time based on web-based triggers or geopositioning software.

How the Library Works ...

Sample Usage

Most implementations require the addition of four lines of code. This sample includes a fifth to make it clear when the fifth line must be included.

    setup() {
        tzLib.begin();                          // <- 1. Prepare tzLib to run

        tzLib.setEepromStartByte(0);            // <- 2. Tell tzLib where to store data in EEPROM         

        tzLib.setDefaultZone("<timezone id>");  // <- 3. Set the default time zone

        tzLib.setLocalTime();                   // <- 4. Configure local time   
    }

    loop() {
        tzLib.maintainLocaltime();       // <- 5. Perform DST transitions & keep time zone data current.
    }

I M P O R T A N T

Library Documentation

tzLib documentation includes an Overview, a QuickStart Guide, a Reference Guide, and a manual that explains how the author created the HTTP server he used for testing tzLib. https://github.com/rwpalmer/tzLib/tree/master/doc

Firmware Examples

tzLib is packaged with three firmware examples. All three are designed to be run with a serial console.

Sample "serial console output" is included in the comments at the the bottom of each example's .ino file. tzLib301.ino comments includes HTML that can be used to trigger a time zone change on the device. https://github.com/rwpalmer/tzLib/tree/master/examples

Current State of the Project ...

tzLib (0.1.1) will exit alpha testing soon.

Code and documentation are under review.

To support beta testing, an HTTP server has been connected to the web, and the library has been preconfigured to use this server by default.

For those who wish to create their server, or to use an alternate server.

The search for someone to host the production HTTP server is underway. We hope to find a corporate entity who can host the PHP file in their data-center, so library users will have a platform that they can rely upon. Please contact the author if you can help, or if you have any contacts who might be able to help in this effort.

Hosting requirements are minimal:

Please report any issues, suggestions, and comments to the author and maintainer: rwpalmeribm@gmail.com

Many thanks to Kasper Kamperman (https://www.kasperkamperman.com) for suggesting the move from Java to PHP, and for helping to assemble the PHP code used in this project.