Skip to content

Contributed by Aixiao, organized by Ai-Thinker

[Tutorial] Ai-WB2 Series Module / Development Board Connecting to AWS Amazon Cloud

Preface This article introduces how to connect the Ai-WB2 series module/development board to Amazon Cloud (AWS). 1. Hardware and Software Preparation One Ai-WB2 series module/development board Ai-WB2 series flashing software, download link: Click to download AWS connection demo: Source code One USB-to-TTL serial adapter board 2. Creating the AWS IoT Thing Model

  1. Register an AWS account and log in to the AWS IoT console, registration link (when registering, you need a company name and a business license, and the application takes a while to review).

  1. After registering and logging in, select Manage from the left menu of the AWS IoT console.

  1. Click Things and then select Create things.

  1. On the Create things page, select Create a single thing, then select Next.

  1. On the Specify thing properties page, for Thing name, enter a name for the thing, e.g., M61_AWS001. (When naming a thing, choose the name carefully, because you will not be able to change it after the thing is created. To change the name, you must create a new thing, give it the new name, and then delete the old thing.) Leave the rest of the fields on this page blank. Select Next.

  1. On the Configure device certificate - optional page, select Auto-generate a new certificate (recommended). Select Next.

  1. On the Attach policies to certificate - optional page, select Create policy. (The device certificate used by the device to connect must have an attached policy; otherwise the device cannot connect to the platform with the generated certificate.)

  1. On the Create policy page, fill in the Policy name and the Policy document, then click Create.

  1. After the policy is created, select the policy you just created, then click Create things.

  1. After the thing is created, save all the certificates and keys, then click Done. The AWS IoT thing model is now ready.

3. Getting and Configuring the AWS Connection Demo

  1. Download the source code: git clone <https://github.com/Ai-Thinker-Open/aithinker_dev_open_sdk.git>.
  2. Follow the readme in the SDK to update the submodules and set up the repository environment, etc.
  3. In application/aws_iot_demo/main.c, replace device_cert, private_key, root_ca, and BROKER_URI_SSL with your own xxx.-certificate.pem, xxx.private.key, AmazonRootCA1.pem, and xxx-ats.iot.us-east-2.amazonaws.com values.

  1. Run ./build.sh bl602 aws_iot_demo menuconfig to enter the menu configuration, select application, and change WiFi connect SSID and WiFi connect password to the WiFi credentials of the network you want to connect to.

  1. Run ./build.sh bl602 aws_iot_demo cn debug. The generated bin files are located in \out\bl602\aws_iot_demo\bin.

4. Hardware Wiring

The Ai-WB2 series development board only needs to be connected via USB Type-C

Wire the Ai-WB2 series modules according to the table below

Wiring diagrams for each module

5. Using the Flashing Software

  1. Double-click BLDevCube.exe, as shown below

  1. Select the BL602/604 chip

(1) Select the BL602/604 chip

(2) Click OK

  1. Select the IoT download mode

  1. For a detailed description of the flashing tool parameters, see the docs directory in the flashing tool. Here is a brief explanation of the parameters in the red box:

  • Interface: selects the communication interface for downloading/flashing. You can choose Jlink or UART according to your actual physical connection. UART is selected by default.

  • Port/SN: when UART is selected for downloading, select the COM port connected to the chip here. You can click the Refresh button to refresh the COM port list.

  • Uart Rate: when UART is selected for downloading, set the baud rate here. 921600 is recommended for flashing.

  • JLink Rate: when JLink is selected for downloading, this configures the flashing speed. The default value is 1000.

  1. The following uses a bin file to demonstrate a successful flash:

5.1 Place the relevant flashing files as shown in the screenshot below

(1) Select /chips/bl616/partition/partition_cfg_4M.toml in the flashing tool

(2) Select /chips/bl616/builtin_imgs/boot2_isp_bl616_v6.5.4/boot2_isp_release.bin in the flashing tool

(3) Select chips/bl616/device_tree/bl_factory_params_IoTKitA_auto.dts in the flashing tool

(4) Select the bin file compiled from the demo

5.2 Click the Create&Download button to start flashing. When "Please Press Reset Key!" appears, press the RST button on the left side of the Ai-WB2 series development board to enter flashing mode.

5.3 Flashing successful

Common flashing problems:

(1) This error means the serial port is occupied by another program. You must close the program occupying the serial port.

6. Connecting to AWS

After the module in the demo connects to AWS, it automatically publishes to a topic. Subscribe to the topic "/topic/qos1" in the MQTT test client to receive the messages published by the module.

  1. Publish to the topic "/topic/qos0" in the MQTT test client

  1. The module receives the message

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