Home › Forums › EasyTransfer Library Support Forum › transmitting unit freezes
- This topic has 0 replies, 1 voice, and was last updated 9 years, 1 month ago by Anonymous.
-
AuthorPosts
-
August 26, 2015 at 11:38 am #3331AnonymousInactive
Hi – thanks for the great library and support!
I am working on a project where I am sending GPS data from one Teensy 3.1 to another Teensy 3.1 wirelessly using two xBees.
The unit sending needs to send its data rather quickly.
I am using EasyTransfer to help send the data.
The system works well for 30 seconds so, but after a bit the stream freezes. As soon as I power off and power on the sending unit, the stream (reading on the receiver end) comes back immediately.
[CODE]#include “GPSdefs.h” //this has variables and definitions for This Unit’s GPS
#include <EasyTransfer.h>//create object
EasyTransfer ET;struct SEND_DATA_STRUCTURE{
//put your variable definitions here for the data you want to send
//THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
int LEADnorth;
int LEADeast;
};//give a name to the group of data
SEND_DATA_STRUCTURE mydata;void setup() {
Serial.begin(9600); //for debugging and local
Serial2.begin(115200); //GPS on serial 2
Serial3.begin(115200); //Serial for xBee//Start EasyTransfer on Serial3
ET.begin(details(mydata), &Serial3);
}void loop() {
//Read from GPS on serial2
while (Serial2.available () > 0)
{
processIncomingByte (Serial2.read (),timestamp,north,east,latitude,longitude, newdata);
}
if (newdata==true)
{
Serial2.flush();//for local reading and debugging
Serial.print(“timestamp “);
Serial.print(timestamp);
Serial.print(F(” north “));
Serial.print((north));
Serial.print(F(“,”));
Serial.print(F(” east “));
Serial.print((east));
Serial.print(F(“,”));
Serial.print(” latitude “);
Serial.print(latitude,7);
Serial.print(” longitude “);
Serial.print(longitude,7);
Serial.println();//Send to follower unit over xBee on serial3 using EasyTransfer
//this is how you access the variables. [name of the group].[variable name]
mydata.LEADnorth = north;
mydata.LEADeast = east;
//send the data
ET.sendData();}
else {
mydata.LEADnorth = 999999;;
mydata.LEADeast = 999999;
}
}[/CODE]Some trouble shooting notes:
When I monitor the output from the transmitting unit ON the transmitting unit (via Serial output) — it doesn’t freeze. So somehow the transmit part of it gets overloaded and causes the freeze on the receiver side. Again, powering off and on the transmitter unit immediately resolves it.
Could someone help me out with what I assume is a buffer/memory size issue? Or could I be running into the byte limit of EasyTransfer? (has to be under 255)
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.