1196 views|5 replies

249

Posts

5

Resources
The OP
 

[RVB2601 Creative Application Development] Alibaba Cloud Testing [Copy link]

 

After the last article on TCP, I am very close to connecting to Alibaba Cloud. Today I tried to connect to Alibaba Cloud platform. I would like to thank a big guy here: Part of the code of sipower cloud test directly uses his code, but you can analyze his code. The overall code is still based on the previous OS process code. Here we can see the benefits of using OS. For example, the delay of adding flags in the big guy's content is very convenient for us to directly use the delay of OS.

First, we need to modify the W800_api.c and .h files and add functions, which are mainly used to connect to the Alibaba Cloud platform. Secondly, we also need to keep the previous TCP code.

In the wifi_task task, we added a function to connect to the Alibaba Cloud IOT platform. The rest of the wifi initialization code needs to be retained. In the while, we removed the previous TCPclient sending function and replaced it with a function that sends data to the cloud platform.

Let's take a look at some of the things we do in the IOT connection function.

Checking the data manual, it explains that the first step is to connect to our WiFi. This WiFi has the function of connecting to the external network, usually the router device in the home.

Then send the quintuple of the device. The main thing is that the device you created has a unique information. You can fill it in by yourself, and then connect to the cloud platform. Using AT commands, it is very convenient and saves trouble.

These functions should also refer to the writing method of the AT sending command above. They just send and wait to see if the received data is correct and then return accordingly.

After that, we use this command to upload the data value of our device. Then we need to generate the corresponding object model on the cloud platform.

In fact, it is the identifier inside that is important.

Finally, the tasks remain unchanged. There are still three tasks: GUI, sensor, and WIFI. The refresh speed of each task can be modified appropriately.

Here I set the upload task to once every 2 seconds.

The cloud platform also basically updates data every 2 seconds. Let's take a look at the final effect.

Latest reply

I tested the same thing and I don't know how to quote it correctly. Can an expert come out and explain it to me?   Details Published on 2022-5-4 15:22
 
 

249

Posts

5

Resources
2
 
Link: https://pan.baidu.com/s/1E6b9zb5VxqgiyYAUQDPOgA Extraction code: 87o9
 
 
 

6818

Posts

11

Resources
3
 

Thank you, I'll learn from your experience so that I can hand in my homework.

 
 
 

7

Posts

0

Resources
4
 

Compilation error

app/src/main.c:24:10: fatal error: w800_api.h: No such file or directory

Comments

I tested the same thing and I don't know how to quote it correctly. Can an expert come out and explain it to me?  Details Published on 2022-5-4 15:22
 
 
 

6818

Posts

11

Resources
5
 
Shenlongju City published on 2022-5-3 20:36 Compilation error app/src/main.c:24:10: fatal error: w800_api.h: No such file or directory

I tested the same thing and I don't know how to quote it correctly. Can an expert come out and explain it to me?

Comments

Yes, there is this problem. I forgot how I solved it at that time. It is that the CDK and the KEIL method of adding libraries are different. I will go back to see how I solved it at that time. Search and copy  Details Published on 2022-5-5 10:24
 
 
 

249

Posts

5

Resources
6
 
lugl4313820 posted on 2022-5-4 15:22 I did the same test and don't know how to quote correctly. Can an expert come out and explain it to me?

Yes, there is this problem. I forgot how I solved it at that time. It is that the way of adding libraries in CDK and KEIL that we usually use is different. I will go back tonight to see how I solved it at that time.

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list