当前位置:网站首页>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 
边栏推荐
- 【ESP32学习-2】esp32地址映射
- Pytorch-温度预测
- C language, log print file name, function name, line number, date and time
- RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
- Détails du Protocole Internet
- Bubble sort [C language]
- 基于Redis的分布式ID生成器
- sklearn之feature_extraction.text.CountVectorizer / TfidVectorizer
- Dead loop in FreeRTOS task function
- Pytoch implements simple linear regression demo
猜你喜欢

Basic knowledge of lithium battery

RT thread API reference manual

Reno7 60W超级闪充充电架构

Mp3mini playback module Arduino < dfrobotdfplayermini H> function explanation

AMBA、AHB、APB、AXI的理解

Machine learning -- decision tree (sklearn)

Time slice polling scheduling of RT thread threads

MySQL realizes read-write separation

数据分析之缺失值填充(重点讲解多重插值法Miceforest)

STM32 how to locate the code segment that causes hard fault
随机推荐
IOT system framework learning
ESP8266使用arduino连接阿里云物联网
STM32 如何定位导致发生 hard fault 的代码段
Common properties of location
MySQL占用内存过大解决方案
Unit test - unittest framework
arduino JSON数据信息解析
共用体(union)详解【C语言】
Dead loop in FreeRTOS task function
Variable parameter principle of C language function: VA_ start、va_ Arg and VA_ end
GNN的第一个简单案例:Cora分类
Internet protocol details
There are three iPhone se 2022 models in the Eurasian Economic Commission database
Oppo vooc fast charging circuit and protocol
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
Working principle of genius telephone watch Z3
Important methods of array and string
Imgcat usage experience
E-commerce data analysis -- User Behavior Analysis
【ESP32学习-1】Arduino ESP32开发环境搭建