Problems with Due and DCF77

Hi folks,

I have been searching the whole (yes, it’s true! :wink: ) internet to solve this problem. But I couldn’t find anything helpful.

I am pretty new on Arduino development and I am working on a project.

I am trying to get a work DCF77 receiver working with my Arduino Due. But the library DCF77.h seems not to be compatible with the Due. I haven’t found a library for the DCF77 working with it yet.
I am using IDE 1.5.4 and I also tried it with 1.5.5 beta.

The following errors appear:

Arduino: 1.5.4 (Windows NT (unknown)), Board: “Arduino Due (Programming Port)”

In file included from c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin…/lib/gcc/arm-none-eabi/4.4.1/…/…/…/…/arm-none-eabi/include/sys/stat.h:9,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/syscalls.h:32,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x/variant.h:50,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Arduino.h:196,
from C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:5,
from sketch_dec28d.ino:13:
C:\Program Files (x86)\Arduino\libraries\Time/time.h:15: error: conflicting declaration ‘typedef long unsigned int time_t’
c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin…/lib/gcc/arm-none-eabi/4.4.1/…/…/…/…/arm-none-eabi/include/sys/types.h:109: error: ‘time_t’ has a previous declaration as ‘typedef long int time_t’
In file included from c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin…/lib/gcc/arm-none-eabi/4.4.1/…/…/…/…/arm-none-eabi/include/sys/stat.h:9,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/syscalls.h:32,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\variants\arduino_due_x/variant.h:50,
from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Arduino.h:196,
from C:\Program Files (x86)\Arduino\libraries\DCF77/DCF77.h:5,
from sketch_dec28d.ino:13:
C:\Program Files (x86)\Arduino\libraries\Time/time.h:105: error: declaration of C function ‘void setTime(int, int, int, int, int, int)’ conflicts with
C:\Program Files (x86)\Arduino\libraries\Time/time.h:104: error: previous declaration ‘void setTime(time_t)’ here
C:\Program Files (x86)\Arduino\libraries\Time/time.h: In function ‘void loop()’:
C:\Program Files (x86)\Arduino\libraries\Time/time.h:105: error: too few arguments to function ‘void setTime(int, int, int, int, int, int)’
sketch_dec28d:36: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h: In function ‘void digitalClockDisplay()’:
C:\Program Files (x86)\Arduino\libraries\Time/time.h:83: error: too few arguments to function ‘int hour(time_t)’
sketch_dec28d:43: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h:91: error: too few arguments to function ‘int minute(time_t)’
sketch_dec28d:44: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h:93: error: too few arguments to function ‘int second(time_t)’
sketch_dec28d:45: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h:95: error: too few arguments to function ‘int day(time_t)’
sketch_dec28d:47: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h:99: error: too few arguments to function ‘int month(time_t)’
sketch_dec28d:49: error: at this point in file
C:\Program Files (x86)\Arduino\libraries\Time/time.h:101: error: too few arguments to function ‘int year(time_t)’
sketch_dec28d:51: error: at this point in file

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

I used an example Code:

/*
 * InternalClockSync.pde
 * example code illustrating time synced from a DCF77 receiver
 * Thijs Elenbaas, 2012
 * This example code is in the public domain.
 
  This example shows how to fetch a DCF77 time and synchronize
  the internal clock. In order for this example to give clear output,
  make sure that you disable logging  from the DCF library. You can 
  do this by commenting out   #define VERBOSE_DEBUG 1   in Utils.cpp. 
 */

#include "DCF77.h"
#include "Time.h"

#define DCF_PIN 2	         // Connection pin to DCF 77 device
#define DCF_INTERRUPT 0		 // Interrupt number associated with pin

time_t time;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);


void setup() {
  Serial.begin(9600); 
  DCF.Start();
  Serial.println("Waiting for DCF77 time ... ");
  Serial.println("It will take at least 2 minutes until a first update can be processed.");
}

void loop() {
  delay(1000);
  time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available
  if (DCFtime!=0)
  {
    Serial.println("Time is updated");
    setTime(DCFtime);
  }	
  digitalClockDisplay();  
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

Maybe you can help me. It would be awesome!

Thanks
CyrusXX