• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
canstralian

canstralian

ESP32-FirmwareFlasher

A production-ready web application for flashing firmware to ESP3
Public
Like
ESP32-FirmwareFlasher
Home
Code
6
backend
4
frontend
4
shared
1
README.md
main.tsx
new-file-4841.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
7/4/2025
README.md

ESP32/ESP8266 Firmware Flasher

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.

Features

  • 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

Project Structure

├── 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/

Getting Started

  1. The main entry point is backend/index.ts (HTTP trigger)
  2. Frontend is served from / and API endpoints are under /api/
  3. Firmware files are stored in the firmwares/ directory
  4. Web Serial API requires HTTPS in production

API Endpoints

  • GET /api/firmwares - List available firmware
  • GET /api/firmwares/:name - Download firmware binary
  • POST /api/convert - Convert ELF to BIN
  • GET /api/device-info - Get supported device information

Browser Compatibility

  • Chrome/Edge 89+
  • Opera 75+
  • Web Serial API required (HTTPS only in production)

Security Features

  • Input validation on all uploads
  • Rate limiting on conversion endpoints
  • CORS protection
  • File size limits
  • Malicious content scanning

Development

The app automatically serves the frontend and handles API requests. All firmware binaries are pre-loaded and ready for flashing.

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.