rene0 / dcf77pi

Yet another DCF77 decoder. This one is intended for the Raspberry Pi platform but might work on other devices using GPIO pins too.
BSD 2-Clause "Simplified" License
18 stars 6 forks source link

dcf77pi

This repository has been migrated to https://codeberg.org/rene0/dcf77pi and archived here.


Yet another DCF77 decoder. This one is intended for the Raspberry Pi platform but might work on other devices using GPIO pins too.

For the Raspberry Pi, connect a stand-alone DCF77 receiver to a GPIO communication pin (default is 17) and the GPIO GND/3.3V pins (not 5V, this will break the Raspberry Pi).

An example schematics of a receiver is shown in receiver.fcd which can be shown using the FidoCadJ package.

The software comes with three binaries and a library:

The meaning of the keywords in config.json is:

Depending on your operating system and distribution, you might need to copy config.json.sample to config.json (in the same directory) to get started. You might also want to check and update the provided configuration to match your setup.


The end of the minute is noted by the absence of high pulses. An absence of low pulses probably means that the transmitter is out of range. Any other situation will result in a logical read error.

With permission (comment 5916), the method described at http://blog.blinkenlight.net/experiments/dcf77/binary-clock is used to receive the bits.

Currently supporrted platforms:

You will need to install a json-c development package and a package providing pkg-config to get the required header files and the .so library files. For example, on FreeBSD:

% sudo pkg install json-c pkgconf

On Linux, you will also have to install an (n)curses development package using your package manager. For example, on Raspbian:

% sudo apt-get install libncurses5-dev libjson-c-dev pkgconf

To build and install the program into /usr/bin , the library into /usr/lib and the configuration file into /usr/etc/dcf77pi :

% make PREFIX=/usr
% sudo make install PREFIX=/usr

On FreeBSD, dcf77pi and dcf77pi-readpin need to be run as root due to the permissions of /dev/gpioc* , but this can be prevented by changing the permissions of the device node:

# chmod 0660 /dev/gpioc*

And to make the change persistent across reboots:

# echo "perm gpioc* 0660" >> /etc/devfs.conf

On Raspbian Linux, the default permissions allow running dcf77pi and dcf77pi-readpin as a normal user (typically "pi"), no extra configuration is needed.

Setting the system time via dcf77pi still requires enhanced privileges (e.g., root).