Arduino ESP32FS 插件使用教程
2026-01-16 10:10:11作者:仰钰奇
项目目录结构及介绍
arduino-esp32fs-plugin/
├── README.md
├── keywords.txt
├── platform.txt
├── tools
│ └── esp32fs.jar
└── examples
└── FSBrowser
├── FSBrowser.ino
├── data
│ └── index.html
└── README.md
- README.md: 项目说明文件,包含项目的基本信息和使用指南。
- keywords.txt: 关键字文件,用于语法高亮。
- platform.txt: 平台配置文件,定义了编译和上传的工具链。
- tools/esp32fs.jar: 核心工具文件,用于上传文件到ESP32的文件系统。
- examples/FSBrowser: 示例项目,展示如何使用文件系统浏览器。
- FSBrowser.ino: 主程序文件。
- data/index.html: 存储在文件系统中的示例文件。
- README.md: 示例项目的说明文件。
项目的启动文件介绍
项目的启动文件是 examples/FSBrowser/FSBrowser.ino。这个文件是一个示例程序,展示了如何使用ESP32FS插件上传文件到ESP32的文件系统,并通过Web服务器提供这些文件。
#include <WiFi.h>
#include <FS.h>
#include <SPIFFS.h>
#include <ESPAsyncWebServer.h>
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
AsyncWebServer server(80);
void setup() {
Serial.begin(115200);
if (!SPIFFS.begin(true)) {
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi..");
}
Serial.println(WiFi.localIP());
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send(SPIFFS, "/index.html", "text/html");
});
server.begin();
}
void loop() {}
项目的配置文件介绍
项目的配置文件是 platform.txt。这个文件定义了编译和上传的工具链,以及如何调用 esp32fs.jar 工具上传文件到ESP32的文件系统。
## Compiler commands
compiler.c.cmd=xtensa-esp32-elf-gcc
compiler.c.flags=-c -g -Os {compiler.c.extra_flags} -MMD -mlongcalls -DF_CPU=240000000L -DARDUINO=10813 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DESP32 -DCORE_DEBUG_LEVEL=0
## Upload commands
tools.esptool.upload.pattern="{path}/esptool{prog.py_ext} -p {serial.port} -b {upload.speed} write_flash @{board.flash_components} {build.flash_size} {build.flash_freq} {build.flash_mode} {build.flash_start} {build.path}/{build.project_name}.bin"
## ESP32FS tool
tools.esp32fs.cmd=java
tools.esp32fs.path={runtime.tools.esp32fs.path}
tools.esp32fs.pattern="{tools.esp32fs.cmd}" -jar "{tools.esp32fs.path}/esp32fs.jar" "{build.path}" "{build.flash_size}" "{serial.port}"
- compiler.c.cmd: 定义了C编译器的命令。
- compiler.c.flags: 定义了编译器的标志。
- tools.esptool.upload.pattern: 定义了上传固件的命令。
- tools.esp32fs.cmd: 定义了调用
esp32fs.jar
登录后查看全文
热门项目推荐
相关项目推荐
kernelopenEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。C0113
let_datasetLET数据集 基于全尺寸人形机器人 Kuavo 4 Pro 采集,涵盖多场景、多类型操作的真实世界多任务数据。面向机器人操作、移动与交互任务,支持真实环境下的可扩展机器人学习00
mindquantumMindQuantum is a general software library supporting the development of applications for quantum computation.Python059
PaddleOCR-VLPaddleOCR-VL 是一款顶尖且资源高效的文档解析专用模型。其核心组件为 PaddleOCR-VL-0.9B,这是一款精简却功能强大的视觉语言模型(VLM)。该模型融合了 NaViT 风格的动态分辨率视觉编码器与 ERNIE-4.5-0.3B 语言模型,可实现精准的元素识别。Python00
GLM-4.7-FlashGLM-4.7-Flash 是一款 30B-A3B MoE 模型。作为 30B 级别中的佼佼者,GLM-4.7-Flash 为追求性能与效率平衡的轻量化部署提供了全新选择。Jinja00
项目优选
收起
deepin linux kernel
C
27
11
OpenHarmony documentation | OpenHarmony开发者文档
Dockerfile
487
3.61 K
Ascend Extension for PyTorch
Python
298
332
暂无简介
Dart
738
177
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
270
113
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
865
467
仓颉编译器源码及 cjdb 调试工具。
C++
149
880
React Native鸿蒙化仓库
JavaScript
296
343
Dora SSR 是一款跨平台的游戏引擎,提供前沿或是具有探索性的游戏开发功能。它内置了Web IDE,提供了可以轻轻松松通过浏览器访问的快捷游戏开发环境,特别适合于在新兴市场如国产游戏掌机和其它移动电子设备上直接进行游戏开发和编程学习。
C++
52
7
🔥LeetCode solutions in any programming language | 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解
Java
65
20