Public
Like
ESP32-FirmwareFlasher
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A production-ready web application for flashing firmware to ESP32/ESP8266 devices using the Web Serial API. Built for Val Town with TypeScript, React, and Hono.
- Web Serial API Integration: Flash firmware directly from the browser
- Multiple Device Support: ESP32, ESP8266, and CYD (Cheap Yellow Display) variants
- Pre-built Payloads: Bruce, ESP32 Marauder, Ghost ESP, Netagotchi
- ELF to BIN Conversion: Upload ELF files and convert them to flashable binaries
- Device Information: Read MAC address, chip features, and flash info
- Secure: Input validation, rate limiting, and CORS protection
├── backend/
│ ├── index.ts # Main Hono server
│ ├── routes/
│ │ ├── firmware.ts # Firmware management endpoints
│ │ ├── serial.ts # Serial/flashing endpoints
│ │ └── static.ts # Static file serving
│ ├── services/
│ │ ├── firmwareStore.ts # Firmware storage and management
│ │ └── elfConverter.ts # ELF to BIN conversion
│ └── utils/
│ └── validation.ts # Input validation and security
├── frontend/
│ ├── index.html # Main HTML template
│ ├── index.tsx # React app entry point
│ ├── components/
│ │ ├── App.tsx # Main app component
│ │ ├── ConnectPort.tsx # Serial port connection
│ │ ├── FlashControls.tsx # Flashing interface
│ │ └── FirmwareList.tsx # Available firmware list
│ └── services/
│ ├── serialService.ts # Web Serial API wrapper
│ └── api.ts # Backend API client
├── shared/
│ └── types.ts # Shared TypeScript types
└── firmwares/ # Pre-built firmware binaries
├── bruce/
├── marauder/
├── ghost-esp/
└── netagotchi/
- The main entry point is
backend/index.ts
(HTTP trigger) - Frontend is served from
/
and API endpoints are under/api/
- Firmware files are stored in the
firmwares/
directory - Web Serial API requires HTTPS in production
GET /api/firmwares
- List available firmwareGET /api/firmwares/:name
- Download firmware binaryPOST /api/convert
- Convert ELF to BINGET /api/device-info
- Get supported device information
- Chrome/Edge 89+
- Opera 75+
- Web Serial API required (HTTPS only in production)
- Input validation on all uploads
- Rate limiting on conversion endpoints
- CORS protection
- File size limits
- Malicious content scanning
The app automatically serves the frontend and handles API requests. All firmware binaries are pre-loaded and ready for flashing.