# esp32-remote-thermometer **Repository Path**: liu_yi_qiang/esp32-remote-thermometer ## Basic Information - **Project Name**: esp32-remote-thermometer - **Description**: 使用ESP32-C3通过MQTT协议把温度、湿度传至远端服务器。 信息流向: ---> ESP32-DHT11 ---> ESP32-MQTT-Publish ---> MQTT-Broker ---> MQTT-Subscribe ---> MySQL/APP - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-06-02 - **Last Updated**: 2023-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 功能介绍 - 使用ESP32-C3通过MQTT协议把温度、湿度传至远端服务器。 - 信息流向: - ---> ESP32-DHT11 - ---> ESP32-MQTT-Publish - ---> MQTT-Broker - ---> MQTT-Subscribe - ---> MySQL/APP ### 需要的硬件 - ESP32-C3-MINI-1 - DHT11温湿度传感器 - micro-USB线(支持数据传输) ### 需要的软件 - [ESP32-C3: MicroPython固件](https://micropython.org/download/esp32c3/) - resource/esp32c3-20220618-v1.19.1.bin - [ESP32-C3: 烧录工具](https://github.com/espressif/esptool) - resource/esptool-master.zip - ⚠️ 进入/dev确认要烧录的设备,将 *** 替换为设备编号 ``` python3 esptool.py --chip esp32c3 --port /dev/*** erase_flash python3 esptool.py --chip esp32c3 --port /dev/*** --baud 460800 write_flash -z 0x0 esp32c3-20220117-v1.18.bin ``` - [Thonny: 编辑/调试/烧录的IDE](https://thonny.org/) - [Mac](https://github.com/thonny/thonny/releases/download/v3.3.13/thonny-3.3.13.pkg) - [Windows](https://github.com/thonny/thonny/releases/download/v3.3.13/thonny-3.3.13.exe) - [Emqx: MQTT-Broker](https://www.emqx.io/docs/zh/v5.0/) - [安装与部署](https://www.emqx.io/docs/zh/v5.0/deploy/install.html) - [paho-mqtt: MQTT:Publish/Subscribe](https://pypi.org/project/paho-mqtt/) ``` pip3 install paho-mqtt ``` ### 具体步骤 1. 烧录固件道ESP32 2. Thonny连上ESP32 3. 存入/esp32下的文件 - /resource/mqtt.py - /resource/boot.py 4. 搭建MQTT-Broker 5. 搭建MySQL 6. 配置远端的MQTT-Subscribe - 记录温湿度数据 - 展示温湿度数据 ### 相关文档 - [microPython文档](http://docs.micropython.org/en/latest/esp32/quickref.html#delay-and-timing) - [microPython仓库](https://github.com/micropython/micropython) ### 注意事项 - -