Create Alibaba Cloud IoT Platform
Make a record of the cloud platform device creation process, too lazy to watch the video
Article reference video: https://www.bilibili.com/video/BV1jP4y1E7TJ?p=26&vd_source=50694678ae937a743c59db6b5ff46c31
Aliyun: https://www.aliyun.com
1. Introduction to IoT Platform
LAN communication
Because mobile phones and computers are connected to the Internet through the operator, the operator assigns dynamic IP addresses, and the connection cannot be established stably for a long time, so it is necessary to use a cloud server to obtain a stable connection
How to get a cloud server
At present, many manufacturers on the market have their own IoT platforms, which can be provided to individuals for simple development. This experiment uses the Alibaba Cloud platform
The network communication protocol required to connect to the cloud platform
Most of the communication protocols between embedded devices and Alibaba Cloud are MQTT protocols
communication signal
2. Create products and devices on Alibaba Cloud
Register an account
Click the interface after the console, and then follow the steps below to click
Click IoT Platform in all open projects
Enter the homepage of the Internet of Things platform
A free public instance is used here, which is enough for personal learning
Click on the number of devices according to the steps on the home page of the Internet of Things platform, and jump to the following page to create a product
Set product parameters, product name customization
After creating the product, add a device
Finished creating the device, showing not activated
3. Install the MQTT.fx software
After the cloud platform device is created, it is necessary to verify whether the cloud platform can communicate normally. You can use the software to perform the communication test of the MQTT protocol with the cloud platform.
The tutorial gives the use of MQTT.fx software, but I need a license when I use this software. If there is no license, I can’t use it. If there is, you can follow the steps below
Alibaba Cloud MQTT.fx documentation: https://help.aliyun.com/document_detail/140507.html
MQTTX software can be used without a license. The configuration steps and communication methods are similar to those of MQTT.fx. You can refer to: https://blog.csdn.net/weixin_46251230/article/details/128994554
After installing the MQTT.fx software, open the software, then set the software parameters, and establish a connection with the cloud platform
Go back to the Alibaba Cloud platform and find the MQTT connection parameters
click to connect
After clicking Connect in the previous step, refresh the Alibaba Cloud platform to check whether the device is online
4. Test data sending and receiving
Data downlink test
Firstly, the data downlink test is performed. The downlink means that the cloud server sends data, and the MQTT.fx software receives the data.
Before data communication, you need to understand the type of Topic:
Uploading the data collected by the hardware to the cloud is called publishing; sending the data from the cloud to the development board is called subscription.
The MQTT.fx software subscribes to this Topic class, and the subsequent cloud platform sends information through this Topic class, and the MQTT.fx software can receive it. If there is no subscription, it cannot receive
Replace ${deviceName} with your own device name. This is very important. If you use a topic with other permissions, you must also change the device number.
If multiple devices are created, which device you want to communicate with, replace it with the corresponding device name
The MQTT.fx software receives the test data, indicating that the data downlink test is successful
Aliyun platform can view all data sent
Data uplink test
MQTT.fx software sends data, cloud server receives
If the received data is correct, it means that the data uplink test is successful
5. In-depth self-study materials
Then there will be Aliyun platform learning materials