Concepts First
- Wi-Fi: a wireless LAN technology. Devices connect to a router (AP) over radio waves instead of cables, and phones, laptops and smart-home devices mostly get online this way.
- Band and protocol: the Ai-M6x (BL616/BL618) supports 2.4GHz 802.11 b/g/n. 2.4GHz penetrates walls well but sees more interference than 5GHz.
- SSID and password: the SSID is the hotspot's name, the password is the passphrase needed to join. Both must be correct to connect.
- STA vs AP: STA (Station) is the "client" role that joins someone else's hotspot; AP (Access Point) is the "hotspot" role that lets other devices join. The module supports both, and can run AP and STA at the same time (see Soft-AP Mode).
- Channel: the 2.4GHz band is split into channels (1–13), like separate "lanes"; using different channels reduces interference between nearby devices.
Ai-M6x Wi-Fi Capabilities
The Ai-M6x series (Ai-M61's BL618, Ai-M62's BL616) comes with a complete Wi-Fi stack in the Bouffalo SDK; official examples live in examples/wifi/. The typical workflow has three steps:
- Initialize the Wi-Fi stack: the example prints
PHY RF init success!at boot, then goes throughStarting wifi .../Starting fhost ...; - Connect to a router: run
wifi_sta_connect <SSID> <password>in the serial shell;CODE_WIFI_ON_CONNECTEDappears when associated andCODE_WIFI_ON_GOT_IPwhen an IP is obtained; - Use the network: once online, run TCP/UDP/HTTP/MQTT/SNTP applications.
Section Navigation
| Topic | Page | What it does |
|---|---|---|
| Basics | Connect Wi-Fi | Join a router as STA — the prerequisite for every network app |
| Basics | Soft-AP Mode | Turn the module into a hotspot that phones/PCs can join |
| Basics | SNTP (Network Time) | Sync time from an NTP server, no manual calibration |
| TCP | TCP Client / TCP Server | Reliable connection-oriented transport |
| UDP | UDP Client / UDP Server / UDP Broadcast / UDP Multicast | Connectionless, fast transport for streaming and device discovery |
| HTTP/S | GET / POST / PUT / DELETE / HTTPS | Standard web/API requests; HTTPS is the encrypted variant |
| Messaging | MQTT / MQTTS | The most common publish/subscribe IoT protocol |
| Advanced | WebSocket / HTTP OTA / RESTful API | Two-way long connections, remote firmware updates, HTTP server on the module |
Have questions?
For any other questions, visit the unified Q&A and discussion board: Ai-Thinker Discussions

