Send commands from your PC to control an Arduino R4 Minima over WiFi. Change LED blink speeds, turn LED on/off, and more - all remotely!
cd server
python3 firmware_server.py~/.platformio/penv/bin/pio run -e uno_r4_minima -t upload~/.platformio/penv/bin/pio run -e esp8266_programmer -t uploadOpen browser to: http://localhost:5000
Try these commands:
- Very Fast - LED blinks at 100ms
- Normal - LED blinks at 500ms
- Very Slow - LED blinks at 2 seconds
- Custom Speed - Enter any duration (50-5000ms)
- LED ON/OFF - Direct control
- Stop Blinking - Stops current blink pattern
ESP8266 (NodeMCU) → Arduino R4 Minima
─────────────────────────────────────
TX (GPIO1) → RX (Pin 0)
RX (GPIO3) → TX (Pin 1)
GND → GND
PC Browser → Python Server → ESP8266 (WiFi) → Arduino (Serial)
↑ ↓
└──────── Response logs ─────────────┘
- Click button in web interface
- Command queued on server
- ESP8266 polls server every 3 seconds
- ESP8266 forwards command to Arduino via serial
- Arduino executes command (changes blink speed)
- Arduino sends confirmation back
- Web interface shows live logs
- type: "blink"
- duration: 50-5000 (milliseconds)
Example: {"type":"blink","duration":250}
{"type":"led_on"}- Turn LED on{"type":"led_off"}- Turn LED off{"type":"stop"}- Stop blinking
{"type":"ping"}- Check Arduino is alive{"type":"status"}- Get current state
Edit src/esp8266_programmer.cpp:
const char* ssid = "muditatrey1234";
const char* password = "muditmudit";Already set to: 10.147.66.33
If your PC IP changes, update line 13:
const char* serverHost = "YOUR_NEW_IP";Watch ESP8266 serial output:
~/.platformio/penv/bin/pio device monitor -e esp8266_programmerYou'll see:
📨 Command from server: {"type":"blink","duration":250}
📤 Forwarding to Arduino...
📥 Arduino response: {"status":"blink_started","duration":250}
✅ Command acknowledged
else if (cmd.indexOf("\"type\":\"mycommand\"") > 0) {
// Your code here
Serial.println("{\"status\":\"done\"}");
}In HTML_TEMPLATE, add a button:
<button onclick="sendCommand({type:'mycommand'})" class="button">
My Command
</button>~/.platformio/penv/bin/pio run -e uno_r4_minima -t uploadNo need to rebuild ESP8266 or restart server!
| Component | Status |
|---|---|
| PC Server | ✅ Ready |
| ESP8266 Bridge | ✅ Ready |
| Arduino R4 | ✅ Ready |
| Web Interface | ✅ Ready |
✅ Real-time command execution
✅ Web-based control interface
✅ Live logging and status
✅ Command queuing
✅ Auto-retry on network issues
✅ No firmware flashing needed
✅ Easy to add new commands
✅ Works with Arduino R4 Minima (ARM)
GmBH/
├── server/
│ ├── firmware_server.py ← Python Flask server
│ └── requirements.txt ← Dependencies
├── src/
│ ├── esp8266_programmer.cpp ← WiFi bridge client
│ └── arduino_target.cpp ← Command executor
└── platformio.ini ← Build configuration
| Firmware Flashing | Command System |
|---|---|
| ❌ Doesn't work (ARM bootloader) | ✅ Works perfectly |
| ❌ Requires restart | ✅ Instant execution |
| ❌ Fixed behavior | ✅ Dynamic control |
| ❌ 30+ second process | ✅ 3 second response |
| ❌ Complex protocol needed | ✅ Simple JSON over serial |
You're all set! 🚀
Open http://localhost:5000 and start controlling your Arduino remotely!