Trouble using 3 xbee units
si8
Posts: 20
I am trying to get 2 bits of info sent from separate xbees to a central xbee but the info keeps getting messed up and i dont know why. Here is a bit of cde from the receiving unit:
recievetemp2:
PAUSE 10
SEROUT Tx,Baud,["+++"]
PAUSE 100
SEROUT Tx,Baud,["ATDL 2",CR]
PAUSE 10
SEROUT Tx,Baud,["ATCN",CR]
PAUSE 100
SERIN Rx\RTS,Baud,[DEC tC2]
PAUSE 1000
RETURN
recievetemp3:
PAUSE 10
SEROUT Tx,Baud,["+++"]
PAUSE 100
SEROUT Tx,Baud,["ATDL 3",CR]
PAUSE 10
SEROUT Tx,Baud,["ATCN",CR]
PAUSE 100
SERIN Rx\RTS,Baud,[DEC tC3]
PAUSE 1000
RETURN
Thank you for your help
recievetemp2:
PAUSE 10
SEROUT Tx,Baud,["+++"]
PAUSE 100
SEROUT Tx,Baud,["ATDL 2",CR]
PAUSE 10
SEROUT Tx,Baud,["ATCN",CR]
PAUSE 100
SERIN Rx\RTS,Baud,[DEC tC2]
PAUSE 1000
RETURN
recievetemp3:
PAUSE 10
SEROUT Tx,Baud,["+++"]
PAUSE 100
SEROUT Tx,Baud,["ATDL 3",CR]
PAUSE 10
SEROUT Tx,Baud,["ATCN",CR]
PAUSE 100
SERIN Rx\RTS,Baud,[DEC tC3]
PAUSE 1000
RETURN
Thank you for your help
Comments
The ATDL command sets the destination for a transmission. Yet in those subroutines it seems with the SERIN like you are expecting it to set something about the reception.
Are these series 1 XBees? Each of the 3 remote XBees will set their DL to match the MY address of the central XB.
I don't see the whole program, but the default requires 2 full seconds of guard time around the +++ to get into command mode.
This is only the subroutines from the receiving unit. Would you like to see more of it?
Yes i am using series 1 xbees. I have since realised i was using "0" as the address of the receiving unit which was not working, But now I there seems to be no comunication at all between the devices. I believe i have the DL and MY matching
I am sitting here with the "getting started with XBee RF modules" book!
Here is a copy of what i got so far...
Reciever:
Can you post a sketch of your circuit and an overview of your project? And please post the full code when you get this resolved.
I just bought a few XBee Series 1 units and plan to monitor several locations for temp and some discrete switch closures. I've planned to use LM34's but it looks like you're using the Sensiron units. Did you need increased accuracy, or did you have a requirement for humidity data?
falcon
I have left my stuff in the lab but will post some more if you want.
I am using the Sensirion due to their 2 in 1 nature, which is exactly what I need. All the coding for it is available here http://emesystems.com/BS2index.htm, thanks to Tracy Allen.
Im still having trouble getting 3 XBees working together...
Be sure the RTS handshaking is set up correctly in hardware, because you have it enabled in the program firmware, also watch out for confusion between the rx and tx lines. There may be blinking lights on the XBee carrier boards that indicate when data is going in or out, and those can help with troubleshooting. It really is best to start off without the sensor data, and just try to send single ascii characters until you are sure of the basic connections.
On the transmitting end, you may eventually add a preamble to each transmission from the remotes, something like this:
The variable myMY is the MY address of the remote transmitter. The receiver can then WAIT for a transmission from that particular remote, here the one with MY=$A.
It can get a lot more involved than that, but maybe that is what you were trying to do with the receiveTemp3 routine. There are many ways to skin a... XBee.