I suspect a problem with the RTC function of the Teensy 3.x with TeensyRTC.h (updated library?)
[Solution: Don't know what the exact problem is, but it has to do with Synching between System time and Teensy3Clock, workaround in #4]
On my Teensy 3.1 doing a Teensy3Clock.set(1427018955); (e.g.) and then asking for the time results in a: 0:01:20 1-1-1970 that seems to be more the elapsed time since system startup. I'm using the 1.6.0 IDE and Teensyduino 1.2.1
After setting the clock I call this method:
First I was suspecting the backup battery being empty but after testing and trying to synch the Teensy from my iOS device that just sends the UNIX time over iOS I don't see the time being updated so...
Here is how I do the updating of the Time from iOS:
Time synch message
1427021121
0:00:23 1-1-1970
and that is the output of:
[Solution: Don't know what the exact problem is, but it has to do with Synching between System time and Teensy3Clock, workaround in #4]
On my Teensy 3.1 doing a Teensy3Clock.set(1427018955); (e.g.) and then asking for the time results in a: 0:01:20 1-1-1970 that seems to be more the elapsed time since system startup. I'm using the 1.6.0 IDE and Teensyduino 1.2.1
After setting the clock I call this method:
Code:
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();
}
First I was suspecting the backup battery being empty but after testing and trying to synch the Teensy from my iOS device that just sends the UNIX time over iOS I don't see the time being updated so...
Here is how I do the updating of the Time from iOS:
Time synch message
1427021121
0:00:23 1-1-1970
and that is the output of:
Code:
if ((inputbuf[0] == 't') && (maxbp == 11)) {
Serial.println("Time synch message");
time_t newTime = 0;
for (int t = 1; t <= 10; t++) {
newTime = newTime*10 + (inputbuf[t]-'0');
}
Serial.println(newTime);
Teensy3Clock.set(newTime);
digitalClockDisplay();
}
Last edited: