当前位置:网站首页>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
边栏推荐
- There are three iPhone se 2022 models in the Eurasian Economic Commission database
- 程序员老鸟都会搞错的问题 C语言基础 指针和数组
- gcc 编译选项
- Kaggle competition two Sigma connect: rental listing inquiries
- Selective sorting and bubble sorting [C language]
- uCOS-III 的特点、任务状态、启动
- Several declarations about pointers [C language]
- Cannot change version of project facet Dynamic Web Module to 2.3.
- Reno7 60W super flash charging architecture
- Pytorch实现简单线性回归Demo
猜你喜欢
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries
Programmers can make mistakes. Basic pointers and arrays of C language
高通&MTK&麒麟 手機平臺USB3.0方案對比
Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
Feature of sklearn_ extraction. text. CountVectorizer / TfidVectorizer
Time slice polling scheduling of RT thread threads
基于Redis的分布式ID生成器
IOT system framework learning
Basic operations of databases and tables ----- view data tables
Basic operations of databases and tables ----- creating data tables
随机推荐
imgcat使用心得
锂电池基础知识
RuntimeError: cuDNN error: CUDNN_ STATUS_ NOT_ INITIALIZED
ESP8266通过arduino IED连接巴法云(TCP创客云)
电商数据分析--薪资预测(线性回归)
Reno7 60W超级闪充充电架构
Dead loop in FreeRTOS task function
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED
C语言,log打印文件名、函数名、行号、日期时间
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
uCOS-III 的特点、任务状态、启动
C语言函数之可变参数原理:va_start、va_arg及va_end
Imgcat usage experience
Redis interview questions
ES6语法总结--上篇(基础篇)
程序员老鸟都会搞错的问题 C语言基础 指针和数组
Gallery之图片浏览、组件学习
Esp8266 connects to onenet cloud platform (mqtt) through Arduino IDE
JS 函数提升和var变量的声明提升
js 变量作用域和函数的学习笔记