This article mainly introduces how to connect to the Alibaba Cloud IoT platform through the HaaS100 Ethernet port.
1. Introduction to hardware
HaaS100 comes with an Ethernet port, the hardware specifications are detailed in: HaaS100 hardware specifications .
note:
- The Ethernet port of HaaS100 is 10/100M . When connecting to a router or switch, please pay attention to whether the opposite end is compatible.
2. Cloud configuration
Log in to the Alibaba Cloud IoT platform to complete the creation of products and equipment; please refer to the relevant Alibaba Cloud IoT platform quick start practice . After completing the device creation, obtain the device certificate on the cloud platform.
The device certificate contains ProductKey, DeviceName, and DeviceSecret.
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, where the triplet information is obtained from the cloud configuration chapter.
As shown below.
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: Select example: "Applicaiton Configuration" -> "Select App" -> "Builtin Examples" -> "Select example" -> "MQTT Demo", and save the configuration;
- Step 3: Select the hardware platform: "BSP" -> "haas100" -> "physical network selection" -> "Enable Ethernet", and save the configuration;
- Step 4: Enter aos make menuconfig again to confirm whether the previous configuration takes effect;
3.2.2, compile
aos make
3.2.3, burn
Please refer to the firmware burning method: HaaS100 Quick Start
4. Connect the device to the cloud
After completing the firmware burning, insert the network cable; the device will enable DHCP by default, automatically obtain the local IP address, and automatically connect to the Alibaba Cloud IoT platform after obtaining the IP address.
4.1. Device log
- Note that the serial port baud rate is 1500000.
IP address log obtained on the device side
Device-side connection to the IoT platform log
4.2, cloud status
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 native Ethernet port of the machine. You only need to modify the triple information in the sample code to quickly connect to the cloud.
6. Developer technical support
If you need more technical support, you can join the DingTalk developer group or follow the WeChat public account
For more technology and solution introduction, please visit the Aliyun AIoT homepage https://iot.aliyun.com/