WLED介绍
官网: https://kno.wled.ge/
项目地址:github中的项目地址
编译好的固件: releases版本,编译好的固件
参照: https://blog.csdn.net/weixin_42938082/article/details/122658986
自定义编译固件
自己想修改源代码,自定义编译,怎么弄?请看这里
修改GUI 网页(比如加自己的元素,汉化等等)
(1)修改 html 元素
gui网页等等内容均在这里, 可以根据需要修改页面元素,或者汉化一下英文均可
WLED-main/wled00/data
(2)编译 html
为何这个 html 要编译呢? wled 官网有介绍
为了节省空间,Web UI 界面表示为一系列 wled00/html_ui.h、wled00/html_settings.h 和 wled00/html_other.h 文件,其中包含具有 Web UI 特定部分的 C/C++ 字符串。
这些文件是从 wled00/data 文件夹中可用的源文件自动创建的。要生成文件,请全局安装NodeJS 11.0+。之后,html_*.h通过在 repo 目录中运行来重新创建文件:
(2-1) 更新及安装 NodeJS 11.0+, 自行百度安装
我的版本是16 在 11之后, 版本过旧会编译不过
$ nodejs -v
v16.17.1
(2-2) 开始编译, 注意在首层WLED-main 目录下
npm install
npm run build
没有报错即可
(2-3) 可以实现保存老版本的 html_ui.h, 编译完毕和原始的 html_ui.h 是否有改变,确定编译是否生效
vim -d wled00/html_ui.h ~/html_ui.h
编译烧入的bin
编译配置设置及编译,参考官网: 编译
工具及软件下载
(1) 固件烧入软件(支持linux平台)
1 源码安装
git clone https://github.com/espressif/esptool.git
2 pip安装
pip install esptool
或者
pip3 install esptool
3 使用介绍
https://blog.csdn.net/espressif/article/details/105028809
https://blog.csdn.net/qq_42294237/article/details/122266491
https://blog.csdn.net/chenqioulin/article/details/111086070
固件烧入
1 擦除原始固件
esptool.py --port /dev/ttyUSB0 erase_flash
2烧入 WLED固件
(1) 下载固件,我这里的芯片是 ESP8266 所以选择 releases版本,编译好的固件 WLED_0.13.3_ESP8266.bin 下载
(2) 烧入固件
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=detect 0 ../WLED_0.13.3_ESP8266.bin
esptool.py v3.3.2
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: b4:e6:2d:52:92:92
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Flash will be erased from 0x00000000 to 0x000b6fff...
Flash params set to 0x0320
Compressed 749456 bytes to 507153...
Wrote 749456 bytes (507153 compressed) at 0x00000000 in 44.7 seconds (effective 134.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
WLED 使用及配置
刷机成功后安装图示连接好所以设备后,接入电源后,访问WLED的控制界面方法。ESP8266 会在WLED 固件的作用下自动创建 WELD的AP,首先,手机或者电脑连接到WLED的wifi,名称为WLED-AP,连接密码为wled1234。连接上wifi之后,可浏览器访问4.3.2.1地址即可进入控制界面,接下来就是按照官网说明,配置即可。