Skip to content

Commit 5a6b7ce

Browse files
authored
Merge pull request #28 from vs4vijay/copilot/add-iot-playground-web-flasher
Add browser-based ESP32 web flasher with GitHub Pages hosting
2 parents 58a5026 + 1a1ab91 commit 5a6b7ce

22 files changed

Lines changed: 1264 additions & 4 deletions

.github/workflows/deploy_pages.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Deploy GitHub Pages
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Pages
30+
uses: actions/configure-pages@v5
31+
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: './docs'
36+
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,40 @@
22

33
A firmware playground for IoT Devices like ESP32, Arduino, M5Stack, etc.
44

5+
## 🔌 Web Flasher - Flash from Browser
56

6-
- Update subomdules using `scripts/update-submodules.sh` script
7+
**No installation required!** Flash pre-compiled firmware directly from your browser using our web flasher:
8+
9+
🌐 **[https://vs4vijay.github.io/iot-playground/](https://vs4vijay.github.io/iot-playground/)**
10+
11+
### Available Projects
12+
13+
#### M5Stack Cardputer (ESP32-S3)
14+
- **[UserDemo](https://vs4vijay.github.io/iot-playground/flash-userdemo-cardputer.html)** - Official M5Stack Cardputer user demo
15+
- **[M5CardRemote](https://vs4vijay.github.io/iot-playground/flash-m5cardremote.html)** - IR remote control application
16+
- **[GameBoy Emulator](https://vs4vijay.github.io/iot-playground/flash-gameboy.html)** - GameBoy emulator with ROM support
17+
- **[Resistor Calculator](https://vs4vijay.github.io/iot-playground/flash-resistor.html)** - Resistor color code calculator
18+
- **[M5Stick Launcher](https://vs4vijay.github.io/iot-playground/flash-m5launcher.html)** - Application launcher system
19+
- **[Evil Cardputer](https://vs4vijay.github.io/iot-playground/flash-evil-cardputer.html)** - WiFi security testing tool
20+
21+
#### M5StickC Plus2 (ESP32-S3)
22+
- **[UserDemo](https://vs4vijay.github.io/iot-playground/flash-userdemo-stickc.html)** - Official M5StickC Plus2 user demo
23+
- **[OneButton](https://vs4vijay.github.io/iot-playground/flash-onebutton.html)** - OneButton library example
24+
- **[Evil Clock](https://vs4vijay.github.io/iot-playground/flash-evilclock.html)** - WiFi deauth clock
25+
26+
### Requirements
27+
- Chrome or Edge browser (Web Serial API required)
28+
- USB cable to connect your device
29+
- USB/Serial drivers installed (CP210x, CH340, etc.)
30+
31+
### Direct Binary Downloads
32+
Latest compiled binaries are available in the [Releases](https://github.com/vs4vijay/iot-playground/releases/latest) section.
733

34+
---
35+
36+
## 📦 Development Setup
837

38+
- Update subomdules using `scripts/update-submodules.sh` script
939

1040
---
1141

@@ -145,12 +175,26 @@ cargo build --release
145175

146176
---
147177

148-
## Flash firmware
178+
## Flash Firmware
179+
180+
### Option 1: Web Flasher (Recommended - No Installation)
149181

150-
- Install esptool.py - `pip install -U esptool`
182+
Use our browser-based web flasher for the easiest flashing experience:
183+
- **Web Flasher:** [https://vs4vijay.github.io/iot-playground/](https://vs4vijay.github.io/iot-playground/)
184+
- No software installation required
185+
- Works on Chrome/Edge browsers
186+
- One-click flashing for all pre-compiled projects
187+
188+
### Option 2: Command Line (esptool.py)
189+
190+
For manual flashing or custom builds:
151191

152192
```bash
153-
esptool write_flash -z 0 name.bin
193+
# Install esptool.py
194+
pip install -U esptool
195+
196+
# Flash firmware
197+
esptool.py write_flash 0x0 firmware.bin
154198
```
155199

156200
## QEMU Emulation

docs/SETUP.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# GitHub Pages Setup Guide
2+
3+
This document explains how to enable GitHub Pages for the IoT Playground Web Flasher.
4+
5+
## Enable GitHub Pages
6+
7+
To enable GitHub Pages for this repository:
8+
9+
1. Go to your repository on GitHub
10+
2. Click on **Settings**
11+
3. In the left sidebar, click on **Pages**
12+
4. Under **Build and deployment**:
13+
- **Source**: Select "GitHub Actions"
14+
- The workflow in `.github/workflows/deploy_pages.yml` will handle deployment
15+
16+
## Accessing the Web Flasher
17+
18+
Once GitHub Pages is enabled and the workflow runs successfully, the web flasher will be available at:
19+
20+
```
21+
https://vs4vijay.github.io/iot-playground/
22+
```
23+
24+
## How It Works
25+
26+
- The `docs/` directory contains all the web flasher files
27+
- The GitHub Actions workflow automatically deploys the `docs/` directory to GitHub Pages when changes are pushed to the `main` branch
28+
- ESP Web Tools is loaded from the unpkg CDN
29+
- Manifest files point to firmware binaries hosted in GitHub Releases
30+
31+
## Firmware Versions
32+
33+
Each project's manifest file points to the latest available compiled binary from GitHub Releases. Note that some projects may reference different release tags if their binaries were updated independently. This is normal and ensures users always get the most recent stable version for each project.
34+
35+
## Manual Deployment
36+
37+
The workflow can also be triggered manually:
38+
1. Go to **Actions** tab
39+
2. Select **Deploy GitHub Pages** workflow
40+
3. Click **Run workflow**
41+
42+
## Testing Locally
43+
44+
To test the web flasher locally:
45+
46+
```bash
47+
# Using Python's built-in HTTP server
48+
cd docs
49+
python -m http.server 8000
50+
51+
# Or using Node.js http-server
52+
npm install -g http-server
53+
cd docs
54+
http-server
55+
```
56+
57+
Then open `http://localhost:8000` in Chrome or Edge browser.
58+
59+
## Troubleshooting
60+
61+
- **Browser Compatibility**: The Web Serial API only works in Chrome and Edge browsers
62+
- **HTTPS Required**: GitHub Pages automatically provides HTTPS, which is required for Web Serial API
63+
- **USB Drivers**: Ensure proper USB/serial drivers (CP210x, CH340) are installed on the user's system
64+
- **Firmware URLs**: Verify that the firmware URLs in manifest files point to valid GitHub Release assets
65+
66+
## Updating Firmware Versions
67+
68+
When new firmware is released:
69+
1. Update the corresponding manifest file in `docs/firmware/` with the new release tag and binary URL
70+
2. Update the HTML page with the new version number (if desired)
71+
3. Commit and push changes - the workflow will automatically deploy
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Evil Cardputer",
3+
"version": "7ce0bc0",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/7ce0bc0/Evil-Cardputer-7ce0bc0.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Evil Clock",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/EvilClock-6f63e83.M5StickCPlus2.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "GameBoy Emulator",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/GameBoy-6f63e83.M5Cardputer.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "M5CardRemote",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/M5CardRemote-6f63e83.M5Cardputer.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "M5Stick Launcher",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/M5Stick-Launcher-6f63e83.M5Cardputer.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "OneButton",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/OneButton-6f63e83.M5StickCPlus2.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Resistor Calculator",
3+
"version": "6f63e83",
4+
"home_assistant_domain": "esphome",
5+
"new_install_prompt_erase": true,
6+
"builds": [
7+
{
8+
"chipFamily": "ESP32-S3",
9+
"parts": [
10+
{
11+
"path": "https://github.com/vs4vijay/iot-playground/releases/download/6f63e83/Resistor-6f63e83.M5Cardputer.bin",
12+
"offset": 0
13+
}
14+
]
15+
}
16+
]
17+
}

0 commit comments

Comments
 (0)