diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..6ce9cd3 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,39 @@ +name: Deploy Pages + +on: + workflow_run: + workflows: ["Release Firmware"] + types: [completed] + +jobs: + deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + contents: read + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@v4 + + - name: Download all release binaries + env: + GH_TOKEN: ${{ github.token }} + run: | + mkdir -p webpage/firmware + gh release list --limit 100 --json tagName --jq '.[].tagName' | while read tag; do + mkdir -p "webpage/firmware/$tag" + gh release download "$tag" --dir "webpage/firmware/$tag" --pattern "*.bin" 2>/dev/null || true + done + + - uses: actions/configure-pages@v5 + + - uses: actions/upload-pages-artifact@v3 + with: + path: webpage/ + + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bfe224..08bace4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,16 +37,22 @@ jobs: --build-arg BOARD_SPECIFIC_INIT=${{ matrix.board_specific_init }} \ -t esp-scope-${{ matrix.name }} . - - name: Extract binary (${{ matrix.name }}) + - name: Extract binaries (${{ matrix.name }}) run: | docker run --rm esp-scope-${{ matrix.name }} \ - cat /workspace/build/esp-scope.bin > esp-scope-${{ matrix.name }}.bin + cat /workspace/build/merged-firmware.bin > esp-scope-${{ matrix.name }}-merged.bin + docker run --rm esp-scope-${{ matrix.name }} \ + cat /workspace/build/bootloader/bootloader.bin > esp-scope-${{ matrix.name }}-bootloader.bin + docker run --rm esp-scope-${{ matrix.name }} \ + cat /workspace/build/partition_table/partition-table.bin > esp-scope-${{ matrix.name }}-partition-table.bin + docker run --rm esp-scope-${{ matrix.name }} \ + cat /workspace/build/esp-scope.bin > esp-scope-${{ matrix.name }}-app.bin - name: Upload artifact uses: actions/upload-artifact@v4 with: name: esp-scope-${{ matrix.name }} - path: esp-scope-${{ matrix.name }}.bin + path: esp-scope-${{ matrix.name }}-*.bin release: needs: build @@ -77,28 +83,54 @@ jobs: body: | ## Firmware binaries - | File | Board | Target | LED GPIO | AP-Mode button GPIO | - |------|-------|--------|----------|---------------------| - | `esp-scope-esp32.bin` | Generic ESP32 | esp32 | 2 | 9 | - | `esp-scope-xiao-esp32c6.bin` | Seeed XIAO ESP32C6 | esp32c6 | 8 (built-in yellow LED) | 0 (Boot button) | + Each board ships four files: - ## Flashing + | Suffix | Contents | Use for | + |--------|----------|---------| + | `-merged.bin` | Bootloader + partition table + app in one file | Web installer, quick CLI flash | + | `-bootloader.bin` | Bootloader only | Individual flashing | + | `-partition-table.bin` | Partition table only | Individual flashing | + | `-app.bin` | Application only | OTA / app-only update | - ### Browser (easiest) - - Download the `.bin` for your board above, then flash it in your browser β€” no drivers or tools needed: - - πŸ‘‰ **[https://www.espboards.dev/tools/program/](https://www.espboards.dev/tools/program/)** - - Works with Chrome, Edge, or Opera. Connect your ESP via USB, click **Connect to ESP**, select the `.bin` file, and flash. - - ### Command line + ### Generic ESP32 β€” LED GPIO 2 Β· AP-mode button GPIO 9 ```bash - esptool.py -p write_flash 0x0 esp-scope-.bin + # Flash merged binary (simplest) + esptool.py -p -b 460800 write_flash 0x0 esp-scope-esp32-merged.bin + + # Or flash components individually + esptool.py -p -b 460800 write_flash \ + 0x1000 esp-scope-esp32-bootloader.bin \ + 0x8000 esp-scope-esp32-partition-table.bin \ + 0x10000 esp-scope-esp32-app.bin + ``` + + ### Seeed XIAO ESP32C6 β€” LED GPIO 8 (built-in yellow) Β· AP-mode button GPIO 0 (Boot) + + ```bash + # Flash merged binary (simplest) + esptool.py -p -b 460800 write_flash 0x0 esp-scope-xiao-esp32c6-merged.bin + + # Or flash components individually + esptool.py -p -b 460800 write_flash \ + 0x0 esp-scope-xiao-esp32c6-bootloader.bin \ + 0x8000 esp-scope-xiao-esp32c6-partition-table.bin \ + 0x10000 esp-scope-xiao-esp32c6-app.bin ``` Replace `` with your serial port (e.g. `/dev/ttyUSB0` or `COM3`). + + ## Web installer + + Flash directly from your browser (Chrome/Edge/Opera) β€” no tools needed: + + πŸ‘‰ **[https://vtalpaert.github.io/esp-scope/](https://vtalpaert.github.io/esp-scope/)** files: | - esp-scope-esp32/esp-scope-esp32.bin - esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6.bin + esp-scope-esp32/esp-scope-esp32-merged.bin + esp-scope-esp32/esp-scope-esp32-bootloader.bin + esp-scope-esp32/esp-scope-esp32-partition-table.bin + esp-scope-esp32/esp-scope-esp32-app.bin + esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6-merged.bin + esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6-bootloader.bin + esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6-partition-table.bin + esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6-app.bin diff --git a/Dockerfile b/Dockerfile index 80ea53b..fb6c8eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,4 +13,19 @@ WORKDIR /workspace RUN sed -i "s/^CONFIG_LED_BUILTIN=.*/CONFIG_LED_BUILTIN=${LED_BUILTIN}/" sdkconfig.defaults && \ sed -i "s/^CONFIG_BSP_CONFIG_GPIO=.*/CONFIG_BSP_CONFIG_GPIO=${BSP_CONFIG_GPIO}/" sdkconfig.defaults && \ sed -i "s|^CONFIG_BOARD_SPECIFIC_INIT=.*|CONFIG_BOARD_SPECIFIC_INIT=\"${BOARD_SPECIFIC_INIT}\"|" sdkconfig.defaults -RUN source /opt/esp/idf/export.sh > /dev/null 2>&1 && idf.py set-target ${TARGET} && idf.py build +RUN source /opt/esp/idf/export.sh > /dev/null 2>&1 && \ + idf.py set-target ${TARGET} && idf.py build && \ + if [ "${TARGET}" = "esp32c6" ]; then \ + esptool.py --chip ${TARGET} merge_bin \ + -o build/merged-firmware.bin \ + 0x0 build/bootloader/bootloader.bin \ + 0x8000 build/partition_table/partition-table.bin \ + 0x10000 build/esp-scope.bin; \ + else \ + esptool.py --chip ${TARGET} merge_bin \ + -o build/merged-firmware.bin \ + --flash_mode dio --flash_freq 80m --flash_size 2MB \ + 0x1000 build/bootloader/bootloader.bin \ + 0x8000 build/partition_table/partition-table.bin \ + 0x10000 build/esp-scope.bin; \ + fi diff --git a/README.md b/README.md index 32943a1..00e70f3 100644 --- a/README.md +++ b/README.md @@ -20,17 +20,15 @@ This project was written in part to test AI code generators and see if they're a ### Quickstart β€” Flash without installing anything -Pre-built firmware binaries are available on the [Releases page](https://github.com/vtalpaert/esp-scope/releases/). +Pre-built firmware binaries are available on the [Releases page](https://github.com/vtalpaert/esp-scope/releases/): +- `esp-scope-esp32-merged.bin` β€” generic ESP32 +- `esp-scope-xiao-esp32c6-merged.bin` β€” Seeed XIAO ESP32C6 -1. Download the `.bin` file for your board: - - `esp-scope-esp32.bin` β€” generic ESP32 - - `esp-scope-xiao-esp32c6.bin` β€” Seeed XIAO ESP32C6 +Connect your ESP32 via USB and flash directly from your browser β€” no drivers or toolchain needed: -2. Connect your ESP32 via USB, then flash directly in your browser (Chrome, Edge, or Opera): +πŸ‘‰ **[https://vtalpaert.github.io/esp-scope/](https://vtalpaert.github.io/esp-scope/)** - πŸ‘‰ **[https://www.espboards.dev/tools/program/](https://www.espboards.dev/tools/program/)** - -No drivers, no toolchain required. +Works with Chrome, Edge, or Opera. Select your firmware version, click **Install**, and the correct binary is picked automatically for your chip. --- @@ -94,16 +92,15 @@ If you don't have ESP-IDF installed locally, you can build the firmware using th -t esp-scope-firmware . ``` -2. Copy the firmware binary out of the image: +2. Copy the merged firmware binary out of the image: ```bash - docker run --rm esp-scope-firmware cat /workspace/build/esp-scope.bin > esp-scope.bin + docker run --rm esp-scope-firmware cat /workspace/build/merged-firmware.bin > esp-scope-esp32-merged.bin ``` 3. Flash from within Docker (Linux only, requires access to the host USB device): ```bash docker run --rm --device=/dev/ttyUSB0 esp-scope-firmware \ - bash -c "source /opt/esp/idf/export.sh > /dev/null 2>&1 && \ - idf.py -p /dev/ttyUSB0 flash" + bash -c "esptool.py -p /dev/ttyUSB0 -b 460800 write_flash 0x0 build/merged-firmware.bin" ``` Replace `/dev/ttyUSB0` with your serial port. On macOS/Windows, flashing from inside Docker is not supported due to USB passthrough limitations β€” copy the binary out and flash with `esptool.py` directly. diff --git a/webpage/index.html b/webpage/index.html new file mode 100644 index 0000000..bfaacf6 --- /dev/null +++ b/webpage/index.html @@ -0,0 +1,431 @@ + + + + + + ESP-Scope Firmware Installer + + + + + +
+

ESP-Scope Installer

+

Flash the firmware directly from your browser β€” no tools needed.

+ + +
Loading releases…
+ + + + +

+ Your board not listed? Open an issue +

+ +
+ +
+ +
+ Your browser does not support WebSerial. Please use Chrome, Edge, or Opera on desktop. +
+ +
+ +
+
    +
  1. Connect your ESP32 via USB.
  2. +
  3. Select a firmware version above.
  4. +
  5. Click Install β€” the correct firmware is picked automatically for your chip.
  6. +
  7. Wait for flashing to complete, then reset the board.
  8. +
+

Requires Chrome, Edge, or Opera on desktop.

+
+
+ + + + + + +