dirty 发表于 2024-2-7 19:16

【安信可BW16-Kit】BLE、WIFI AT指令测试

本帖最后由 dirty 于 2024-2-7 19:21 编辑

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安信可官方提供集成完善功能的AT指令集,通过串口按指令集格式进行使用。这里予以评估模块BLE与WiFi性能。烧录安信可<a href="https://docs.ai-thinker.com/_media/2179_bw16_combo_soft_v4.18_p5.6.4_combov4.18_p2.29.2_.zip" target="_blank">官方固件</a>,也初步了解下<a href="https://aithinker.readthedocs.io/zh-cn/latest/docs/taobao/BW16/index.html" target="_blank">历史版本内容</a>,对固件所有的功能有个了解。</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;对于&nbsp;<a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/Wi-Fi_AT_Commands.html" target="_blank">安信可AT指令集</a>,首先了解下,通用 AT 命令有四种类型</p>

<p></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AT基础指令集</p>

<ul>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-at">AT</a>:测试 AT 启动</p>
        </li>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-help">AT+HELP</a>:查看 AT 指令集</p>
        </li>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-rst">AT+RST</a>:模块重启</p>
        </li>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-restore">AT+RESTORE</a>:恢复出厂设置</p>
        </li>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-gmr">AT+GMR</a>:查询版本信息</p>
        </li>
        <li>
        <p><a href="https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/AT_Basic_Commands.html#cmd-uartcfg">AT+UARTCFG</a>:串口设置</p>
        </li>
</ul>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AT指令集按流程及需要选择使用,并做测验</p>

<p>一.BLE蓝牙AT指令集使用</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<p>AT+BLEMODE?&nbsp; &nbsp; &nbsp; &nbsp; //查询蓝牙工作模式</p>

<p>AT+BLEMODE=9&nbsp; &nbsp; &nbsp;//设置蓝牙工作模式.0:从机模式1:主机模式2:iBeacon 模式9:蓝牙关闭</p>

<p>AT+BLENAME=BW16-Kit //设置蓝牙设备名称</p>

<p>AT+BLEMODE=0&nbsp;//设置蓝牙工作模式.0:从机模式1:主机模式2:iBeacon 模式9:蓝牙关闭</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在蓝牙开启广播前,设置蓝牙广播等参数,随后启动,手机APP扫描到该蓝牙并连接,在蓝牙服务下可数据收/发</p>

<div style="text-align: center;"></div>

<div style="text-align: center;">BLE AT指令集</div>

<div style="text-align: center;"></div>

<div style="text-align: center;">手机APP扫描到设定的蓝牙广播</div>

<p>二.WiFIAT指令集使用</p>

<p>AT+WMODE=3,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //设置AP+STA模式,保存到FLASH</p>

<p>AT+WSCAN&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//扫描Wi-Fi列表</p>

<p>AT+WJAP=ssid,password &nbsp;&nbsp;&nbsp;&nbsp;//连接WIFI</p>

<p>AT+PING=192.168.4.134&nbsp; &nbsp; &nbsp;//ping网络</p>

<p>AT+WRSSI?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//查询 Wi-Fi 连接信号强度</p>

<div style="text-align: center;"></div>

<div style="text-align: center;">设置模块wifi模式并扫描wifi</div>

<div style="text-align: center;">
<div style="text-align: center;"></div>

<div style="text-align: center;">WiFi连接并ping通和查询信号强度</div>

<p>&nbsp;</p>
</div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通过测验,BW16-Kit模块具备BLE和蓝牙功能,可以MCU+BW16模组形式,结合需求做应用。</p>

<div style="text-align: center;">&nbsp;</div>

<p>&nbsp;</p>
页: [1]
查看完整版本: 【安信可BW16-Kit】BLE、WIFI AT指令测试