Driver for DCF77 radio controlled clock #1911
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quite common in Germany are Radio Controlled Clocks, using the DCF77 broadcasted time signal as time source.

Since we now have a flexible clock, we can use this as clock source, too.
Starting with "startdriver DCF77"

optional arguments are
"fall" per default, a rising edge will mark the "bits", if you need a falling edge (e.g. if using a opto-isolator), use this argument
"httpstat" add some details from driver on main page
Arguments to "tune" reception (usually "0" is 100ms, "1" is 200 ms - you can change the "breaking" point with the below values (actual code uses 180 as default for both values)
"end0=X" set max duration of 0 bit to X ms
"start1=X" set min duration of 1 bit to X ms
This is some debug output:
It might also be used with an opto-isolator for devices with main on the IO pins:
This is my test with a BK7231N switch (powered by a PoE power supply with 48V) and the receiver input on the "switch" (since opto coupler inverts the signal, I used it with "fall" argument). I'm using a common PC-817 and a 220 ohm resistor for 3.3V for DCF77 device: