Skip to content

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:

  1. Initialize the Wi-Fi stack: the example prints PHY RF init success! at boot, then goes through Starting wifi ... / Starting fhost ...;
  2. Connect to a router: run wifi_sta_connect <SSID> <password> in the serial shell; CODE_WIFI_ON_CONNECTED appears when associated and CODE_WIFI_ON_GOT_IP when an IP is obtained;
  3. Use the network: once online, run TCP/UDP/HTTP/MQTT/SNTP applications.

Section Navigation

TopicPageWhat it does
BasicsConnect Wi-FiJoin a router as STA — the prerequisite for every network app
BasicsSoft-AP ModeTurn the module into a hotspot that phones/PCs can join
BasicsSNTP (Network Time)Sync time from an NTP server, no manual calibration
TCPTCP Client / TCP ServerReliable connection-oriented transport
UDPUDP Client / UDP Server / UDP Broadcast / UDP MulticastConnectionless, fast transport for streaming and device discovery
HTTP/SGET / POST / PUT / DELETE / HTTPSStandard web/API requests; HTTPS is the encrypted variant
MessagingMQTT / MQTTSThe most common publish/subscribe IoT protocol
AdvancedWebSocket / HTTP OTA / RESTful APITwo-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

Released under the MIT License. Build Time 2026-09-11 14:52:23