hzeller / txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
GNU General Public License v3.0
415 stars 67 forks source link

Support WWVB DST change days. #15

Closed icb- closed 3 years ago

icb- commented 3 years ago

I've done minimal testing that this correctly sets the DST bits for the WWVB signal. You should test more before merging. Timezone math always confuses me.

These are the relevant bits for the day DST starts and ends, and one day on each side, before and after this change.

Starting DST:

===== 2021-03-13
Before:
:57 [__########]
:58 [__########]
After:
:57 [__########]
:58 [__########]
===== 2021-03-14
Before:
:57 [__########]
:58 [__########]
After:
:57 [_____#####]
:58 [__########]
===== 2021-03-15
Before:
:57 [_____#####]
:58 [_____#####]
After:
:57 [_____#####]
:58 [_____#####]

Ending DST:

===== 2021-11-06
Before:
:57 [_____#####]
:58 [_____#####]
After:
:57 [_____#####]
:58 [_____#####]
===== 2021-11-07
Before:
:57 [_____#####]
:58 [_____#####]
After:
:57 [__########]
:58 [_____#####]
===== 2021-11-08
Before:
:57 [__########]
:58 [__########]
After:
:57 [__########]
:58 [__########]

Fixes hzeller/txtempus#14

icb- commented 3 years ago

Note that I only did this for WWVB. Some of the other sources have similar bits.

MSF:

Bit 58B indicates the broadcast time is summer time. Bit 53B gives warning that the summer time bit is about to change. It is set for 61 consecutive minutes, starting 1 hour 7 seconds before the change, and ending 7 seconds before the change, 5 seconds before the first changed bit 58B, which is itself transmitted 2 seconds (1.7–1.8 seconds, to be more precise) before the moment of the time change.

JJY: Not used

DCF77: Bit 16 is set the hour before the change in either direction.

hzeller commented 3 years ago

Thanks, merged. Looks good, but I can't test it with an actual clock. Maybe @t11s can comment if it now works for them.