【安信可BW16-Kit】AT指令的蓝牙
<div class='showpostmsg'><p>计划先把AT指令熟悉一遍,后续配合单片机一块调试使用</p><p> </p>
<article data-content="[{"type":"block","id":"Fssw-1706662589294","name":"heading","data":{"level":"h2"},"nodes":[{"type":"text","id":"t3D2-1706662589292","leaves":[{"text":"设置蓝牙工作模式","marks":[{"type":"color","value":"#F33232"}]}]}],"state":{}},{"type":"block","id":"Vdqn-1706500225147","name":"paragraph","data":{},"nodes":[{"type":"text","id":"Fgs6-1706500225146","leaves":[{"text":"AT+BLEMODE:查询或设置蓝牙工作模式","marks":[]}]}],"state":{}},{"type":"block","id":"f8dB-1706500225244","name":"paragraph","data":{},"nodes":[{"type":"text","id":"BMG2-1706500225242","leaves":[{"text":"瑞昱系列(BW16/BW15)","marks":[]},{"text":"如果开启多种无线类型需要按照指定顺序开启","marks":[{"type":"color","value":"#F33232"},{"type":"bold"}]},{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"RLSU-1706662641850","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"L9O3-1706662641851","leaves":[{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"cWB0-1706662641852","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"IwuQ-1706662641853","leaves":[{"text":"设置蓝牙模式后会立即执行,如果是启动蓝牙需要先设置好蓝牙参数后再启动蓝牙\r","marks":[]}]}],"state":{}},{"type":"block","id":"BH6j-1706662641854","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"GRuQ-1706662641855","leaves":[{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"x2c6-1706662641856","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"njXV-1706662641857","leaves":[{"text":"如果开启 AP+STA+蓝牙","marks":[]},{"text":"三模","marks":[{"type":"bold"},{"type":"color","value":"#F33232"}]},{"text":",或者 AP+STA ","marks":[]},{"text":"混杂模式,需要先开 AP,然后连接STA 或蓝牙","marks":[{"type":"bold"},{"type":"color","value":"#F33232"}]},{"text":"(蓝牙和 STA 顺序先后没有要求,但是必须先开 AP)","marks":[]}]}],"state":{}},{"type":"block","id":"KyWg-1706500225353","name":"paragraph","data":{},"nodes":[{"type":"text","id":"nJZ0-1706500225352","leaves":[{"text":"","marks":[]}]}],"state":{}},{"type":"block","id":"WSBS-1706662725391","name":"paragraph","data":{},"nodes":[{"type":"text","id":"BH96-1706662725389","leaves":[{"text":"查询命令: AT+BLEMODE?\r","marks":[]}]}],"state":{}},{"type":"block","id":"oxKG-1706662717614","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"bX9m-1706662717615","leaves":[{"text":"响应:+BLEMODE :<mode>\r","marks":[]}]}],"state":{}},{"type":"block","id":"MevT-1706662717620","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"k9P1-1706662717621","leaves":[{"text":"设置命令: AT+BLEMODE=<mode>\r","marks":[]}]}],"state":{}},{"type":"block","id":"I9ww-1706662771282","name":"paragraph","data":{"version":1},"nodes":[{"type":"text","id":"2xhS-1706662771283","leaves":[{"text":"响应:OK","marks":[]}]}],"state":{}},{"type":"block","id":"cVDs-1706500225558","name":"paragraph","data":{},"nodes":[{"type":"text","id":"P5W7-1706500225556","leaves":[{"text":"参数:","marks":[]}]}],"state":{}},{"type":"block","id":"R5fU-1706662812504","name":"paragraph","data":{},"nodes":[{"type":"text","id":"8ft6-1706662812502","leaves":[{"text":"Mode:\r","marks":[]}]}],"state":{}},{"type":"block","id":"swFS-1706662790741","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"S3TA-1706662790742","leaves":[{"text":"0:从机模式\r","marks":[]}]}],"state":{}},{"type":"block","id":"WMap-1706662790743","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"haq2-1706662790744","leaves":[{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"HJlz-1706662790745","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"Rg2r-1706662790746","leaves":[{"text":"1:主机模式\r","marks":[]}]}],"state":{}},{"type":"block","id":"VTfl-1706662790747","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"JDW3-1706662790748","leaves":[{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"RLqk-1706662790749","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"jvRr-1706662790750","leaves":[{"text":"2:iBeacon 模式\r","marks":[]}]}],"state":{}},{"type":"block","id":"loRa-1706662790751","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"JYH6-1706662790752","leaves":[{"text":"\r","marks":[]}]}],"state":{}},{"type":"block","id":"Cu89-1706662790753","name":"paragraph","data":{"version":1,"style":{"indent":28}},"nodes":[{"type":"text","id":"RCwc-1706662790754","leaves":[{"text":"9:蓝牙关闭","marks":[]}]}],"state":{}},{"type":"block","id":"KWRi-1706500225652","name":"paragraph","data":{},"nodes":[{"type":"text","id":"a6Gq-1706500225651","leaves":[{"text":"eg:AT+BLEMODE?\t\t+BLEMODE:9","marks":[]}]}],"state":{}}]">
<p>①、AT+BLEMODE:查询或设置蓝牙工作模式</p>
<p>瑞昱系列(BW16/BW15)<span style="color:#1abc9c;"><strong>启动蓝牙需要先设置好蓝牙参数后再启动</strong></span>蓝牙</p>
<p>开启 AP+STA+蓝牙三模,或者 AP+STA 混杂模式,需要<span style="color:#1abc9c;"><strong>先开 AP</strong></span>,<strong><span style="color:#1abc9c;">然后</span></strong>连接<strong><span style="color:#1abc9c;">STA 或蓝牙</span></strong>(蓝牙和 STA 顺序先后没有要求,但是必须先开 AP)</p>
<article data-content="[{"type":"block","id":"WSBS-1706662725391","name":"paragraph","data":{},"nodes":[{"type":"text","id":"BH96-1706662725389","leaves":[{"text":"AT+BLEMODE","marks":[]}]}],"state":{}}]">
<p>AT+BLEMODE = 0 蓝牙从机模式;</p>
<article data-content="[{"type":"block","id":"WSBS-1706662725391","name":"paragraph","data":{},"nodes":[{"type":"text","id":"BH96-1706662725389","leaves":[{"text":"AT+BLEMODE","marks":[]}]}],"state":{}}]">
<p>AT+BLEMODE = 1 蓝牙主机模式;</p>
<article data-content="[{"type":"block","id":"WSBS-1706662725391","name":"paragraph","data":{},"nodes":[{"type":"text","id":"BH96-1706662725389","leaves":[{"text":"AT+BLEMODE","marks":[]}]}],"state":{}}]">
<p>AT+BLEMODE = 9 蓝牙关闭;</p>
</article>
<article data-content="[{"type":"block","id":"FkMR-1706663002295","name":"paragraph","data":{},"nodes":[{"type":"text","id":"uL2B-1706663002293","leaves":[{"text":"AT+BLESTATE?","marks":[]}]}],"state":{}}]">
<p>②、AT+BLESTATE? 查看是否连接,0:未连接,1:已连接</p>
</article>
</article>
</article>
<p>③、AT+BLEDISCON 断开蓝牙连接,先断开进行参数配置</p>
<p>④、AT+BLENAME = <ble name> 查询或设置蓝牙设备名称</p>
<p>⑤、AT+BLEAUTH = <pind> 查询或设置蓝牙配对码:6 位数字</p>
<p>发送AT+BLEMODE = 0 将蓝牙配置为从机模式</p>
<article data-content="[{"type":"block","id":"Bzf2-1707187463225","name":"paragraph","data":{},"nodes":[{"type":"text","id":"j8Vf-1707187463223","leaves":[{"text":"这里我用微信上的小程序BLE蓝牙助手进行的测试:扫描后进行连接","marks":[]}]}],"state":{}}]">
<p>这里我用微信上的小程序BLE蓝牙助手进行的测试:扫描点击ai-thinker进行连接,接着便可进行收发</p>
</article>
<p> </p>
<p>从机ADDRESS: 94:c9:60:3e:5d:34</p>
<p></p>
<p> </p>
<p> </p>
<p> </p>
<p>AT指令很方便,最近得好好的整PY的东西,BW16暂鸽一段,后续配合单片机整理数据,加到近场无线控制里用~</p>
</article>
<p> </p>
<hr />
<p> </p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>
页:
[1]