From 7d635cedd027a7a7e23ee10e2b0c7fd4390c3e95 Mon Sep 17 00:00:00 2001 From: Anthony Marchand Date: Thu, 29 Jan 2026 00:42:35 +0100 Subject: [PATCH] docs: add firmware upload guide and translate platformio.ini comments - Add FIRMWARE_UPLOAD.md with PlatformIO upload instructions - Translate platformio.ini comments to English - Remove redundant comments from platformio.ini --- FIRMWARE_UPLOAD.md | 91 ++++++++++++++++++++++++++++++++++++++++++++++ platformio.ini | 27 ++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 FIRMWARE_UPLOAD.md create mode 100644 platformio.ini diff --git a/FIRMWARE_UPLOAD.md b/FIRMWARE_UPLOAD.md new file mode 100644 index 0000000..21b8fee --- /dev/null +++ b/FIRMWARE_UPLOAD.md @@ -0,0 +1,91 @@ +# Upload Guide from Cursor + +## Installing PlatformIO + +1. **Install PlatformIO extension in Cursor**: + - Open extensions (Cmd+Shift+X / Ctrl+Shift+X) + - Search for "PlatformIO IDE" + - Install the official extension + +2. **Wait for installation**: + - PlatformIO will automatically install necessary tools + - This may take a few minutes the first time + +## Serial Port Configuration + +1. **Connect your ESP32-S3** via USB +2. **Identify the port**: + - macOS: `/dev/cu.usbserial-*` or `/dev/cu.usbmodem*` + - Windows: `COM3`, `COM4`, etc. + - Linux: `/dev/ttyUSB0` or `/dev/ttyACM0` + +3. **Uncomment and modify the line in `platformio.ini`**: + ```ini + upload_port = /dev/cu.usbserial-XXXX ; Replace with your port + ``` + +## Firmware Upload + +### Method 1: Via PlatformIO Toolbar + +1. Click on the **PlatformIO** icon in the left sidebar +2. In **PROJECT TASKS** → **esp32-s3-devkitc-1** +3. Click **Upload** (or **Build and Upload**) + +### Method 2: Via Command Palette + +1. Open command palette (Cmd+Shift+P / Ctrl+Shift+P) +2. Type "PlatformIO: Upload" +3. Select the `esp32-s3-devkitc-1` environment + +### Method 3: Via Integrated Terminal + +```bash +pio run --target upload +``` + +## LittleFS Filesystem Upload + +**IMPORTANT**: After uploading the firmware, you must also upload the files from the `data/` folder (index.html, index.js, etc.) + +### Via Command Palette + +1. Command palette (Cmd+Shift+P / Ctrl+Shift+P) +2. Type "PlatformIO: Upload Filesystem Image" +3. Select the `esp32-s3-devkitc-1` environment + +### Via Terminal + +```bash +pio run --target uploadfs +``` + +## Verification + +1. **Open serial monitor**: + - Command palette → "PlatformIO: Serial Monitor" + - Or PlatformIO icon → **Monitor** + +2. **Check messages**: + - You should see "Startup/Boot...." + - And "File system mounted successfully" + +3. **Connect to web interface**: + - Look for IP address in serial logs + - Or connect to WiFi "ESPSomfy RTS" if in AP mode + +## Troubleshooting + +### "Port not found" Error +- Verify ESP32 is properly connected +- Check port in `platformio.ini` +- On macOS/Linux, you may need permissions: `sudo chmod 666 /dev/cu.usbserial-*` + +### Compilation Error +- Verify all libraries are installed +- PlatformIO installs them automatically, but you can force: `pio lib install` + +### Filesystem Won't Upload +- Make sure firmware was uploaded first +- Verify the `data/` folder exists +- Some boards require manual reset before filesystem upload diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..adfddc1 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,27 @@ +[env:esp32-s3-devkitc-1] +platform = espressif32 +board = esp32-s3-devkitc-1 +framework = arduino +monitor_speed = 115200 +upload_speed = 921600 + +; Partition scheme with LittleFS +board_build.partitions = default.csv +board_build.filesystem = littlefs + +; Required libraries +lib_deps = + bblanchon/ArduinoJson@^6.21.3 + https://github.com/LSatan/SmartRC-CC1101-Driver-Lib.git + knolleary/PubSubClient@^2.8 + links2004/WebSockets@^2.4.1 + +; Build options +build_flags = + -DCORE_DEBUG_LEVEL=3 + +; Serial port (adjust according to your system) +upload_port = /dev/cu.usbmodem101 ; macOS - ESP32-S3 detected +monitor_port = /dev/cu.usbmodem101 +; upload_port = COM3 ; Windows +; upload_port = /dev/ttyUSB0 ; Linux