dsiggi / micropython-dcf77

Micropython module to receive and decode the DCF77 time telegram.
GNU Affero General Public License v3.0
2 stars 1 forks source link

Code in date parity not working #1

Closed specialist383 closed 5 months ago

specialist383 commented 5 months ago

the dsiggi micropython dcf77 program is a great piece of work providing kind of a background task for decoding the second pulses of dcf77. Installed on a RPI pico it functioned on a SW testbed together with existing display routines, sensor readings etc without creating delays, hangups or alike. However there was a misunderstanding of the dcf77 coding scheme. In dcf77 code the time information has an individual parity check for minutes and hours which is correctly implemented. The date, weekday and year information has only one combined parity bit. So the repeated application of the time decoding def decode_datetime(self,time) produces an error result 999 every time even though the date bits are decoded correctly. Installed on a RPi pico with a Pollin dcf receiver it needed a little bit of tweaking of the min/max values of dcf's "0" and "1" to higher values. If the signal decoding is split into ... __decode_time(self,time) : code just as before, and decode_date(self,time) without parity check and a third new __check_date_parity(self,time) that just checks parity of self.signal_last[36:57] it works as perfect as a dcf77 decoder program can.

dsiggi commented 5 months ago

Oh, you've got that exactly right. The entire date has a common parity. Interesting that I didn't notice this when testing. I hope I can find the time to fix the error this week.