基于ESP-Rainmaker 本地点灯控制Demo测试
- 🌿
ESP-Rainmaker
项目地址:https://github.com/espressif/esp-rainmaker/tree/master
- ✨这个项目早些时候就已经开始测试了,最后卡在了手机APP连接esp32设备端一直无法连接上,也一直没有找到原因和解决办法,导致该项目测试一直搁置,很有可能是个人手机的问题,前段时间还在该github项目上提交了
Issue
,今天看到别人发的相关的内容能成功,我还是有点不想放弃,今天继续尝试一下,结果误打误撞成功连接上了。
- 🌿本次所使用的测试项目编译的是:
\esp-rainmaker\examples\led_light
⛳项目编译注意事项
- 🌿根据个人所使用的esp32型号的不同,在正式进入项目编译前,需要进行
idf.py menuconfig
引脚配置:(默认配置的是GPIO 8)和使能RGB led
选项。注意:配置好后,记得按S
键,在弹出的对话框按回车保存,当前配置内容。,如下图:
idf.py menuconfig
- 🔖我这里配置的是
GPIO18
引脚。
📑esp-idf编译命令执行步骤:
install.bat //esp-idf初始化
export.bat //运行esp-idf
cd D:\Git_Local\esp-rainmaker\examples\led_light //通过cd命令到项目文件夹
idf.py set-target esp32 //设置编译目标芯片型号(默认为esp32),其他型号esp32c3或者其他esp32s2
idf.py menuconfig //打开菜单配置选项,使能RGB—_LED选项,设置RGB_LED引脚
idf.py build //开始正式进入编译
idf.py -p COM35 flash //烧录到目标芯片,COM35为当前芯片连接电脑的串口端口号
设备接入
-
🔨手机 APP :
ESP-Rainmaker
:https://github.com/espressif/esp-rainmaker-android/releases
-
🌿通过串口调试助手工具打开对应连接电脑的esp32端口:(重启设备,可以查看到下面的信息)
-
🌿将上面框选区域的内容拷贝到浏览器当中,回车,会出现如下带二维码的页面:
- 🌿手机端打开
蓝牙
和定位
功能
- 🌿在
ESP-Rainmaker
APP界面,右上角+
号,添加接入设备
- 🌿可以扫描浏览器页面的二维码,跳转到下一个页面或者点选下面的
I don't have a QR code
选择ble
:
- 🌿连接esp32设备。
- 🌿连接成功后,会自动跳转到输入pop码界面:(我的手机之前就是一直跳不到这个界面)
- 🌿手机蓝牙和esp32蓝牙配对成功后,就会自动跳转到配网界面:(选择一个2.4G的Wifi网络进行连接,输入wifi密码)
-
🌿等待接入完成:
-
🌿esp32设备接入完成后,就可以在
ESP-Rainmaker
APP主界面看到已接入的设备:
-
🌿可以点击并控制接在
GPIO18
引脚上的WS2812灯珠了。 -
- 🍁主界面按键是控制WS2812灯珠亮,灭,
- 🍁主界面按键是控制WS2812灯珠亮,灭,
-
- 🍁点进去可以进行具体的ws2812调光:
- 🍁点进去可以进行具体的ws2812调光:
📚固件分享
- 🔖基于esp32 WS2812 接在GPIO 18引脚上.
- 🔨可以使用乐鑫官方的烧录工具:
flash_download_tool
烧录,我是直接在esp-idf直接通过命令行烧录的。
- 🌿ESP32固件
链接: https://pan.baidu.com/s/1xSZF2fPDjaC1e9z1mPY69A
提取码: ugr8
- 🌿esp32c3固件
链接: https://pan.baidu.com/s/1vMHxKHwQ-0_kTG1h6sKUug
提取码: 81p2
- 📋烧录参考信息:
D:\Espressif\frameworks\esp-idf-v4.4.4>cd D:\Git_Local\esp-rainmaker\examples\led_light2
D:\Git_Local\esp-rainmaker\examples\led_light2>idf.py -p COM35 flash
Executing action: flash
Running ninja in directory d:\git_local\esp-rainmaker\examples\led_light2\build
Executing "ninja flash"...
[1/5] cmd.exe /C "cd /D D:\Git_Local\esp-rainmaker\example...cal/esp-rainmaker/examples/led_light2/build/led_light.bin"
led_light.bin binary size 0x15e520 bytes. Smallest app partition is 0x190000 bytes. 0x31ae0 bytes (12%) free.
[2/5] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D D:\Git_Local\esp-rainmaker\examples\led_light2\build\bootloader\esp-idf\esptool_py && D:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe D:/Espressif/frameworks/esp-idf-v4.4.4/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 D:/Git_Local/esp-rainmaker/examples/led_light2/build/bootloader/bootloader.bin"
Bootloader binary size 0x6410 bytes. 0xbf0 bytes (11%) free.
[2/3] cmd.exe /C "cd /D D:\Espressif\frameworks\esp-idf-v4...sp-idf-v4.4.4/components/esptool_py/run_serial_tool.cmake"
esptool.py esp32 -p COM35 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 16MB 0x1000 bootloader/bootloader.bin 0x20000 led_light.bin 0x8000 partition_table/partition-table.bin 0x16000 ota_data_initial.bin
esptool.py v3.3.2
Serial port COM35
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:3a:f2:8d:cd:e0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00020000 to 0x0017efff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00016000 to 0x00017fff...
Compressed 25616 bytes to 16093...
Writing at 0x00001000... (100 %)
Wrote 25616 bytes (16093 compressed) at 0x00001000 in 0.8 seconds (effective 249.0 kbit/s)...
Hash of data verified.
Compressed 1434912 bytes to 871905...
Writing at 0x00020000... (1 %)
Writing at 0x0002dbe8... (3 %)
Writing at 0x0003b570... (5 %)
Writing at 0x00046df1... (7 %)
Writing at 0x0004e331... (9 %)
Writing at 0x0005b524... (11 %)
Writing at 0x00065575... (12 %)
Writing at 0x0006f509... (14 %)
Writing at 0x00075635... (16 %)
Writing at 0x0007b0c4... (18 %)
Writing at 0x00080d42... (20 %)
Writing at 0x0008676e... (22 %)
Writing at 0x0008c615... (24 %)
Writing at 0x000926f7... (25 %)
Writing at 0x000982bf... (27 %)
Writing at 0x0009e518... (29 %)
Writing at 0x000a4361... (31 %)
Writing at 0x000aa722... (33 %)
Writing at 0x000b0938... (35 %)
Writing at 0x000b62fd... (37 %)
Writing at 0x000bbfd0... (38 %)
Writing at 0x000c1cd7... (40 %)
Writing at 0x000c7f86... (42 %)
Writing at 0x000cdd16... (44 %)
Writing at 0x000d38da... (46 %)
Writing at 0x000d9091... (48 %)
Writing at 0x000dea70... (50 %)
Writing at 0x000e4279... (51 %)
Writing at 0x000e9ed9... (53 %)
Writing at 0x000f0157... (55 %)
Writing at 0x000f5bf8... (57 %)
Writing at 0x000fb5cf... (59 %)
Writing at 0x001016a2... (61 %)
Writing at 0x0010787f... (62 %)
Writing at 0x0010d227... (64 %)
Writing at 0x00112c05... (66 %)
Writing at 0x00117f7f... (68 %)
Writing at 0x0011d3d9... (70 %)
Writing at 0x0012269d... (72 %)
Writing at 0x00127d44... (74 %)
Writing at 0x0012d45f... (75 %)
Writing at 0x00132e32... (77 %)
Writing at 0x001387c7... (79 %)
Writing at 0x0013e4a1... (81 %)
Writing at 0x00143d79... (83 %)
Writing at 0x0014956f... (85 %)
Writing at 0x00152506... (87 %)
Writing at 0x001591e2... (88 %)
Writing at 0x00160e26... (90 %)
Writing at 0x0016687f... (92 %)
Writing at 0x0016c74b... (94 %)
Writing at 0x00171fa9... (96 %)
Writing at 0x00177aec... (98 %)
Writing at 0x0017ce5f... (100 %)
Wrote 1434912 bytes (871905 compressed) at 0x00020000 in 23.3 seconds (effective 492.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 164...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (164 compressed) at 0x00008000 in 0.1 seconds (effective 223.4 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 31...
Writing at 0x00016000... (100 %)
Wrote 8192 bytes (31 compressed) at 0x00016000 in 0.2 seconds (effective 397.2 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Done
D:\Git_Local\esp-rainmaker\examples\led_light2>