Skip to content

acep-uaf/ru_ontime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ru_ontime

Simple command line tool to sanity check time synchronization between an NTP server and a PXM meter

Description

Queries NTP server and gets offset from system clock. Queries meter time and gets the offset from system clock by sampling and averaging the samples with the lowest round-trip times. Offsets are compared to get the difference between the meter time and the NTP server time.

diagram

Dependencies

  • Working Ruby environment

Installing

git clone https://github.com/hahodgins/ru_ontime.git
cd ru_ontime
bundle

Executing program

# test_time.rb needs the NTP server address, meter ip address, and a range of registers to poll
./test_time.rb ntp_server_address meter_ip reg_start..reg_end

# firmwaregrab.rb just needs the meter ip address and firmware register
./firmwaregrab.rb meter_ip firmware_reg

For repeated polling, use config.yml to store NTP server address, meter IP address, modbus register range

poll_cfg:
  ntp_server: 'time.nist.gov'
  meter_ip: '123.45.0.67'
  time_regs_str: '1000..1007'

Multiple meters (of the same type) can be polled at once by providing a list: '123.45.0.1, 123.45.0.2, ...'

Version History

  • 0.1.3
    • Added handling for polling multiple meters at once
  • 0.1.2
    • Added config.yml and handling in test_time.rb
  • 0.1.1
    • Initial Release

Resources

About

Simple tool to sanity check time synchronization between an NTP server and a PXM meter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages