You are on page 1of 27

AT Command Manual

For REX3 Series Modules powered by RexBee™


| Copyright Information

The information contained in this document is the proprietary information of Zhejiang Rexense
Technology Co., Ltd. (hereinafter referred as REXENSE). The contents are confidential and any
disclosure to persons other than the officers, employees, agents or subcontractors of the owner
or licensee of this document, without the prior written consent of Rexense, is strictly prohibited.

Further, no portion of this document may be reproduced, stored in a retrieval system, or


transmitted in any form or by any means, electronic or mechanical, including photocopying and
recording, without the prior written consent of Rexense, the copyright holder.

REXENSE publishes this document without making any warranty as to the content contained
herein. Further Rexense reserves the right to make modifications, additions and deletions to this
document due to typographical errors, inaccurate information, or improvements to products
mentioned in the document at any time and without notice. Such changes will, nevertheless be
incorporated into new editions of this document.

| Version History

Version Revised Date Updated Content


V1.0.0 2010/06/18 Preliminary
V1.0.1 2010/07/07 Added AT+UARTRVS=XX, UART reverse
V1.2.0 2011/06/01 Added pictures
V1.2.7 2011/12/19 Added AT+SETANT, AT+CHOSENCOO, AT+MTO
V1.2.8 2012/06/06 Modified grammatical errors
V1.2.9 2013/03/06 Added application scope of AT+SETANT=xx.
V1.3.0 2013/06/17 Added some additional description
Deleted AT+UARTRVS
Table of Contents

1. Overview of AT Commands ........................................................................................... 4


2. Descriptions of AT Commands ...................................................................................... 6
2.1. AT+VER ..................................................................................................................... 6
2.2. AT+GETINFO ............................................................................................................ 7
2.3. AT+SETPID=xxxxxxxx............................................................................................... 8
2.4. AT+SETCH=xx .......................................................................................................... 9
2.5. AT+SETPWR=± xx................................................................................................... 10
2.6. AT+SETPWRMODE=xxxx ...................................................................................... 12
2.7. AT+SETUART=xx-p ................................................................................................ 13
2.8. AT+SETANT=xx ...................................................................................................... 14
2.9. AT+RESET ................................................................................................................ 15
2.10. AT+RTOKEN ........................................................................................................ 16
2.11. AT+SHOWADDR ................................................................................................ 17
2.12. AT+SHOWTIME .................................................................................................. 18
2.13. AT+TIME=xxxxxxxxxxxxxxxx .............................................................................. 19
2.14. AT+UARTGAP=xx ............................................................................................... 20
2.15. AT+SCAN ............................................................................................................ 21
2.16. AT+SLEEP ............................................................................................................ 22
2.17. AT+WAKEUP ....................................................................................................... 23
2.18. AT+CHOSENCOO............................................................................................... 24
2.19. AT+CHOSENCOO=xxxxxxxx ............................................................................. 25
2.20. AT+MTO .............................................................................................................. 26
3. Contact US ..................................................................................................................... 27
1. Overview of AT Commands
The AT command set, also known as the Hayes command set, was originally developed for use
with the Hayes modems in the 1980s. Many modern dialup modems are still based around this
standard. The term AT command comes from the use of the ASCII characters AT to notify the
host modem that a command will follow. These characters are sent before each command and
were originally used as an abbreviation for the word attention.

REXENSE uses a proprietary set of commands patterned after the AT command set to interface
with REX3 802.15.4/ZigBee modules through a serial port or voltage compatible UART. In the
pattern of the original AT command set, REXENSE uses the characters AT+ before each
command sent to the module. The format of a typical AT command is:

Command header Command Set Value


AT+ SETCH= 0X0B

All the value in AT commands should be specified with ASCII code in HEX format and DO NOT
follow with input of “enter”. Any incorrect input in the command will be treated as data and sent
to other nodes in transparent mode (see RexBee Transparent Communication Protocol).

RexBee supports the following AT commands:


Command ZC ZR ZED HHU Function
AT+SETUART=xx-p √ √ √ √ Set UART parameters
AT+SETPID=xxxxxxxx √ √ √ √ Set network PANID
AT+SETCH=xx √ √ √ √ Set channel
AT+SETANT=xx √ √ √ √ Set antenna type
AT+SETPWR=±xx √ √ √ √ Set transmit power
AT+SETPWRMODE=xxxx √ √ √ √ Set power mode
Get basic information from the ZigBee
AT+GETINFO √ √ √ √
module, such as PANID, channel, etc.
AT+RESET √ √ √ √ Reset module program
AT+VER √ √ √ √ Get firmware name and version
Get MAC address of the connected
AT+SHOWADDR √ √ √ √
module
AT+RTOKEN √ √ √ √ Reset module parameters
AT+TIME=xxxxxxxxxxxxxx √ √ √ √ Set time
AT+SHOWTIME √ √ √ √ Get time
Set time interval between two UART
AT+UARTGAP=xx √ √ √ √
frames
Set if the UART frames should be
AT+UARTRVS=xx √ √ √ √
reversed
Scan available channels and their link
AT+SCAN √ √ √ √
quality
AT+SLEEP √ √ Set the module to sleep mode
AT+WAKEUP √ √ Wake up the module
Get the default MAC address of ZC in the
AT+CHOSENCOO √ √ √
network
Manually specify the MAC address of ZC
AT+CHOSENCOO=xxxxxxxx √ √ √
in the network
AT+MTO √ Refresh network structure
2. Descriptions of AT Commands

2.1. AT+VER

Command Format: AT+VER


Type: Read
Function: Get the name and version of the firmware
Example AT+VER
Returned Message RY [Fimware Name] [Firmware Version]

The users can download the latest version of firmware from official website:
http://www.rexense.com/en/downloads.php?classid=23

NOTE: The evaluation version of firmware will be displayed with the same name and version of
the commercial version.
2.2. AT+GETINFO

Command Format: AT+GETINFO


Type: Read
Function: Get the basic information of the module, including PANID, channel,
power mode, unique ID, UART setting and encryption mode.
Example AT+GETINFO
Returned Message PANID=xxxxxxxx Ch=xx Pwr=±xx PMode=xxxx
UID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx UART=xx-p Encrypt=xx

The default values of REX3 modules are:

Standard Module Enhanced Module


Parameter Name
(REX3S/REX3D) (REX3SP/REX3DP)
PANID PAN ID 474E524C
Ch Channel 11 (0x0B)
Pwr Transmit Power +07 -03
PMode Power Mode 0000 0002
UID Unique ID (System generated)
Encrypt Encryption Mode 00
Firmware
Parameter Name
ZC ZR ZED HHU
UART UART Setting 0F-N 06-N 06-N 0F-N

We recommend the users to keep the default value unless for specific conditions.
2.3. AT+SETPID=xxxxxxxx

Command Format: AT+SETPID=xxxxxxxx


Type: Write
Function: Set the PANID of the module
Value Format: xxxxxxxx: 4 bytes in HEX with high-order byte
Example AT+SETPID=23746945
Returned Message PAN ID configured
2.4. AT+SETCH=xx

Command Format: AT+SETCH=xx


Type: Write
Function: Set the channel of the module
Value Format: xx: 1 byte in HEX ranging from 0B~1A
Example AT+SETCH=1A
Returned Message Channel (frequency) configured

The users can set the value from 16 channels available according to the table below (each
channel width is 5Mhz):

xx Channel Frequency (Mhz) xx Channel Frequency (Mhz)


0B 2405 (default) 13 2445
0C 2410 14 2450
0D 2415 15 2455
0E 2420 16 2460
0F 2425 17 2465
10 2430 18 2470
11 2435 19 2475
12 2440 1A 2480
2.5. AT+SETPWR=± xx

Command Format: AT+SETPWR=±xx


Type: Write
Function: Set the transmit power of the module
Value Format: xx: 1 byte in HEX
Example AT+SETPWR=-03
Returned Message TX power configured

NOTE: This command is highly recommended to be used for enhanced modules (REX3SP and
REX3DP) only as the standard modules (REX3S and REX3D) are not designed with PA.

The configurable range of transmit power is -0A~+07. Please refer to the table below for the
typical RF performance (in dBm) at selected transmit power and frequency for reference (The
users may need to refer to Section 2.4. AT+SETCH for cross reference in the table):

MHz
2405 2425 2430 2450 2455 2460 2480
Value

-00 22.130 22.220 22.257 22.340 22.318 22.314 22.231


-01 21.700 21.840 21.885 22.030 21.996 22.000 21.970
-02 21.220 21.517 21.577 21.690 21.729 21.742 21.660
20.740
-03 21.065 21.133 21.310 21.356 21.381 21.349
(default)
-04 19.980 20.467 20.555 20.810 20.868 20.913 20.940
-05 19.000 19.584 19.700 20.070 20.154 20.229 20.350
-06 18.330 18.986 19.120 19.567 19.669 19.764 19.950
-07 17.470 18.272 18.426 18.950 19.074 19.193 19.460
-08 16.490 17.360 17.528 18.130 18.283 18.428 18.790
-09 15.390 16.206 16.384 17.050 17.222 17.390 17.860

For example, if the user sends the commands:

AT+SETCH=15
AT+SETPWR=-01

The module will have the transmit power of approximate 21.996dBm

The default and recommended values of transmit power for different modules are:

Standard modules (REX3S/REX3D): +07


Enhanced modules (REX3SP/REX3DP): -03
It is highly recommended to keep the default value for best performance unless it is required for
specific conditions.
2.6. AT+SETPWRMODE=xxxx

Command Format: AT+SETPWRMODE=xxxx


Type: Write
Function: Set the power mode of the module
Value Format: xxxx: 2 bytes in HEX with high-order byte
Example AT+SETPWRMODE=0000
Returned Message Power mode configured

The default values of power mode for different modules are:

Standard modules (REX3S/REX3D): 0000


Enhanced modules (REX3SP/REX3DP): 0002

The users should NEVER change the power mode for the modules, otherwise it will cause m
2.7. AT+SETUART=xx-p

Command Format: AT+SETUART=xx-p


Type: Write
Function: Set the UART parameters of the module
Value Format: xx: Baud rate in HEX; p: Parity
Example AT+SETUART=0F-N
Returned Message UART configured

The users can set the baud rate and parity of UART according to the table below:

xx UART Baud Rate xx UART Baud Rate p Parity


03 1200 0A 38400 E Even
04 2400 0B 50000 O Odd
05 4800 0C 57600 N None
06 9600 0D 76800
07 14400 0E 100000
08 19200 0F 115200
09 28800 10 230400

The default UART settings for different roles are:

ZC: 115200, 8, N, 1; ZR: 9600, 8, N 1; ZED: 9600, 8, N, 1; HHU: 115200, 8, N, 1


2.8. AT+SETANT=xx

Command Format: AT+SETANT=xx


Type: Write
Function: Set the antenna type of the module
Value Format: xx: 1 byte in HEX
Example AT+SETANT=00
Returned Message Select [Antenna Type] ANT

The users can set the type of antenna according to the table below:

xx Antenna Type Returned Value


00 PCB Antenna PCB
01 External Antenna (U.FL output) IPEX

NOTE:

This command is only valid for REX3DP as REX3DP supports programmable antenna selection
while the antenna type for other models are hardware specified. Please refer to the datasheet of
the module for more information of antenna options.
2.9. AT+RESET

Command Format: AT+RESET


Type: Act
Function: Reset the module program
Example AT+RESET
Returned Message Reset in 6 seconds…
2.10. AT+RTOKEN

Command Format: AT+RTOKEN


Type: Write
Function: Restore the module to factory (default) settings
Example AT+RTOKEN
Returned Message Default token value restored
2.11. AT+SHOWADDR

Command Format: AT+SHOWADDR


Type: Read
Function: Get the MAC address of the module
Example AT+SHOWADDR
Returned Message xxxxxxxxxxxxxxxx (low-order byte)

NOTE: This command displays the long address of the module. The short address is the last 4
bytes which is used in RexBee data frames. When the short address is used in RexBee data
frames (Little Endian), it is displayed and should be specified with high-order byte.

For example:

Short address Short address


Long address
(in AT command) (in Little Endian)
0080E1020015AC96 0015AC96 96AC1500
2.12. AT+SHOWTIME

Command Format: AT+SHOWTIME


Type: Read
Function: Get the current time on the module
Example AT+SHOWTIME
Returned Message xx xx xx xx xx xx xx xx (in HEX)

The returned time is in the format of:

xx xx xx xx xx xx xx xx
Year Month Day Hour Minute Second Weekday Time Status

0x00 0x01 0x02 0x03


Uninitialized time Reserved Network time Local configured time
2.13. AT+TIME=xxxxxxxxxxxxxxxx

Command Format: AT+TIME=xxxxxxxxxxxxxxxx


