当前位置:网站首页>Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
Stm32f1+bc20+mqtt+freertos system is connected to Alibaba cloud to transmit temperature and humidity and control LED lights
2022-07-06 12:11:00 【LCIOT】
One 、 Material preparation
Prepare the following materials
Two 、 Device to connect
2.1、 Insert IOT network card
take BC20 Unplug the core board from the motherboard , Insert the card in the IOT card according to the instructions BC20 Core board . Plug in the IOT network card , Re BC20 Replace the core board with the main board
2.2、 Connect the temperature and humidity sensor
Find... On the motherboard JP2, take DHT11 The temperature and humidity sensor is connected , Pay attention to the positive and negative poles , Don't answer it backwards , After connection DHT11 The light of temperature and humidity sensor is on
2.3、 Access the emulator
Access the emulator , For downloading programs . The blue line is redundant
2.4、 Access to computer
Connect the board with the computer USB Serial cable connection , Switch on USB It's about , a main board LED5 Light up ,ST-LINK The emulator is also plugged into the computer
3、 ... and 、 Alibaba cloud Internet of things platform to create products 、 equipment
3.1、 Account registration 、 Log in
Alibaba cloud :
https://cn.aliyun.com/
If you have an account number , Log in directly . If there is no account number , Then register according to the official prompt .
Log in after registration
Follow the prompts to enter the Internet of things platform interface
3.2、 Create products
In the Internet of things platform , There are products in equipment management 、 Equipment etc. , The product is equivalent to Xiaomi Bracelet , The device is similar to a bracelet A. Next, create a new product . In the Internet of things platform , Click on product , Create
Follow the prompts to fill in the relevant information
Product creation complete
3.3、 Create device
Follow the prompts to create the device
Fill in the information as prompted
The creation is complete
3.4、 Add product attributes
Follow the prompts to add product attributes
Add temperature attribute , Note that identifiers should be consistent !!!
Add humidity attribute , Note that identifiers should be consistent !!!
Add to complete
Click publish online
Four 、 Code changes 、 Program download 、 To configure
4.1、 To configure ST-Link Emulator
Open the code , Click Configure emulator
4.2、 Modify the code
Follow the instructions to get TopicPost
Follow the instructions to get Topic
Follow the instructions to get ProductKey、DeviceName、DeviceSecret
Follow the prompts to modify the code
Be careful :Topic、TopicPost Medium ${deviceName} Need to replace with DeviceName!!!
4.3、 Download program
5、 ... and 、 View the data 、 Issue command to control relay
5.1、 View the uploaded temperature and humidity data
As can be seen from the figure, our temperature and humidity data have been uploaded to Alibaba cloud's Internet of things platform in real time
5.2、 Issue instructions to control LED The lamp
Follow the prompts to issue instructions
Input instruction :OpenDevice, open LED The lamp
After sending , On the board LED The indicator lights up
Input instruction :CloseDevice, close LED
After sending , On the board LED The indicator light goes out
边栏推荐
猜你喜欢
ToggleButton实现一个开关灯的效果
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
Priority inversion and deadlock
Characteristics, task status and startup of UCOS III
Detailed explanation of Union [C language]
机器学习--决策树(sklearn)
R & D thinking 01 ----- classic of embedded intelligent product development process
uCOS-III 的特点、任务状态、启动
A possible cause and solution of "stuck" main thread of RT thread
高通&MTK&麒麟 手機平臺USB3.0方案對比
随机推荐
Working principle of genius telephone watch Z3
Several declarations about pointers [C language]
The first simple case of GNN: Cora classification
Redis interview questions
OPPO VOOC快充电路和协议
MySQL START SLAVE Syntax
程序员老鸟都会搞错的问题 C语言基础 指针和数组
Keyword inline (inline function) usage analysis [C language]
Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
Pytorch-温度预测
几个关于指针的声明【C语言】
MySQL realizes read-write separation
C language, log print file name, function name, line number, date and time
Imgcat usage experience
Basic operations of databases and tables ----- view data tables
基于Redis的分布式ID生成器
Principle and implementation of MySQL master-slave replication
imgcat使用心得
Embedded startup process
map文件粗略分析