Xbee trouble
Just setup a AppMod with XBEE and on the PC side a New Micro USB Donggle with XBEE ... I can not see to get the two to talk ... Looks like when I reset my BOE and it TX LED flashes·the RX LEDs on the USB Dongle XBEE (PC side) lights up ... how ever I never see any RX LED activity on the AppMod board on the BOE side? How can I debug it the BOE is recieving anything?··
Comments
1) Have you configured both xBee devices using the PC utility program from the manufacturer? If not, how did you configure them?
2) How did you set up the AppMod? It doesn't come already connected to the Stamp itself, just to power.
3) How did you set up the USB dongle with the xBee? What are you using on the PC side for communications? Maybe the PC isn't sending anything.
You really have to check each step of the way:
1) Is there power supplied to both xBees (it sounds like it)
2) Is data being transmitted from the PC to the xBee?
3) Is the PC xBee transmitting to the Stamp one?
4) Is the Stamp-side xBee sending the data to the Stamp
5) Can the Stamp display (via DEBUG or something else) the correct received data?
Then you go back the other way asking the same questions from the Stamp to the PC.
This assumes that the xBees were configured properly with each knowing the proper
address of the other and with the proper Baud, etc. that their end of the link is expecting.
' {$STAMP BS2}
' {$PBASIC 2.5}
myAddr··· CON $1
DestAddr· CON $0
Baud····· CON 84
RX······· PIN 0
TX······· PIN 2
RTS······ PIN 6
HIGH TX
DEBUG CLS, "Configuring XBee..."
PAUSE 2000······························ ' Guard time for command sequence
SEROUT TX,Baud,[noparse][[/noparse]"+++"]·················· ' Enter command mode
PAUSE 2000······························ ' Guard time for command sequence
SEROUT TX,Baud,[noparse][[/noparse]"ATNI BS2 Test Node",CR, ' Set description
·············· "ATMY ", HEX myAddr,CR,·· ' Set node address
·············· "ATDL ", HEX DestAddr,CR, ' Set destination node address
·············· "ATD6 1",CR,············· ' Use RTS for flow control
·············· "ATCN",CR]··············· ' Exit command mode
PAUSE 1000
DEBUG "Configuration Complete!",CR
DO
· SEROUT TX,Baud,[noparse][[/noparse]"Hello Node!",CR]
· PAUSE 1000
LOOP
Have you tried exchanging the two xBee modules?
Again, I would check all the configuration parameters and the wiring.
·FWD it moves once and sits for a while ... then sort of hangs? Also if I load base code and use com8 termwind to TX ... the RX LED shows activity fine on appmod·... I guess I have some code issue??? Also once the XBEE is set up with base config ... I should be able to push new code with out the Serial cable right? Cause when I do an Identify in Stamp editor ... it shows com1 --- Stamp but com8 shows no stamp ????·
Ahhhh I am so confused at this point [noparse]:([/noparse]
' {$STAMP BS2}
' {$PBASIC 2.5}
' **************************************
' * Robot network control.············ *
' * Electronic Systems Technology Club *
' * Southern Illinois University······ *
' * www.siu.edu/~isat/est············· *
' **************************************
myAddr··· CON $1···· ' Node Address ******* change for each ********
DestAddr· CON $0···· ' Destination address
Baud····· CON 84···· ' Baud rate, 9600, 8-N-1, non-inverted, on BS2.
RX······· PIN 0····· ' Receive Pin
TX······· PIN 2····· ' Transmit Pin
RTS······ PIN 6····· ' Flow control Pin
Left····· PIN 15···· ' Servo
Right···· PIN 14···· ' Servo
IrRight·· PIN 1
IrLeft··· PIN 9
IrLEDRight· PIN 2
IrLEDLeft·· PIN 8
Action VAR Byte
irDetectLeft VAR Word
irDetectRight VAR Word
datain· VAR Byte
x VAR Word
HIGH TX
· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,", Configurating XBee.. ", datain,CR]
PAUSE 2000······························ ' Guard time for command sequence
SEROUT TX,Baud,[noparse][[/noparse]"+++"]·················· ' Enter command mode
PAUSE 2000······························ ' Guard time for command sequence
SEROUT TX,Baud,[noparse][[/noparse]"ATMY ", HEX myAddr,CR,· ' Set node address
·············· "ATDL ", HEX DestAddr,CR, ' Set destination node address
·············· "ATD6 1",CR,············· ' Use RTS for flow control
·············· "ATRO 50",CR,············ ' Increase packet timeout to keep data together
·············· "ATCN",CR]··············· ' Exit command mode
PAUSE 1000
· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,", Configuration Complete! ", datain,CR]
DO
· SERIN rx\RTS,84,2,timeout,[noparse][[/noparse]datain]···· ' Accept data
· SELECT datain
·· CASE "F"····························· ' Report back action
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",Going Forward! ",CR]
·· CASE "S"
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",I'm stopped! ",CR]
·· CASE "L"
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",Moving left! ",CR]
·· CASE "R"
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",Moving right! ",CR]
·· CASE "B"
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",Backing up! ",CR]
·· CASE "A"
····· SEROUT tx,84,[noparse][[/noparse]DEC myaddr,",Auto mode! ",CR]
· ENDSELECT
timeout:································ ' Take action
SELECT datain
·· CASE "F"
····· GOSUB Forward
·· CASE "S"
····· PAUSE 2
·· CASE "L"
····· GOSUB TurnLeft
·· CASE "B"
····· GOSUB Backwards
·· CASE "R"
····· GOSUB TurnRight
·· CASE "A"
····· FREQOUT IrLEDLeft, 1, 38500
····· irDetectLeft = IrLeft
····· FREQOUT IrLEDRight, 1, 38500
····· irDetectRight = IrRight
··· IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
····· IF Action <> "B" THEN SEROUT Tx, 84, [noparse][[/noparse]DEC myaddr,",Auto: Back", CR]
····· Action ="B"
····· FOR x = 1 TO 20
······· GOSUB Backwards
····· NEXT
··· ELSEIF (irDetectLeft = 0) THEN
····· IF Action <> "L" THEN SEROUT Tx, 84, [noparse][[/noparse]DEC myaddr,",Auto: Left", CR]
····· Action = "L"
····· GOSUB TurnLeft
··· ELSEIF (irDetectRight = 0) THEN
····· IF Action <> "R" THEN SEROUT Tx, 84, [noparse][[/noparse]DEC myaddr,",Auto: Right", CR]
····· Action = "R"
····· GOSUB TurnRight
··· ELSE
····· IF Action <> "F" THEN SEROUT Tx, 84, [noparse][[/noparse]DEC myaddr,",Auto: Forward ", CR]
····· Action = "F"
····· GOSUB Forward
····· ENDIF
····· ENDSELECT
PAUSE 15
LOOP
Forward:······························· ' Move routines
· PULSOUT left, 1000
· PULSOUT right, 500
· RETURN
TurnLeft:
· PULSOUT left, 900
· PULSOUT right,900
· RETURN
TurnRight:
· PULSOUT left, 600
· PULSOUT right,600
· RETURN
Backwards:
· PULSOUT left, 500
· PULSOUT right,1000
· RETURN
The only wireless downloading device is the ToothPic which Parallax no longer carries (although it's available from the manufacturer).
Make sure you have adequate power. Strange things happen when the batteries are low. Try debugging with power supplied with a proper AC supply. You may want to debug your program with a wired serial connection if you're not sure of the xBee connection.