Type: Write
Function: Set the current time on the module
Value Format: xxxxxxxxxxxxxx (8 bytes in HEX)
Example AT+TIME=xxxxxxxxxxxxxxxx
Returned Message Time configured

Please refer to 2.12. AT+SHOWTIME for the definition of each byte in the value.

NOTE: If this command is executed on the coordinator, the time will be automatically
broadcasted to all router nodes in the network.
2.14. AT+UARTGAP=xx

Command Format: AT+UARTGAP=xx


Type: Write
Function: Set the time interval between two UART frames
Value Format: xx (1 bytes in HEX, unit: ms)
Example AT+UARTGAP=0A
Returned Message UART frame gap configured

The maximal configurable time interval is FF (255ms)

The default interval is 5ms. We highly recommend the users keep the default setting for better
performance.
2.15. AT+SCAN

Command Format: AT+SCAN


Type: Read
Function: Scan the link quality of specified channel(s)
Value Format: xxxx (2 bytes in HEX)
Example AT+SCAN=0008
Returned Message Channel xx: -xxdBm

The users can specify the channel to be scanned according to the table below:

Value Channel (HEX) Channel (DEC) Value Channel (HEX) Channel (DEC)
0001 0B 11 0100 13 19
0002 0C 12 0200 14 20
0004 0D 13 0400 15 21
0008 0E 14 0800 16 22
0010 0F 15 1000 17 23
0020 10 16 2000 18 24
0040 11 17 4000 19 25
0080 12 18 8000 1A 26
FFFF All channels

The users can scan all channels using “AT+SCAN=FFFF”.


2.16. AT+SLEEP

Command Format: AT+SLEEP


Type: Write
Function: Set the module to sleep mode
Example AT+SLEEP
Returned Message Sleeping…

NOTE: This command is only valid for ZED and HHU. The users do not need to use this
command for ZED as it automatically sleeps for 15 seconds between wake-ups.
2.17. AT+WAKEUP

Command Format: AT+WAKEUP


Type: Write
Function: Wake up the module
Example AT+WAKEUP
Returned Message Slept(s)=0xxxxx (the last 4 bit shows the slept time)

This command is not frequently used as users can send any data from UART to wake up the
module. When the module receives the data from UART it will wake up and performs normal
functioning.

REX3 modules support wake-up by serial and PC0 and the respective wake-up time is 48ms
and 3s. The users are highly recommended to wake up the modules via serial data. When the
module is in sleep mode, the first data frame sent to the module via serial connection will wake
up the module and the following data frames are the actual data will be sent.
2.18. AT+CHOSENCOO

Command Format: AT+CHOSENCOO


Type: Read
Function: Get the MAC address of the coordinator in the network
Example AT+CHOSENCOO
Returned Message Chosen COO: xxxxxxxx

This command can be executed on nodes except the coordinator to get the MAC address of
coordinator in the network.

NOTE:

1. The default coordinator MAC address before joining network is 0x00000000.

2. The module will save the coordinator MAC address even if the node leaves the network or
the module is powered off. It will be updated when it joins a new network.
2.19. AT+CHOSENCOO=xxxxxxxx

Command Format: AT+CHOSENCOO=xxxxxxxx


Type: Write
Function: Manually specify the MAC address of the coordinator in the network
Value Format: xxxxxxxx (Short address, 4 bytes in HEX)
Example AT+CHOSENCOO=0016B63E
Returned Message Chosen COO: xxxxxxxx

This command can be executed on nodes except the coordinator to set the target MAC
address as coordinator in the network.

NOTE:

1. The module will save the coordinator MAC address even if the node leaves the network or
the module is powered off.

2. If the assigned coordinator no longer exists in the network but another coordinator is
available, the MAC address will be updated to the new coordinator.
2.20. AT+MTO

Command Format: AT+MTO


Type: Operate
Function: Refresh the network structure
Example AT+MTO
Returned Message COO will send MTO in one second

This command is only valid for the coordinator. After the command is sent, the coordinator will
broadcast to refresh the network structure in 1 second. It is recommend to pause data
transmission for 3-5 seconds for network refresh as the network might be very busy during this
process.
3. Contact US

ZHEJIANG REXENSE TECHNOLOGY CO., LTD


Address: Room 105, No.7 Cuibai Road, Xihu District, Hangzhou 310012 P.R.China
Tel: +86-571-85395623
Fax: +86-571-87987620
Email: intl@rexense.com
Webiste: www.rexense.com

You might also like