Pages: [1] 2   Go Down
Author Topic: Xbee problems  (Read 1470 times)
0 Members and 1 Guest are viewing this topic.
Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, im new to this forum and this post is most likely in the wrong spot but... I have been trying to figure out my xbees they are series one and ive been attempting to send the value 100 over to a different arduino. The problem is that i receive weird numbers; this is what i get back:
Ready!
6
129
0
1
59
0
100
222
126
0
6
129
0
1
59
0
100
222
126
0
6
129
0
1
62
0
100
219
126
0
6
129
0
1
63
0
100
218
126
0
6
i receive 100 every now an then but not repetitive. my baud rate is set at 19200. ANY help is appreciated.
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure that baud rate matches the XBee? IIRC the default rate is 9600.

I have a few XBee software examples at
http://wiblocks.luciani.org/ZB1/index.html

Also I have some XBee setup examples in the ZB1 datasheet
on the same page.

(* jcl *)

------------------------------------
www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org

Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Didnt seem to work now im receiving characters that make no sence like: b[ch132]:ótEch133]FóEóDEóEóDóEch132]5ch132]EójFóEó¤EóEóD

is what i got back any other suggestions?
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It is strange that in the first example you always get ASCII
digits and not garbage (like the second example).
Are you sure you are always sending the string "100" ?
Are you measuring an A/D value that could be floating
and then sending the ASCII string that represents a
random result?

Can you confirm the BAUD rate of both devices with XCTU?
Is there anything else connected to the RX and TX lines?

The only other suggestion I have would be to try one of my
examples. I know these work. Just adjust the baud rates,

(* jcl *)
Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is the code:
transmitter:
int analogValue2, analogValue5, val2, val5;

void setup()
{
// start serial port at 19200 bps
Serial.begin(19200);
}

void loop()
{
// read analog input
analogValue2 = analogRead(2);


// remap values

val2 = map(analogValue2, 0, 1023, 253, 0);  // 254 and 255 for SYNC

Serial.print(100, DEC);

delay(150);
}

It only prints 100.

do you have a example code?
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you saying it is working? Only the string "100" is printed?

(* jcl *)
Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

no it's not im still receiving garbage, and i did confirm the baud.
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are some example sketches on my site that transmit ones and zeros.

You could veriy one more thing -- with the transmitting XBee disconnected
verify the serial output using the serial monitor.

(* jcl *)
Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah i cant seem to get it going i dont know what the problem is.
Logged

Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay now with the xbee set to 9600 im now receiving the same number as the first post
Logged

Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Whats weird is i receive 100 every 10th line.
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Make a simple program without the analog commands.

In the setup section one line --

Code:
Serial.begin(9600);

In the loop section one line

Code:
Serial.print("HELLO WORLD\r");

(* jcl *)
Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how would i do the receiver code?
Logged

Boston, MA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1024
wiblocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the sample code on my site.

(* jcl *)
Logged


Dallas, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 170
Check out my blog on your smartphone!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry man can you make a link i cant find it on there.
Logged

Pages: [1] 2   Go Up
Jump to: