Hello I would please like some help if someone is available. I am trying to send the temperature data and date time stamp over the XBEE to another XBEE. I have everything set with the Xbees I can send and receive using the XCTU software and it seems to work as advertised. Also I’ve done the program for temperature, date and time on the seeeduino and it works it gives me the temp and date time info over serial monitor. The problem arises when I try to send the data using the XBEE on the seeeduino itself, both XBEEs connect to each other but, How do I transfer the data that the DS3231 is giving me over XBEE to read on the Coordinator side? If someone could help me with an example code of the XBEE sending temp data with time I would greatly appreciate it. I have not found much just that I2C can’t be send over XBEE, but if that was the case then seeeduino would not have made a board that integrated both systems. I’m sure that if I2C can’t be send over XBEE then there is another way to send the data, I just don’t know it yet. Thanks for your all help in advanced.
Made progress thanks to Chopin from seeedstudio for helping me with some of my issues. Here is my small project so anyone that has my same questions could maybe have some progress also. There is both RX and TX, make sure to upload accordingly.
/*
December/17/2015
This example worked with XBee on a Nano IO Shield from iteadstudio.com and Seeeduino Stalker v2.3 to send I2C data over XBee.
This one sends the temperature in degF but it can be switch to degC very easily. XBees were set with 9600 baud, on AT Coordinator and AT Router.
Remember to have all the settings on the XBee’s right and they have to be communicating with each other. You can do that with the XCTU software
there are plenty of informative tutorials on how to set them up. You will also need a FTDI to USB (cable or board) and a XBee adapter
board. I used the Inland FTDI Adapter USB Controller Part# 204446 that has a 3.3V and 5V switch on the board itself
(I used it on the 5V setting with no problems what so ever). The adapter used to upload the XCTU settings to the XBee was the Adafruit
XBee Adapter v1.1 (some soldering required but well built and EXTREMELY worth it, do not hesitate to but from them). Also remember that
you will need 2 XBees, one Receives the other Transmits, you might want to have 2 of everything so you can test as you go and make sure everything
is alright. Having the XBee connected while trying to upload a sktech will trigger an AVRDude error.
*/
// Upload this sketch on board that is connected to the XBee with AT Coordinator setting
// !!! If you get an AVRDude error check and make sure that you are not trying to upload a sketch with the XBee connected !!!
#include <SoftwareSerial.h>
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}
void loop()
{
while(Serial.available() > 0) {
char inByte0 = Serial.read();
Serial.print(inByte0, DEC);
}
Serial.println();
delay(1000);
}
###################################################################################################################################################
// Upload this sketch on the Seeeduino Stalker board with the XBee that has the AT Router setting if you want the temperature in degC
// uncomment Serial.print(degC) and comment out Serial.print(degF) or leave both if you want both temperatures
// !!! If you get an AVRDude error check and make sure that you are not trying to upload a sketch with the XBee connected !!!
#include <Wire.h>
#include “DS3231.h”
DS3231 RTC; //Create the DS3231 object
void setup ()
{
Serial.begin(9600);
Wire.begin();
RTC.begin();
}
void loop ()
{
RTC.convertTemperature();
char degC = (RTC.getTemperature());
//Serial.print(degC);
char degF = (((RTC.getTemperature() *9) /5) +32);
Serial.print(degF);
delay(1000);
}