Remote AT commands aren't working

92 views
Skip to first unread message

Aaron Peirce

unread,
Apr 7, 2012, 12:34:31 AM4/7/12
to xbee-api
Hello,

First, here is how is have everything set up:

I have 1 Xbee radio set as "coordinator API" hooked to my computer.
(64-bit address is "0013A200 4064F504").
A second Xbee radio set as "remote AT" (64-bit address is: "0013A200
40763578"). This one has its D1, D2, D3 and D4 pins set as digital
output which are used as control lines to an analog multiplexer (the
mux has 16 inputs, which is too many to feed directly into the xbee).
The output of the analog multiplexer is going into pin 20 , which is
set up as an ADC with sampling rate 250ms.

Here's the problem:
Everything is working completely smoothly, except issuing AT commands
to the remote Xbee radio. I'm trying to periodically issue 8
different commands via the java API (at different time intervals):
"ATD1 4", "ATD1 5", ATD2 4", "ATD2 5", "ATD3 4", "ATD3 5", "ATD4 4",
and "ATD4 5". None of these commands end up i the Data output pins
being changed. They stay at their initial value.

If you look in the beginning of the program I linked below, the first
8 commands return good packets that make it look like stuff was set
right (you can see the output in the second link below). However, when
I start to issue commands in a loop, the address fields change..

Please let me know if I'm doing something wrong, because I can't seem
to figure out why the pins won't set!

If you want to see how I'm issuing commands, here's a pastebin of my
java code:
http://www.pastebin.com/beankhKu

Here's a sample of the output I'm seeing when running the program:
http://www.pastebin.com/VPs9kHM8

Thanks for your time, let me know if you need more information

Andrew Rapp

unread,
Apr 10, 2012, 11:52:29 AM4/10/12
to xbee...@googlegroups.com
Hi,

The problem is you need to use int and not char in your addressing.  You have

  1.         RemoteAtRequest a1 = new RemoteAtRequest(destination, "DH"
  2.                                         + new int[] {'0','0', '1','3', 'A', '2', '0', '0'});

Should be

new int[] {0x0,0x0, 0x1,0x3, 0xA, 0x2, 0x0, 0x0});

When you use '0' in an int, it takes the ascii value, which you can see from this chart is 48 http://web.cs.mun.ca/~michael/c/ascii-table.html

Remember most all XBee numbers are hex, so need the 0x prefix.



--
You received this message because you are subscribed to the Google Groups "xbee-api" group.
To post to this group, send email to xbee...@googlegroups.com.
To unsubscribe from this group, send email to xbee-api+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xbee-api?hl=en.


Aaron Peirce

unread,
Apr 11, 2012, 9:51:18 PM4/11/12
to xbee...@googlegroups.com
Thank you for the reply.

I have 1 more question to ask (I would test it myself, but can't do so for a few days)

When building a RemoteAtRequest object, do I need to include a space between the command and the parameter? E.g.  insert a space at the end of the string like this: RemoteAtRequest(dest, "D1 " + new int[] {0x05} )

Thanks

Andrew Rapp

unread,
Apr 13, 2012, 9:50:01 AM4/13/12
to xbee...@googlegroups.com
That won't work. You need to separate the command name and value.  Take a look at the doc http://xbee-api.googlecode.com/svn/trunk/docs/api/com/rapplogic/xbee/api/RemoteAtRequest.html
Reply all
Reply to author
Forward
0 new messages