Thank you for responding. There are a lot of supporting classes so I’ll simply include the main loop on the receiving device:
void loop()
{
if(XBee.available()) {
incomingData = XBee.readString();
if(incomingData != “”) {
Serial.println(network.getLabel() + “:” + logger.formatResults(incomingData));
Serial.println(incomingData); // This will also print the erroneous string
} else {
Serial.println(“Xbee available, no data”);
}
digitalWrite(ledRXPin, LOW);
} else {
digitalWrite(ledRXPin, LOW);
}
}
Note the two Serial.println() calls. The first is the original code and the second was to quickly see if I was goofing something up.
Here is the sending device setup and main loop:
void setup()
{
Serial.begin(BAUD_RATE);
XBee.begin(BAUD_RATE);
pinMode(13, OUTPUT); // We simply blink the 13 led when we send data
// 1. Here we are directly setting the label that will help us visually identify
// this reporting board when looking at the data.
reporter.setLabel(“Reporter R1”);
// 2. Add a sensor to the collection. This is an analog sensor attached to port 0. We
// are giving in an arbitrary ID of 1.
my_sensor_collection.addSensor(1, 0, PIN_TYPE_ANALOG, “Potentiometer”);
my_sensor_collection.addSensor(2, 1, PIN_TYPE_ANALOG, “Temperature”);
}
void loop()
{
ESN_Sensor current_sensor;
/**
*/
// Reset the internal pointer on the sensor collection
my_sensor_collection.reset();
digitalWrite(13, HIGH);
// Loop through all the sensors
for(int i = 1; i < my_sensor_collection.getSensorCount() + 1; i++) {
// Get the current sensor
current_sensor = my_sensor_collection.getNextSensor();
Serial.println(reporter.getLabel() + “:” + current_sensor.getLabel() + “:” + (String) current_sensor.readValue().value);
// The logger has an issue parsing lines based on \n character. For this reason, we are going to send sensor data one reading
// at a time.
delay(TRANSMIT_DELAY);
}
digitalWrite(13, LOW);
}
If you look at the setup method on the “sending” device, I will have problems with those "p"s. However, I changed it to REPORTER R1 and the sensors to TEMP and POTS and I have not seen a problem in 3 days. That’s about 10,000 transmissions.
The Baud rate is 19200. I raised in attempt to deal with data collisions. The idea is to run 10 - 20 “sending” devices.
Thanks again for any help. I can make due with using caps but I sure would like to know what the heck is going on.