Processing example: "XBee fails to initialize"

206 views
Skip to first unread message

shrestsn

unread,
Feb 28, 2012, 1:54:01 AM2/28/12
to xbee-api
I ran the example code provided in the Processing wiki.
http://code.google.com/p/xbee-api/wiki/Processing

I got the following error that suggested enabling API mode.

XBee failed to initialize
com.rapplogic.xbee.api.XBeeException: AT command timed-out while
attempt to set/read in API mode. The XBee radio must be in API mode
(AP=2) to use with this library
at com.rapplogic.xbee.api.XBee.doStartupChecks(XBee.java:124)
at com.rapplogic.xbee.api.XBee.initConnection(XBee.java:170)
at com.rapplogic.xbee.api.XBee.open(XBee.java:142)
at sketch_feb20a.setup(sketch_feb20a.java:73)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)


So, I added the following line of code to enable API mode only to get
the same error mentioned above.
xbee.sendAtCommand(new AtCommand("AP", 2));

Is it a connection problem with the XBees or am I missing something on
the coding side?

andrew

unread,
May 28, 2013, 10:59:44 AM5/28/13
to xbee...@googlegroups.com, shre...@gmail.com
You can't use API mode to put the radio in API mode. The radio by default is in AT mode and you can simply open a terminal to your radio and set AP=2. Only if this is a series 1 radio. If series 2 then you need a firmware update
Reply all
Reply to author
Forward
0 new messages