benclifford / msf

reads MSF data on a raspberry pi GPIO pin and feeds it into ntpd
8 stars 1 forks source link

Adapt to use dcf77 #1

Closed Womble-1 closed 6 years ago

Womble-1 commented 6 years ago

Hi

I'm not programmer, but would like to adapt this to decode dcf77 signals. There is code to do this elsewhere, but nothing that puts it into NTP that i can find. Which functions would i need to replace?

thanks..

benclifford commented 6 years ago

The code that cares about the format of the data is checkdecode which performs a very basic validation of the data that has been received to see if it looks ok; decode which turns the MSF 2-bit-per-second signal into an array of bits called bit[]; and decodeBCD which looks in bit[] and turns that into years, months, days, hours, minutes which it then passes into tellNTP.

The decode function would need to change because my understanding is that DCF77 is one bit per second, encoded differently to MSFs 2-bits-per-second.

decodeBCD would need to understand the different bit layout of DCF77.

Womble-1 commented 6 years ago

A little bit more involved than i realised. Thank you for such a prompt response.