I am a little confused whether it is possible to send remote AT command (specifically ND) through API packet.
Hardware: XBee 802.15.4, FW 10E6.
Yes - it is very possible to do this -- or at least it is for the XBee ZB modules -- what follows assumes that the API for the 802.15.4 modules is equivalent.
This assumption seems reasonable, based on a quick look at the 802.15.4 module documentation
, pg 60.
Quick version --- here is a sample line that does work for the ZB version and should work for you, when sent from the XCTU:
7E 00 0F 17 01 00 13 A2 00 nn nn nn nn FF FE 00 4E 44 ZZ [0D]
- each pair above is a single byte -- e.g. "7E" is the hex byte 0x7E, etc.
- "nn nn nn nn" is the low 4 bytes of the 64 bit address of the module you are commanding
- "ZZ" is the correctly calculate checksum for the API command (from the 0x17 to the "0x44").
- 0x0D is an ASCII carraige return
To try this using the XCTU tool, be sure to
0. go to the terminal tab and click the "Show Hex" button
1. open the "Assemble Packet" window on the terminal tab;
2. check the "HEX" radio button in the lower right
3. Enter the values above into the window, (after substituting for "nn..." and calculating the checksum, obviously)
4. Hit the "send data" button.
You should get back one 0x97 API message for every node that responds to your target node - If the target gets replies from five nodes to it's ND command, then you would get five 0x97 messages out the UART.
Gotcha's I had to work through to figure out the above...
1. Use assemble packet in hex mode when building API commands for XCTU -- otherwise typing "7E" generates two hex bytes (0x37 0x45) instead of the single byte 0x7E, etc.
2. You will not get any response unless you have a non-zero value for the frame ID --- try the above sample, but change the 5th byte to 00 instead of 01 -- no response.
This is a bit counter- intuitive -- after all why wouldn't I want to see the answer to my query? - but the API is being consistent, and does say
"If set to ‘0’, no AT Command Response will be given."
3. That "0D" on the end is (in general) not optional -- for some commands, nothing will happens if it's not there -- (or unless you enter the CR on the terminal window
Curiously, it wasn't needed above, but it is needed if one tries to send the _local_ ATND command using 7E 00 04 08 01 4E 44 64
Obviously, this description applies to using the XCTU tool (184.108.40.206 is what I have), but the gotcha's should be similar for whatever code you're using to generate input to the module.
One more thing -- Digi has an 'unofficial' utility called "DigiPacket" that makes it much easier to construct API commands "by hand" -- might be worth asking them for a copy -- if enough people do it might get officially released.
[tested using an XBee Pro S2B on the dev board, XCTU talking over the serial port.]