xuos-web/docs/doc/communication/at.md

712 lines
21 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AT
<!--不放在这里会导致标题不等高-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="ProgId" content="Excel.Sheet">
<meta name="Generator" content="Aspose.Cell 18.4">
<link rel="File-List" href="092215383253_files/filelist.xml">
<link rel="Edit-Time-Data" href="092215383253_files/editdata.mso">
<link rel="OLE-Object-Data" href="092215383253_files/oledata.mso">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
</o:DocumentProperties>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{
mso-header-data:"";
mso-footer-data:"";
margin:0.75in 0.7in 0.75in 0.7in;
mso-header-margin:0.3in;
mso-footer-margin:0.3in;
mso-page-orientation:Portrait;
}
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
ruby
{ruby-align:left;}
.style0
{
mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:11pt;
font-weight:400;
font-style:normal;
font-family:"等线","sans-serif";
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
.font0
{
color:#000000;
font-size:11pt;
font-weight:400;
font-style:normal;
font-family:"等线","sans-serif"; }
.font1
{
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif"; }
.font2
{
color:#333333;
font-size:9pt;
font-weight:700;
font-style:normal;
font-family:"Microsoft JhengHei UI","sans-serif"; }
.font3
{
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"宋体","sans-serif"; }
.font4
{
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"Arial","serif"; }
.font5
{
color:#000000;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"等线","monospace"; }
.font6
{
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"微软雅黑","sans-serif"; }
.font7
{
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"宋体","monospace"; }
td
{mso-style-parent:style0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:11pt;
font-weight:400;
font-style:normal;
font-family:"等线","sans-serif";
border:none;
mso-protection:locked visible;
mso-ignore:padding;}
.style0
{
text-align:general;
vertical-align:bottom;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:11pt;
font-weight:400;
font-style:normal;
font-family:"等线","sans-serif";
mso-protection:locked visible;
mso-style-name:"Normal";
}
.style1
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style2
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style3
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style4
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style5
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style6
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style7
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style8
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style9
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style10
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style11
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style12
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style13
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.style14
{
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
}
.x15
{
mso-style-parent:style0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:11pt;
font-weight:400;
font-style:normal;
font-family:"等线","sans-serif";
mso-protection:locked visible;
}
.style16
{
mso-number-format:"0%";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Percent";
}
.style17
{
mso-number-format:"_ \0022¥\0022* \#\,\#\#0\.00_ \;_ \0022¥\0022* -\#\,\#\#0\.00_ \;_ \0022¥\0022* \0022-\0022??_ \;_ \@_ ";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Currency";
}
.style18
{
mso-number-format:"_ \0022¥\0022* \#\,\#\#0_ \;_ \0022¥\0022* -\#\,\#\#0_ \;_ \0022¥\0022* \0022-\0022_ \;_ \@_ ";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Currency [0]";
}
.style19
{
mso-number-format:"_ * \#\,\#\#0\.00_ \;_ * -\#\,\#\#0\.00_ \;_ * \0022-\0022??_ \;_ \@_ ";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Comma";
}
.style20
{
mso-number-format:"_ * \#\,\#\#0_ \;_ * -\#\,\#\#0_ \;_ * \0022-\0022_ \;_ \@_ ";
text-align:general;
vertical-align:middle;
white-space:nowrap;
background:white;
mso-pattern:auto;
color:#000000;
font-size:10pt;
font-weight:400;
font-style:normal;
font-family:"Arial","sans-serif";
mso-protection:locked visible;
mso-style-name:"Comma [0]";
}
.x21
{
mso-style-parent:style0;
mso-number-format:General;
text-align:center;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#9DC3E6;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:700;
font-style:normal;
font-family:"Microsoft JhengHei UI","sans-serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
.x22
{
mso-style-parent:style0;
mso-number-format:General;
text-align:center;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#9DC3E6;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:700;
font-style:normal;
font-family:"Microsoft JhengHei UI","sans-serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
.x23
{
mso-style-parent:style0;
mso-number-format:General;
text-align:center;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#FFFFFF;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"宋体","sans-serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
.x24
{
mso-style-parent:style0;
mso-number-format:General;
text-align:left;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#FFFFFF;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"宋体","serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
.x25
{
mso-style-parent:style0;
mso-number-format:General;
text-align:left;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#FFFFFF;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"宋体","sans-serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
.x26
{
mso-style-parent:style0;
mso-number-format:General;
text-align:left;
vertical-align:middle;
white-space:normal;word-wrap:break-word;
background:#FFFFFF;
mso-pattern:auto none;
color:#333333;
font-size:9pt;
font-weight:400;
font-style:normal;
font-family:"Arial","serif";
border-top:1px solid windowtext;
border-right:1px solid windowtext;
border-bottom:1px solid windowtext;
border-left:1px solid windowtext;
mso-diagonal-down:none;
mso-diagonal-up:none;
mso-protection:locked visible;
}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:StandardWidth>2304</x:StandardWidth>
<x:Print>
<x:ValidPrinterInfo/>
<x:PaperSizeIndex>9</x:PaperSizeIndex>
<x:HorizontalResolution>600</x:HorizontalResolution>
<x:VerticalResolution>600</x:VerticalResolution>
</x:Print>
<x:Selected/>
<x:TopRowVisible>15</x:TopRowVisible>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>12576</x:WindowHeight>
<x:WindowWidth>23256</x:WindowWidth>
<x:WindowTopX>-108</x:WindowTopX>
<x:WindowTopY>-108</x:WindowTopY>
<x:RefModeR1C1/>
<x:TabRatio>600</x:TabRatio>
<x:ActiveSheet>0</x:ActiveSheet>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
## AT 指令简介
<el-divider></el-divider>
AT指令是应用于终端设备与PC应用之间的连接与通信的指令。AT 即Attention。每个AT命令行中只能包含一条AT指令对于AT指令的发送除AT两个字符外最多可以接收1056个字符的长度包括最后的空字符</br></br>
AT指令集是从终端设备Terminal EquipmentTE)或数据终端设备Data Terminal EquipmentDTE)向终端适配器(Terminal AdapterTA)或数据电路终端设备(Data Circuit Terminal EquipmentDCE)发送的。</br></br>
其对所传输的数据包大小有定义即对于AT指令的发送除AT两个字符外最多可以接收1056个字符的长度包括最后的空字符</br></br>
每个AT命令行中只能包含一条AT指令对于由终端设备主动向PC端报告的URC指示或者response响应也要求一行最多有一个不允许上报的一行中有多条指示或者响应。AT指令以回车作为结尾响应或上报以回车换行为结尾。</br>
## ESP8266 中AT指令的使用
<el-divider></el-divider>
下面以ESP8266为例来说明AT指令的使用。
<body link='blue' vlink='purple' >
<table border='0' cellpadding='0' cellspacing='0' width='661' style='border-collapse:
collapse;table-layout:fixed;width:495pt'>
<col width='307' style='mso-width-source:userset;width:230.25pt'>
<col width='282' style='mso-width-source:userset;width:211.5pt'>
<col width='72' style='width:54pt'>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r0'>
<td height='24' class='x21' width='307' style='height:18.45pt;width:230.25pt;'>指令</td>
<td colspan='2' class='x22' width='354' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>描述</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r1'>
<td height='24' class='x23' style='height:18.45pt;'>AT</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">测试 </font><font class="font4">AT </font><font class="font3">启动</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r2'>
<td height='24' class='x23' style='height:18.45pt;'>AT+RST</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>重启模块</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r3'>
<td height='24' class='x23' style='height:18.45pt;'>AT+GMR</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>查看版本信息</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r4'>
<td height='24' class='x23' style='height:18.45pt;'>AT+GSLP</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3"></font><font class="font6"></font><font class="font7"></font><font class="font4">Deep-sleep </font><font class="font3">模式</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r5'>
<td height='24' class='x23' style='height:18.45pt;'>ATE</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>开关回显功能</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r6'>
<td height='24' class='x23' style='height:18.45pt;'>AT+RESTORE</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">恢复出</font><font class="font6"></font><font class="font7">厂设置</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r7'>
<td height='24' class='x23' style='height:18.45pt;'>AT+UART_CUR</td>
<td colspan='2' class='x26' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font4">UART </font><font class="font3">当前临时配置</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r8'>
<td height='24' class='x23' style='height:18.45pt;'>AT+UART_DEF</td>
<td colspan='2' class='x26' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font4">UART </font><font class="font3">默认配置,保存到 </font><font class="font4">Flash</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r9'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SLEEP</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">sleep </font><font class="font3">模式</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r10'>
<td height='24' class='x23' style='height:18.45pt;'>AT+WAKEUPGPIO</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">GPIO </font><font class="font3">唤醒 </font><font class="font4">Light-sleep </font><font class="font3">模式</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r11'>
<td height='24' class='x23' style='height:18.45pt;'>AT+RFPOWER</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">RF TX Power </font><font class="font3">上限</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r12'>
<td height='24' class='x23' style='height:18.45pt;'>AT+RFVDD</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">根据 </font><font class="font4">VDD33 </font><font class="font3">设置 </font><font class="font4">RF TX Power</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r13'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSRAM</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>查询系统当前剩余内存</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r14'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSADC</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">查询 </font><font class="font4">ADC </font><font class="font3"></font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r15'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSIOSETCFG</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">IO </font><font class="font3">⼯工作模式</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r16'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSIOGETCFG</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">查询 </font><font class="font4">IO </font><font class="font3">⼯工作模式</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r17'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSGPIODIR</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">GPIO </font><font class="font3">⼯工作为输⼊入或输出</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r18'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSGPIOWRITE</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">设置 </font><font class="font4">GPIO </font><font class="font3">的输出电平</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r19'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSGPIOREAD</td>
<td colspan='2' class='x24' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'><font class="font3">读取 </font><font class="font4">GPIO </font><font class="font3">的电平状态</font></td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r20'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSMSG_CUR</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>设置当前系统消息</td>
</tr>
<tr height='26' style='mso-height-source:userset;height:19.95pt' id='r21'>
<td height='24' class='x23' style='height:18.45pt;'>AT+SYSMSG_DEF</td>
<td colspan='2' class='x25' style='border-right:1px solid windowtext;border-bottom:1px solid windowtext;'>设置默认系统消息</td>
</tr>
</table>
</body>