The actual HaaS100 is equipped with 4G modules to connect to Alibaba Cloud IoT

This article mainly introduces how to use the HaaS100 external 4G module to connect to the Alibaba Cloud IoT platform.

1. Hardware construction

1.1, hardware acquisition

  • HaaS100: Refer to  Taobao link
  • 4G module: 4G module used in this case as EC20: Reference Taobao links ; EC20 development board can also search on Taobao, as long as the modules can be reserved for AT UART.

1.2. Wiring method

  • The wiring diagram is as follows

Wiring diagram.png

  • The actual wiring diagram is as follows

Actual wiring diagram.jpg

note:

  • 4G module uses mini usb for power supply
  • Wiring method:
    • Blue: HaaS100 GND connects to 4G module GND,
    • Purple: HaaS100 UART2 TXD connected to 4G module AT UART RXD
    • White: HaaS100 UART2 RXD connects to 4G module AT UART TXD
  • sim card insertion direction: the notch is at the upper left of the above picture.

2. Cloud configuration

     Log in to the Alibaba Cloud IoT platform to complete the creation of products and equipment; please refer to the relevant product documentation . After completing the device creation, obtain the device certificate on the cloud platform. The device certificate contains ProductKey, DeviceName, and DeviceSecret.

image.png

3. HaaS100 firmware development

3.1, change the device triplet

Modify the triplet information in the code application/example/mqtt_demo/mqtt_example.c on the terminal, as shown in the figure below. The triple information is obtained from the cloud configuration chapter

3.2. Compile the firmware

HaaS100 uses Wi-Fi for data communication by default. When using external modules, you can select the corresponding network device through menuconfig. Compile command:

aos make menuconfig

3.2.1, configuration selection

The configuration steps are as follows:

  • step 1: execute aos make menuconfig
  • step 2: 选择示例:"Applicaiton Configuration" -> "Select App" -> "Builtin Examples" -> "Select example" -> "MQTT Demo"
  • step 3 Select the hardware platform: "BSP" -> "haas100" -> "physical network selection" -> "Enable LTE Module"

Screenshot 2020-12-07 11.30.31.png

3.2.2, compile

aos make

3.2.3, burn

    Please refer to the firmware burning method: HaaS100 Quick Start

4. Debugging of equipment connected to the cloud

After the firmware is burned, the external 4G module of HaaS100 will directly complete the cloud connection operation. The log information and cloud status of the device are as follows:

4.1. Device log:

  • Note that the serial port baud rate: 1500000.

image.png

4.2, cloud status

Cloud.png

5. Summary

HaaS100 supports multiple ways to connect to the cloud, including Wi-Fi, Ethernet and external 4G modules, suitable for a variety of different business scenarios.

This article mainly describes the connection to the Alibaba Cloud IoT platform through the UART external 4G module.

HaaS100 also supports external 4G modules via USB. Related features will be released soon, so stay tuned.

6. Developer technical support

If you need more technical support, you can join the Dingding Developer Group

For more technology and solution introduction, please visit the Aliyun AIoT homepage https://iot.aliyun.com/

 

Guess you like

Origin blog.csdn.net/HaaSTech/article/details/110914796