Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baidadi/iot-stm-c8t6_arduino_mqtt_aliyun
一种使用Arduino架构的STM32F103C8T6通过ESP8266模块以MQTT协议连接阿里云的解决方案
https://github.com/baidadi/iot-stm-c8t6_arduino_mqtt_aliyun
aliyun arduino esp8266 mqtt stm32f103c8t6
Last synced: about 12 hours ago
JSON representation
一种使用Arduino架构的STM32F103C8T6通过ESP8266模块以MQTT协议连接阿里云的解决方案
- Host: GitHub
- URL: https://github.com/baidadi/iot-stm-c8t6_arduino_mqtt_aliyun
- Owner: BaiDaDi
- Created: 2023-09-11T12:33:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-15T07:13:07.000Z (over 1 year ago)
- Last Synced: 2024-11-13T12:46:49.575Z (2 months ago)
- Topics: aliyun, arduino, esp8266, mqtt, stm32f103c8t6
- Language: C++
- Homepage:
- Size: 248 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IoT-STM-C8T6_Arduino_MQTT_Aliyun
一种使用Arduino架构的STM32F103C8T6通过ESP8266模块以MQTT协议连接阿里云的解决方案
总体设计是一个非常逻辑的思路
Step1:阿里云注册,创建产品,得到三元组
Step2:三元组计算密码(阿里云自带工具,sha1)
Step3:MQTT.fx测试三元组的可用,topic和JSON的格式
https://help.aliyun.com/zh/iot/getting-started/connect-a-device-to-iot-platform-by-using-mqtt-fx-1?spm=a2c4g.11186623.0.0.317d4956czyMtH
Step4:ESP8266,AT指令,七步上网,参考TXT
Step5:MCU与ESP通讯,关键在于转义字符,这里测了很多次。其次是程序架构
串口使用arduino的ReadString函数,效果还行但是第一个流只能读一半
架构上Pub与callback分离,pub在循环中发送,曾经使用Timer,调用失败
pub和callback放在loop里面,循环着读,也能凑合用吧
另外callback的分析没用ArduinoJSON库,使用了一个取巧的办法,一个demo凑合用吧