接续上一篇博文: MediaTek Genio 130/130A 快速上手(二),我们已完成了编译范例 bga_sdk_demo ,且烧录 Firmware 到 Genio 130/130A 开发版上(以 MT7933 HDK 为例)。
接下来我们将进行 bga_sdk_demo 上的一些功能展示,包含:
- SDK CLI command 简介
- 基本CLI command: ver, log, en
- WiFi 连接CLI command
- FOTA
SDK CLI command 简介
当我们将 Genio 130/130A 开发版接上 USB 电源并开机后,可以透过 console 查询支援的 CLI command
CLI command: ?
也可以进一步查询间单的用法
CLI command: ??
基本CLI command
Genio 130/130A Non-NDA SDK 在开发版上提供一些基础的功能,以下介绍常用到的 CLI command
CLI command: ver
用于查询在开发版上运行的 SDK 版本以及建立日期等资讯
CLI command: log
用于开启/关闭个不同的 log 模组讯息,如: main, common, HAL, lwIP WiFi, Bluetooth。也可以设定 log level
CLI command: en
工程模式,支援显示状态讯息、暂存器及简易WiFi/BT操做,
最常用到的是关闭睡眠模式。须注意进入工程模式后需要透过 "back" CLI command 离开工程模式。
WiFi 连接 CLI command
CLI command: wifi
以下是 Genio 130/130A 连接 WIFI AP 会使用的 CLI Command 与说明
- wifi config set ssid 0 <value>
- Configure AP's SSID
- wifi config set sec 0 <Auth> <Encrypt>
- Configure Security Setting including auth and encrypt type
- Open (0, 1)
- WPA + TKIP (4, 4)
- WPA2 + CCMP (7, 6)
- WPA & WPA2 + TKIP & AES (9, 8)
- WPA2 & WPA3 + Only CCMP (13, 6)
- WPA3 + only CCMP (11, 6)
- Configure Security Setting including auth and encrypt type
- wifi config set psk 0 <password>
- Configure PSK key
- wifi config set wep 0 <key_id> <key_string>
- Configure wep key
- wifi config set reload
- Important: Make above setting to take effect and re-start the connection
连上 WIFI AP 可以透过以下 CLI command 获取资讯
FOTA
CLI command: fota
Genio 130/130A 提供 FOTA 功能透过网路更新 Firmware,说明如下
- fota dl <URL>
- Download FW binary from URL
- fota trig set
- Set FW update trigger flag
- fota status
- Check current status
- reboot
- Reboot system to start FW update
相关资讯连结:
- MetiaTek Genio 130/130A : https://www.mediatek.com/iot/products/genio-130
- MTK Genio130/130A Non-NDA SDK(请参考下图位置) : https://www.wpgdadatong.com/product-channel/Mediatek