Version for PsychicHttp - not working due to websockets problems

This commit is contained in:
2025-12-09 18:44:14 +11:00
parent fc84cfa66a
commit 25ff9b1987
3 changed files with 91 additions and 73 deletions

View File

@@ -9,6 +9,7 @@ A WiFi/Bluetooth serial debugging tool for ESP32. Access serial ports via web br
- **Multi-Port**: Switch between internal debug, USB serial, and external serial
- **Virtual Serial**: Internal loopback for ESP32's own debug output
- **Configurable**: Change baud rates on the fly
- **Robust Server**: Uses PsychicHttp - stable under load (unlike ESPAsyncWebServer)
## Hardware
@@ -53,8 +54,19 @@ pio run -t uploadfs
### 3. Connect
#### Via WiFi (Web Terminal)
#### Via WiFi (Station Mode - Default)
1. Edit `src/main.cpp` and set your WiFi credentials:
```cpp
const char* STA_SSID = "YourNetworkSSID";
const char* STA_PASSWORD = "YourPassword";
```
2. Upload and check serial monitor for the assigned IP address
3. Open browser: `http://<ip-address>`
#### Via WiFi (AP Mode Fallback)
If station mode fails, or you set `WIFI_STATION_MODE false`:
1. Connect to WiFi network: `ESP32-DebugDongle`
2. Password: `debug1234`
3. Open browser: `http://192.168.4.1`
@@ -106,10 +118,20 @@ These messages appear when "Internal" port is selected.
Edit `src/main.cpp` to change defaults:
```cpp
// WiFi Access Point
// WiFi Mode: true = connect to existing network, false = create AP
#define WIFI_STATION_MODE true
// Your WiFi network credentials (station mode)
const char* STA_SSID = "YourNetworkSSID";
const char* STA_PASSWORD = "YourPassword";
// Fallback Access Point settings
const char* AP_SSID = "ESP32-DebugDongle";
const char* AP_PASSWORD = "debug1234";
// Connection timeout before falling back to AP mode
#define WIFI_CONNECT_TIMEOUT 15000
// Bluetooth name
const char* BT_NAME = "ESP32-Debug";
@@ -122,6 +144,18 @@ const char* BT_NAME = "ESP32-Debug";
#define DEFAULT_BAUD_SERIAL1 115200
```
### WiFi Modes
**Station Mode** (`WIFI_STATION_MODE true`):
- Connects to your existing WiFi network
- Access the dongle from any device on the same network
- Falls back to AP mode if connection fails
**Access Point Mode** (`WIFI_STATION_MODE false`):
- Creates its own WiFi network
- Connect directly to the ESP32's network
- IP address: 192.168.4.1
## Project Structure
```
@@ -237,5 +271,5 @@ MIT License - Feel free to use and modify.
## Credits
- [xterm.js](https://xtermjs.org/) - Terminal emulator
- [ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer) - Async web server
- [PsychicHttp](https://github.com/hoeken/PsychicHttp) - Robust HTTP/WebSocket server for ESP32
- [ArduinoJson](https://arduinojson.org/) - JSON library by Benoît Blanchon