how do I troubleshoot these xbees??
Annoying
Posts: 50
this is very frustrating! So I have two xbees on 5 V/3.3 adapters connected to two separate BS2's. I took them out of the box, soldered the adapter kits, attached the xbees, used this simple code that was in this document (http://selmaware.com/appbee/AppBee_Doc.PDF):
' {$STAMP BS2}
' {$PBASIC 2.5}
RX PIN 0 ' Receive Pin
TX PIN 2 ' Transmit Pin
X VAR Byte
HIGH TX ' Idle transmit pin
DO
X = X + 1
SEROUT TX,84, [noparse][[/noparse]DEC X,CR,CR] ' Send value of X as decimal
' Second CR is added byte buffer for flow control example
PAUSE 500
LOOP
To receive:
' {$STAMP BS2}
' {$PBASIC 2.5}
' ***************************
' simple_rx.bs2
' Example to receive decimal value
' and display in DEBUG Window
' ***************************
RX PIN 0 ' Receive Pin
TX PIN 2 ' Transmit Pin
X VAR Byte
HIGH TX ' Idle transmit pin
DO
SERIN RX, 84, [noparse][[/noparse]DEC x] ' Receive data
DEBUG DEC X, CR
LOOP
It did not work. The green ASC LEDs were blinking on the two adapters at first and suddenly one of them stopped blinking and now whenever I connect that adapter to power, the red RSS LED·is·dimly on. I have no idea why. I'm also confused about the "configuration" that·is also in that document.·First of all, I don't understand the purpose of the configuration. I did it anyway and it said "configuration complete" when I tried the code for both adapters. I checked that the adapters are getting 5 V. I have an oscilloscope I tried to use for debugging, but·it doesn't even show a change when I put the oscilloscope lead on the TX pin.·Where do I go from here? How can you test each·xbee module·individually? I swapped the xbees between the two adapters and the·adapter that wasn't blinking green remained the same, so I know the xbee itself isn't to blame for that. ·
' {$STAMP BS2}
' {$PBASIC 2.5}
RX PIN 0 ' Receive Pin
TX PIN 2 ' Transmit Pin
X VAR Byte
HIGH TX ' Idle transmit pin
DO
X = X + 1
SEROUT TX,84, [noparse][[/noparse]DEC X,CR,CR] ' Send value of X as decimal
' Second CR is added byte buffer for flow control example
PAUSE 500
LOOP
To receive:
' {$STAMP BS2}
' {$PBASIC 2.5}
' ***************************
' simple_rx.bs2
' Example to receive decimal value
' and display in DEBUG Window
' ***************************
RX PIN 0 ' Receive Pin
TX PIN 2 ' Transmit Pin
X VAR Byte
HIGH TX ' Idle transmit pin
DO
SERIN RX, 84, [noparse][[/noparse]DEC x] ' Receive data
DEBUG DEC X, CR
LOOP
It did not work. The green ASC LEDs were blinking on the two adapters at first and suddenly one of them stopped blinking and now whenever I connect that adapter to power, the red RSS LED·is·dimly on. I have no idea why. I'm also confused about the "configuration" that·is also in that document.·First of all, I don't understand the purpose of the configuration. I did it anyway and it said "configuration complete" when I tried the code for both adapters. I checked that the adapters are getting 5 V. I have an oscilloscope I tried to use for debugging, but·it doesn't even show a change when I put the oscilloscope lead on the TX pin.·Where do I go from here? How can you test each·xbee module·individually? I swapped the xbees between the two adapters and the·adapter that wasn't blinking green remained the same, so I know the xbee itself isn't to blame for that. ·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
http://selmaware.com/appbee/AppBee_Doc.PDF
You should also download a copy of the XBee manual from Digi, and read through the first sections. If you're going to work with XBees, there's a lot you should learn to make your work easier.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
http://www.digi.com/support/productdetl.jsp?pid=3352&osvid=57&tp=5&s=316
I clicked on "PKG-U USB Drivers for Windows 98 SE - XP" and after unzipping the folder, clicked on FTDIUNIN.exe and it gave me the error:
Error, file not found
C:\Windows\system32\FTDIUN2K.INI
Press Finish to exit.
is this the right way to get X-CTU? thanks.
The nicest thing about changing the settings through the code is that you don't have to remember which XBee was set up with which settings.
Accel VAR WORD
Then Accel.HighByte and Accel.LowByte refer to the two bytes that make it up. Send the two separately, and you can deal with the variable as though you'd sent it all at once.
TRANSMITTING:
RX PIN 12 ' Receive Pin
TX PIN 13 ' Transmit Pin
Yin PIN 10 ' Y input from Memsic 2125
HiPulse CON 1 ' measure high-going pulse
pulse VAR Word
Main:
PULSIN Yin, HiPulse, pulse
HIGH TX ' Idle transmit pin
DO
SEROUT TX,84, [noparse][[/noparse]DEC pulse.HIGHBYTE,DEC pulse.LOWBYTE,CR,CR]
DEBUG ? pulse
PAUSE 500
LOOP
RECEIVING:
RX PIN 7 ' Receive Pin
TX PIN 6 ' Transmit Pin
pulse VAR Word
HIGH TX ' Idle transmit pin
DO
SERIN RX, 84, [noparse][[/noparse]DEC pulse.HIGHBYTE, DEC pulse.LOWBYTE]
DEBUG ? pulse
LOOP
THANK YOUUUUU!!!
· Because the receiver is only·expecting two bytes, it easily gets out of sync with the transmitter. What you are debugging is some combination of highbyte + lowbyte, or lowbyte plus CR,·CR + CR, or CR+highbyte.
· The way to fix it is to always send a special character (like *) before highbyte and lowbyte. On the receiver, use the WAIT instruction with SERIN to tell it to only grab the two bytes after it sees the *.
· On Transmitter: SEROUT TX,84, [noparse][[/noparse]"*",DEC pulse.HIGHBYTE,DEC pulse.LOWBYTE,CR,CR]
· On Receiver:· SERIN RX, 84, [noparse][[/noparse]Wait ("*"), DEC pulse.HIGHBYTE, DEC pulse.LOWBYTE]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·