ESP32 / Arduino Relay Server

WINDOWS
1. Install Python 3.10+ from https://www.python.org/downloads/ . Enable Add Python to PATH.
2. Extract the complete ZIP into a folder. Do not run inside the ZIP.
3. Connect the board by USB. Close Arduino Serial Monitor and any program using its port.
4. Double-click start-server.bat. First launch downloads dependencies into a local .venv.
5. Choose the serial port for your board. The local dashboard opens automatically.
6. Leave the command window open. Close it or press Ctrl+C to stop.

MANUAL (Windows, macOS, Linux)
python -m venv .venv
Activate it: Windows .venv\Scripts\activate ; macOS/Linux source .venv/bin/activate
python -m pip install -r requirements.txt
python server.py --list-ports
python server.py --serial-port COM10 --open-browser
Use your actual port; macOS example /dev/cu.usbserial-XXXX; Linux /dev/ttyUSB0.
Use python3 instead of python where required.
Optional: --baud 115200 --port 5000

CONNECTION
The dashboard and bridge run at http://127.0.0.1:5000 on the USB-connected computer.
If an old server URL is saved in your browser, enter http://127.0.0.1:5000 and click Connect.
The hosted download page is https://esp32.goldpe.tech/ . It does not host the USB backend.
Use the local dashboard for reliable setup; browsers can restrict hosted-page access to local servers.
This package does not implement remote internet access or a background Windows service.
Default binding is this computer only. No hosting username/password is needed locally.
Advanced trusted-LAN use: --host 0.0.0.0, then open http://COMPUTER-LAN-IP:5000
from another device. This bridge has no login: do not expose it to the internet.

BOARD PROTOCOL
Firmware must accept newline-terminated R1 ON, R1 OFF through R4 ON, R4 OFF
at 115200 baud, and return a newline-terminated response.
This package does not flash firmware. Ensure your firmware uses the expected commands.

TROUBLESHOOTING
No COM port: check USB data cable and the board manufacturer's USB serial driver.
Port busy: close Serial Monitor, other relay servers, or other serial applications.
No reply: check firmware, port and baud rate. USB connection alone does not verify relay operation.
The first serial connection can reset the board; startup waits two seconds.

HOSTED DASHBOARD (https://esp32.goldpe.tech)
Open the website in a browser on the SAME computer that has the USB board.
Keep start-server.bat running and use server URL http://127.0.0.1:5000.
Allow the browser's local network / loopback access permission for this website.
If permission was denied, change it in the browser's site settings and reload.
If hosted access remains blocked, open http://127.0.0.1:5000/ directly.
A phone or another PC using 127.0.0.1 cannot reach the USB computer.

COM10 ACCESS DENIED
This is a Windows serial-port error, not a web hosting error.
Close Arduino IDE entirely, other serial tools, and all old relay server windows.
Unplug/reconnect the board and verify its port in Device Manager > Ports.
Run start-server.bat once, select that port, and click Connect.
If still denied, restart Windows and run only the relay server.
After connecting, verify firmware and baud if commands get no response.
