Another Xbee Problem - Rubbish coming via hyperterminal

Xbee projects like the adapter, xbee tutorials, tweetawatt/wattcher, etc. purchased at Adafruit

Moderators: adafruit_support_bill, adafruit

Another Xbee Problem - Rubbish coming via hyperterminal

Postby alaska1717 » Fri Feb 20, 2009 9:05 am

Hi,
I have made a program on the sending end:


//Reads data from 0 and 1 and relays back to reciver
//lmc

int light = 0;
int temp = 1;
int thirteen = 13;

int lightval;
int tempval;

void setup(){
Serial.begin(19200);
Serial.println('Bonjour =]');
pinMode(light, OUTPUT);
pinMode(temp, OUTPUT);
pinMode(thirteen, OUTPUT);
digitalWrite(thirteen, HIGH);
delay(1000);
digitalWrite(thirteen, LOW);
}

void loop(){

digitalWrite(thirteen, HIGH);
Serial.print(analogRead(light));
Serial.print(',');
Serial.println(analogRead(temp));
delay(500);
digitalWrite(thirteen, LOW);
delay(500);
}




The code reads the analog inputs and outputs it over the serial after putting a comma in between the two of them. I have connected the xbee module correctly as otherwise I would get nothing coming from the xbee module. I have tried reloading the firmware on (10CD is my latest) and all I get on the serial line is something like this:
[J:.[*:.*J.K*J:.[*J.*J:.K*J.[J:.[J:.*J:.I*J:.[*:.*J..[*:.[*J:.[*:.K*:.[J:.[J:.K*:.[J;.K+J;.
over and over again, every second, like it should send above.

Why on earth is it doing this?
I am using a 3.3v Arduino pro and the Arduino software is in lilypad mode
The receiving module is using my working ladyada xbee module board and a 5v ttl232 cable.
Thanks
alaska1717
 
Posts: 8
Joined: Sat Feb 14, 2009 8:23 am

Re: Another Xbee Problem - Rubbish coming via hyperterminal

Postby 33Warlord » Fri Feb 20, 2009 12:57 pm

Of the top of my head, the garbage looks a lot like a baud rate inconsistency.

I'm wondering if the baud rate is set the same on both the sender and receiver? If so, has been the baud rate configuration of both XBees been changed to 19200? Your code initializes the Serial port to 19200, but the XBee's themselves default to 9600 (unless you change in X-CTU or via command mode).

If the baud rate is the same, and has been changed on both XBee modules, then perhaps you can view the debug print directly on the sending node to verify that the correct data is going into the XBee.

If the data is correct before getting transmitted via XBee, yet it's incorrect on the receiving end, then i would start trying some basic XBee tests (like manual ASCII transmissions). This will tell you if its an XBee config issue (likely) or an esoteric oversight in the code that causing a variable type mismatch (for example a botched DEC to ASCII conversion).
33Warlord
 
Posts: 22
Joined: Fri Oct 31, 2008 12:12 am

Re: Another Xbee Problem - Rubbish coming via hyperterminal

Postby alaska1717 » Fri Feb 20, 2009 2:41 pm

*headesk* thanks very much. I knew that it was xbee related as plugging in the ftdi cable got the intended result. Thanks very much, part deux of my project is set for sail =] i am replying from phone as i am bored at a party so will check this later.
alaska1717
 
Posts: 8
Joined: Sat Feb 14, 2009 8:23 am


Return to XBee products from Adafruit

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [105]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]