RTC, XBee, Stalker problem

Hi everyone, i’ll try shortly to describe the problem.
I’ve 2 Seeeduino Stalker boards (328 and 168), 2 XBee-PRO modules and 1 UART_SB v2.2 board, so after i uploaded a sketch like this below on the Stalker 328, happens something strange.

[code]#include <Wire.h>
#include “RTClib.h”

RTC_DS1307 RTC;

void setup () {
Serial.begin(57600);
Wire.begin();
RTC.begin();

if (! RTC.isrunning()) {
Serial.println(“RTC is NOT running!”);
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(DATE, TIME));
}
}

void loop () {
DateTime now = RTC.now();

Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();

Serial.print(" since midnight 1/1/1970 = ");
Serial.print(now.unixtime());
Serial.print("s = ");
Serial.print(now.unixtime() / 86400L);
Serial.println("d");

// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now.unixtime() + 7 * 86400L + 30);

Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();

Serial.println();
delay(3000);

}[/code]

Serial output(connection PC<-UART_SB<-STALKER) is like this

2010/8/19 16:49:2 since midnight 1/1/1970 = 1282236542s = 14840d now + 7d + 30s: 2010/8/26 16:49:32
But then if the connection changed (PC<-UART_SB<-XBEE_C<- <-XBEE_R<-STALKER )
output is like this

2000/0/0 0:0:0 since midnight 1/1/1970 = 2313941504s = 26781d now + 7d + 30s: 2043/5/6 17:32:14

BUT if i use Stalker 168 everything is OK.

Does anyone know what the f*** is it?
Thanks in advance.

Hi!

How are you communicating with the RTC?

When I use the 1307 with my Arduino 328 I need to have this definition in program as well.
#define DS1307_I2C_ADDRESS 0x68 // This is the I2C address
I am sending information using I2C communications. I do not know of any other way.
4 and 6Can you get the time into the 328? When I got the response you are getting
I had the SDA and SCL lines reversed going to Analog channels.

I do not know if this helps or if I am way off. :blush:

Unfortunately, RTClib.h has this definition.
Yesterday i find another Seeeduino Stalker 328, and nothing changed, just the same. When i use XBee RTC switched off(probably).
Actually, i have another project which is using RTC, filelogger, and XBee in transparent mode (but the code is too large to post here). And Stalker with this sketch inside doing the same thing.
When RTC and XBee is used, data which was written in the SDcard is corrupt.

Hi,
we have test your code in a new Seeeduino Stalker 328.
And it works well with RTC and XBee.
How did you power the Stalker(PC<-UART_SB<-XBEE_C<- <-XBEE_R<-STALKER)?
Power from:
5 pin Program port -->5V
White JST power Port–>7~12V

Thanks
Albert