npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smithtek-nodered-rtc

v1.8.0

Published

A Node-RED node to set system timezone and sync RTC

Downloads

563

Readme

smithtek-rtc-node

Intro

Installation

Install the smithtek-rtc-node using the NodeRED palette manager.

Usage

The smithtek-rtc-node is designed to set and synchronize system time zones and hardware clocks. It leverages system commands to update the timezone and synchronize the hardware RTC module, making it easy for users to maintain accurate system time. The smithtek-rtc-node is an essential tool for ensuring time synchronization in environments where communication outages are common. By setting and maintaining the system's time and hardware RTC, this node guarantees that all data logged during outages is stamped with accurate timestamps. When used alongside the Smithtek Format and Smithtek Out nodes, the Passport can log and forward data indefinitely with valid timestamps, ensuring consistency and reliability for downstream systems. Additionally, this node simplifies synchronization with daylight saving time (DST) transitions, ensuring your system stays accurate year-round. With its intuitive single dropdown interface, it’s straightforward to configure, making it an indispensable component for robust data logging solutions. The system retrieves time from NTP servers in ISO 8601 or a related standard time representation. The time is converted from UTC to the local time selected via the drop down.

Setup smithtek-rtc-node

  1. Drag and drop the smithtek-rtc-node into your Node-RED flow.
  2. Use an inject node to trigger the input message.
  3. Select the desired timezone from the dropdown in the node's configuration.
  4. Inject the RTC node once, after about 5 seconds it will output the success msg.
  5. Restart your NodeRED flow for it to pick up the new time.

Once the flow is deployed, injecting a message into the node will set the system's timezone to the selected value and synchronize the RTC module. you only have to inject the node once. However it is advised to update at least once a year to correct for time drift. The embedded RTC module has a Accuracy: ±2 ppm (parts per million) from 0°C to +40°C. that translates to around 1 minute per year drift. At extreme temperatures (e.g., -40°C to +85°C), accuracy may slightly degrade to ±3.5 ppm, or about 2 minutes per year.

Its worth noting The system clock will adjust to the new time instantaneously, The NodeRED runtime needs to restarted for it to pick up the new time after every change.

SmithTek RTC Node

Output

The node outputs a status message indicating success or failure for each operation:

Example output message format:

{
    "success": true,
    "actions": [
        {
            "action": "Set timezone",
            "success": true,
            "output": ""
        },
        {
            "action": "Synced RTC",
            "success": true,
            "output": ""
        }
    ]
}

How to Use the Node

  1. Drag and configure the node in your flow.
  2. Use an inject node to trigger the operation.
  3. Monitor the output message to verify success.

Example Flow

Copy and import this example flow to see how the node works:

[
  {
    "id": "example-flow",
    "type": "tab",
    "label": "RTC Example Flow",
    "disabled": false,
    "info": ""
  },
  {
    "id": "inject-node",
    "type": "inject",
    "z": "example-flow",
    "name": "Trigger RTC Update",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "x": 150,
    "y": 100,
    "wires": [["rtc-node"]]
  },
  {
    "id": "rtc-node",
    "type": "smithtek-rtc",
    "z": "example-flow",
    "name": "",
    "timezone": "Australia/Sydney",
    "x": 400,
    "y": 100,
    "wires": [["debug-node"]]
  },
  {
    "id": "debug-node",
    "type": "debug",
    "z": "example-flow",
    "name": "RTC Output",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "x": 650,
    "y": 100,
    "wires": []
  }
]

License

Copyright (c) 2023 www.smithtek.com.au
Licensed under the terms of the GPLv3

Acknowledgements

Special thanks to:

  • Nick O'Leary and Dave Conway-Jones for their invaluable contributions to the Node-Red community.

Contact: [email protected]
Website: www.smithtek.com.au