function wp_mail() {} {"id":825,"date":"2010-12-05T06:51:10","date_gmt":"2010-12-05T13:51:10","guid":{"rendered":"http:\/\/www.serialporttool.com\/sptblog\/?p=825"},"modified":"2015-11-09T16:01:05","modified_gmt":"2015-11-09T21:01:05","slug":"how-to-run-at-command-in-api-mode","status":"publish","type":"post","link":"https:\/\/www.serialporttool.com\/sptblog\/?p=825","title":{"rendered":"How to Run AT command in API mode"},"content":{"rendered":"

In ZigBee Operator<\/a>, it is very easy to run AT command in API mode.<\/p>\n

Here are the examples for run get firmware AT command \u201cVR\u201d.<\/p>\n

In XBee\/XBee-Pro ZB profile.<\/p>\n

Steps:<\/p>\n

Switch to XBee\/XBee Pro ZB Profile.<\/p>\n

Input ASCII characters \u201cVR\u201d in command field and click button \u201cSend\u201d will send the command.<\/p><\/blockquote>\n

Here is screenshot of the quick send panel.<\/p>\n

\"image\"<\/a><\/p>\n

Here is the message in log window.<\/p>\n

Send:(21:25:54) 7E 00 04 08 01 56 52 4E <\/span><\/p>\n

Data Parsed: 7E 00 04 08 01 56 52 4E
\nAT Command
\nFrame ID: 0x01
\nCommand: VR
\nPara(Hex):
\nPara(Text):<\/span><\/p>\n

Rec:(21:25:54)7E 00 07 88 01 56 52 00 21 70 3D
\nData Parsed: 7E 00 07 88 01 56 52 00 21 70 3D
\nAT Command Response
\nFrame ID: 1
\nCommand: VR
\nStatus: 0 = OK
\nPara: 21 70 <\/span><\/p><\/blockquote>\n

ZigBee Operator<\/a> will send a data frame to module. It starts with \u201c7E\u201d and \u201c08\u201d is the flag for AT command. The \u201c0x56 0x52\u201d are ASCII code for character \u201cVR\u201d. The command are not case sensitive. Both \u201cVR\u201d and \u201cvr\u201d works.<\/p>\n

The module will send a \u201cAT Command Response\u201d data frame to ZigBee Operator. The last line \u201cPara\u201d is the command result. In this sample, it is \u201c21 70\u201d, means the firmware is 2170, the firmware for API Zigbee coordinator.<\/p>\n

To run a command with a parameters, like \u201cSN\u201dcommand, which\u00a0 sets the number of sleep periods to not assert the On\/Sleep pin on wakeup if no RF data is waiting for the end device. The default value for this command is 1. Send \u201cSN\u201d command without any parameter like example above will return the value.<\/p>\n

Here are the message in Log window.<\/p>\n

Send:(21:39:51) 7E 00 04 08 01 53 4E 55<\/p>\n

Data Parsed: 7E 00 04 08 01 53 4E 55
\nAT Command
\nFrame ID: 0x01
\nCommand: SN
\nPara(Hex):
\nPara(Text):<\/span><\/p>\n

Rec:(21:39:51)7E 00 07 88 01 53 4E 00 00 01 D4
\nData Parsed: 7E 00 07 88 01 53 4E 00 00 01 D4
\nAT Command Response
\nFrame ID: 1
\nCommand: SN
\nStatus: 0 = OK
\nPara: 00 01\u00a0 <\/span><\/p><\/blockquote>\n

The value of SN is 1.<\/p>\n

To set a value for SN, input the value in Parameters field. The value are in hex. Input \u201c20\u201d in parameters will set the value to 20.<\/p>\n

\"image\"<\/a><\/p>\n

Here are the message in Log window.<\/p>\n

Send:(21:46:06) 7E 00 05 08 01 53 4E 20 35 <\/span><\/p>\n

Data Parsed: 7E 00 05 08 01 53 4E 20 35
\nAT Command
\nFrame ID: 0x01
\nCommand: SN
\nPara(Hex):20
\nPara(Text): <\/span><\/p>\n

Rec:(21:46:06)7E 00 05 88 01 53 4E 00 D5
\nData Parsed: 7E 00 05 88 01 53 4E 00 D5
\nAT Command Response
\nFrame ID: 1
\nCommand: SN
\nStatus: 0 = OK
\nPara:
\n<\/span><\/p><\/blockquote>\n

It showed that command are run success.<\/p>\n

Run \u201cSN\u201d command and leave parameters field blank will query the value of SN again.<\/p>\n

Here are the message in Log window.<\/p>\n

Send:(21:48:34) 7E 00 04 08 01 53 4E 55 <\/span><\/p>\n

Data Parsed: 7E 00 04 08 01 53 4E 55
\nAT Command
\nFrame ID: 0x01
\nCommand: SN
\nPara(Hex):
\nPara(Text):<\/span><\/p>\n

Rec:(21:48:34)7E 00 07 88 01 53 4E 00 00 20 B5
\nData Parsed: 7E 00 07 88 01 53 4E 00 00 20 B5
\nAT Command Response
\nFrame ID: 1
\nCommand: SN
\nStatus: 0 = OK
\nPara: 00 20\u00a0 <\/span><\/p><\/blockquote>\n

The value of SN is 20 now.<\/p>\n

It is same for 802.15.4 devices, just switch to 802.15.4 profile and send command there.<\/p>\n

\"image\"<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

In ZigBee Operator, it is very easy to run AT command in API mode. Here are the examples for run get firmware AT command \u201cVR\u201d. In XBee\/XBee-Pro ZB profile. Steps: Switch to XBee\/XBee Pro ZB Profile. Input ASCII characters \u201cVR\u201d […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[118,117,113,114],"class_list":["post-825","post","type-post","status-publish","format-standard","hentry","category-zigbee","tag-api-mode","tag-at-command","tag-zigbee-2","tag-zigbee-operator"],"_links":{"self":[{"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/posts\/825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=825"}],"version-history":[{"count":4,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/posts\/825\/revisions"}],"predecessor-version":[{"id":3889,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=\/wp\/v2\/posts\/825\/revisions\/3889"}],"wp:attachment":[{"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serialporttool.com\/sptblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}