China Mobile 4G module-ML302-OpenCpu development-2-MQTT connects to Alibaba Cloud

Station B: https://space.bilibili.com/309103931

China Mobile 4G module-ML302 column: https://blog.csdn.net/qq_33259323/category_10453372.html

China Mobile 4G Module-ML302 Collection: https://www.bilibili.com/read/readlist/rl328642

1. China Mobile 4G module-ML302-OpenCpu development-(firmware compilation and burning)

https://blog.csdn.net/qq_33259323/article/details/108586847

https://www.bilibili.com/read/cv7876504

2. China Mobile 4G module-ML302-OpenCpu development-(MQTT connects to Alibaba Cloud)

https://blog.csdn.net/qq_33259323/article/details/108638945

https://www.bilibili.com/read/cv7876527

2.1 China Mobile 4G module-ML302-OpenCpu development-(MQTT connection to Alibaba Cloud-subscribe topic)

https://blog.csdn.net/qq_33259323/article/details/108960540

https://www.bilibili.com/read/cv7879954

2.2 China Mobile 4G module-ML302-OpenCpu development-(MQTT connection to Alibaba Cloud-receiving and sending data)

https://blog.csdn.net/qq_33259323/article/details/108964810

https://www.bilibili.com/read/cv7886836

2.3 China Mobile 4G Module-ML302-OpenCpu Development-(MQTT connects to Alibaba Cloud-RRPC communication)

https://blog.csdn.net/qq_33259323/article/details/108965071

https://www.bilibili.com/read/cv7888259

3. China Mobile 4G module-ML302-OpenCpu development-serial port development

https://blog.csdn.net/qq_33259323/article/details/108974888

https://www.bilibili.com/read/cv7888865

4. China Mobile 4G module-ML302-OpenCpu development-51 MCU serial port to I2C

https://blog.csdn.net/qq_33259323/article/details/109020642

https://www.bilibili.com/read/cv7922942

5. China Mobile 4G module-ML302-OpenCpu development-MCP23017 input/output

https://blog.csdn.net/qq_33259323/article/details/109109136

https://www.bilibili.com/read/cv7969395

7. Mid-shift 4G module-ML302-OpenCpu development-PCF8591 measurement voltage

https://blog.csdn.net/qq_33259323/article/details/109109266

https://www.bilibili.com/read/cv7969365

8. China Mobile 4G module-ML302-OpenCpu development-GPIO

https://blog.csdn.net/qq_33259323/article/details/108960947

https://www.bilibili.com/read/cv7877192

9. China Mobile 4G Module-ML302-OpenCpu Development-ADC

https://blog.csdn.net/qq_33259323/article/details/109020864

https://www.bilibili.com/read/cv7922958

10. China Mobile 4G Module-ML302-OpenCpu Development-CJSON

https://blog.csdn.net/qq_33259323/article/details/109020898

https://www.bilibili.com/read/cv7923020

11. China Mobile 4G Module-ML302-OpenCpu Development-HTTP

https://blog.csdn.net/qq_33259323/article/details/109020904

https://www.bilibili.com/read/cv7923054

 

China Mobile 4G module-ML302-OpenCpu development-(MQTT connects to Alibaba Cloud)

Alibaba Cloud project creation and device registration (please see the next one if it has been created)

Open https://iot.console.aliyun.com/product/createProduct to create a product

Fill in the relevant information, please pay attention to the three red boxes below. Click Create after finishing

Open https://iot.console.aliyun.com/devices and click Add Device

After creating the product, you need to remember the following things, which will be used below

 

ML302 connects to Alibaba Cloud MQTT

The following Baidu cloud link is ML302_OpenCPU_V2.1.0 OPENCPU development firmware, download it

https://pan.baidu.com/s/1pA9rmXlWuV1s25e1GVzF4g Extraction code: yvjl 

First, open the ML302_OpenCPU\src\demo\aliyun\src\wrappers\wrapper.c file, you can see these four variables, corresponding to the product and device keys obtained just now.

 Then open the ML302_OpenCPU\src\cm_main.c file and call the following method in the cm_main_task function

Because there are several parameters in the function by default, we need to remove them, and then the following comments can be changed as needed

 After the modification, compile->burn->restart->open the serial port, and see something similar to the following to indicate that the connection is successful. If the connection fails, the failure content will be printed.

 Then open the web page -> enter the device details, you can test the delay

Guess you like

Origin blog.csdn.net/qq_33259323/article/details/108638945