ESP32 + OpenWrt Kiosk Web Flasher
OpenWrt Wireless Satellite (Tested on Ruijie RG-EW1200G Pro) · Microsecond Coin Interrupts · 100% Free
OpenWrt routers (compatible with any OpenWrt device, tested and verified on the Ruijie RG-EW1200G Pro) are gigabit powerhouses for captive paywall routing, but lack built-in GPIO headers for coin acceptors. The ESP32 + OpenWrt Combo solves this: a low-cost $3 ESP32 acts as an autonomous wireless coin acceptor satellite, capturing microsecond pulses and reporting coin drops over Wi-Fi to your OpenWrt router.
ESP32 + OpenWrt Architecture
Connects wirelessly over Wi-Fi directly to your OpenWrt router (tested and verified with Ruijie RG-EW1200G Pro, or any OpenWrt device) at http://10.0.0.1:4000. Handles coin interrupt pulses, debounces with hardware timer accuracy, and engages the coin inhibit relay when no customer is inserting coins.
Why ESP32 + OpenWrt instead of Raspberry Pi?
A Raspberry Pi already features its own 40-pin GPIO header. In OpenPisoWiFi, the ESP32 is designed specifically to pair with OpenWrt Gigabit Routers (tested and verified on the Ruijie RG-EW1200G Pro, or other OpenWrt-supported models) so you can build a complete commercial vending machine with high-power AC1200 Wi-Fi without buying an expensive Raspberry Pi or SBC!
⚠️Hardware Wiring Schematic (ESP32 to Coinslot)
The CL-168 coin acceptor signal wire emits a 12V pulse. You MUST insert an in-line 10kΩ series resistor between the coin acceptor white wire and ESP32 GPIO 4 to protect the 3.3V chip from overvoltage.
[12V Power Supply] ---> OpenWrt Router (12V Direct - e.g. Ruijie EW1200G Pro) [12V Power Supply] ---> Coinslot (+12V DC) [12V Power Supply] ---> Buck Converter (12V->5V) ----> ESP32 VIN (5V) [Common Ground] ---> Shared GND (PSU, Coinslot, ESP32) [Coinslot WHITE] ---> [ 10kΩ Resistor ] -----------> ESP32 GPIO 4 [Coinslot INHIBIT] <--- Transistor / MOSFET Gate <---- ESP32 GPIO 5
Connect & Flash ESP32
CP2102, CH340, or USB-JTAG) from the browser prompt.Ready to Flash: ESP32 OpenWrt Wireless Satellite
Manifest: /firmware/manifest-esp32-satellite.json
Flashing takes ~35 seconds. Your ESP32 will auto-reboot when finished.
Customize Parameters (NVS Flash)
Configure without re-compiling code · Stored in ESP32 Flash
Must be unique per coin acceptor box so your OpenWrt router tracks separate cash totals.
Label displayed on the customer captive portal and OLED/LCD screen.
Matches the SATELLITE_SECRET configured in your OpenWrt Admin Portal.
💡 Tip: Click "Connect Serial Monitor" below first so the browser can send parameters directly over USB to your ESP32 board.
Live WebSerial Console & Pulse Diagnostics
Read serial logs, inspect Wi-Fi connection, and verify coin pulse accuracy (115200 baud)
Frequently Asked Questions & Troubleshooting
1. The flasher says "Failed to initialize. Try resetting your device"?
Many ESP32 DevKit boards (especially budget CH340 or CP2102 clones) lack an automatic auto-reset capacitor circuit. To enter flashing mode: hold the BOOT (or IO0) button down, click Connect in the browser, wait 2 seconds until the erase prompt appears, then release the button.
2. No serial ports appear in the Chrome popup?
Ensure your USB cable is a data cable, not a charge-only cord from a phone charger. If on Windows, make sure you have installed the standard USB UART driver for your chip: CH340 Driver or Silicon Labs CP210x VCP Driver.
3. Can I use other ESP variants like ESP32-S2, ESP32-S3, or ESP32-C3?
Yes! The OpenWrt Satellite firmware is compatible across ESP32, ESP32-S2, ESP32-S3, and ESP32-C3 microcontrollers. They all possess native hardware interrupt timers to capture microsecond coin pulses and report directly to your OpenWrt router over Wi-Fi.
4. How do I change the Wi-Fi credentials in the Satellite?
After flashing, you can either configure the Wi-Fi via ESP Web Tools Improv Wi-Fi prompt, or compile the sketch in Arduino IDE with your custom SSID and password in firmware/esp32-satellite/esp32-satellite.ino.