Skip to content

Commit caee875

Browse files
feat: Add Adafruit Feather ESP32-S3 Reverse TFT board support
- Add new board environments: adafruit_feather_esp32s3_reversetft, adafruit_feather_esp32s3_reversetft_rtos, and test_feather_reversetft - Update README.md to reflect tri-board support with build instructions - Add new board option in hardware requirements section - Update documentation badges and references to include reverse TFT Technical improvements: - Fix latency test session restart issues in RTOS mode - Improve WiFi mode switching with RTOS-aware delays - Enhanced serial communication robustness in command processing - Add debugging commands for RTOS task monitoring Build verification: - All new environments compile successfully - RAM usage: 16.1-16.2%, Flash usage: 72.1-75.0% - Full NeoPixel and web server support maintained
1 parent 9c02cca commit caee875

File tree

7 files changed

+313
-9
lines changed

7 files changed

+313
-9
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
![Framework](https://img.shields.io/badge/framework-Arduino-green.svg)
77
![PlatformIO](https://img.shields.io/badge/build-PlatformIO-orange.svg)
88
![License](https://img.shields.io/badge/license-MIT-blue.svg)
9-
![Boards](https://img.shields.io/badge/boards-ESP32dev%20|%20Feather%20ESP32--S3-brightgreen.svg)
9+
![Boards](https://img.shields.io/badge/boards-ESP32dev%20|%20Feather%20ESP32--S3%20|%20Reverse%20TFT-brightgreen.svg)
1010
[![Changelog](https://img.shields.io/badge/changelog-available-brightgreen.svg)](CHANGELOG.md)
1111

1212
A professional-grade ESP32 WiFi analysis and management suite featuring comprehensive network scanning, spectrum analysis,
13-
performance testing, and dual-board support with advanced channel congestion analysis.
13+
performance testing, and tri-board support with advanced channel congestion analysis.
1414

1515
## 🎉 What's New in v4.1.0
1616

@@ -56,7 +56,7 @@ Professional LED control with smooth animations and multiple states:
5656
- **10 LED States**: Idle, Scanning, Connecting, Connected, Disconnected, AP Mode, Error, Analysis, Custom, Off
5757
- **5 Animation Patterns**: Solid, Pulse (sine wave), Blink, Fade, Flash
5858
- **Priority-Based State Changes**: Errors override normal states, smooth transitions
59-
- **Dual Hardware Support**: Standard LED (ESP32dev) and NeoPixel RGB (Feather ESP32-S3)
59+
- **Multi-Hardware Support**: Standard LED (ESP32dev) and NeoPixel RGB (Feather ESP32-S3 TFT/Reverse TFT)
6060
- **Queue-Based Updates**: Non-blocking state changes from any task
6161
- **Customizable Colors**: Full RGB control for NeoPixel boards
6262

@@ -447,7 +447,7 @@ with AI-powered analysis
447447

448448
- **🎯 Professional Spectrum Analysis**: AI-powered channel recommendations with 0-100% congestion scoring
449449
- **� Advanced Performance Testing**: Comprehensive latency analysis with jitter calculations and statistical reporting
450-
- **🔧 Dual-Board Support**: ESP32dev and Adafruit Feather ESP32-S3 TFT with hardware-specific optimizations
450+
- **🔧 Tri-Board Support**: ESP32dev, Adafruit Feather ESP32-S3 TFT, and Reverse TFT with hardware-specific optimizations
451451
- **🧪 Enterprise Testing**: Unity framework with comprehensive test coverage for both platforms
452452
- **📱 Visual Feedback**: Smart LED/NeoPixel status indication with real-time analysis progress
453453

@@ -497,7 +497,7 @@ main.cpp
497497
└── command_interface (user interaction & iPerf integration)
498498
```
499499

500-
## 🛠️ Hardware Requirements & Dual-Board Support
500+
## 🛠️ Hardware Requirements & Tri-Board Support
501501

502502
### Supported Boards
503503

@@ -516,6 +516,14 @@ main.cpp
516516
- **Features**: Enhanced visual feedback with RGB color coding for analysis status
517517
- **Memory**: 8MB PSRAM, enhanced performance for complex analysis
518518

519+
#### Option 3: Adafruit Feather ESP32-S3 Reverse TFT (Enhanced) 🆕
520+
521+
- **Board**: Adafruit Feather ESP32-S3 Reverse TFT with 4MB Flash
522+
- **LED**: NeoPixel RGB LED on GPIO 48 (enhanced color status indication)
523+
- **Display**: 1.14" Color TFT Display (240x135) with reverse orientation - _Future enhancement planned_
524+
- **Features**: Enhanced visual feedback with RGB color coding for analysis status, optimized for reverse TFT layout
525+
- **Memory**: 8MB PSRAM, enhanced performance for complex analysis
526+
519527
### Universal Requirements
520528

521529
- **USB Cable** for programming and serial communication
@@ -528,6 +536,8 @@ main.cpp
528536

529537
- **ESP32dev**: `esp32-wifi-utility-esp32dev-v{version}.bin` - Standard ESP32 development board
530538
- **Feather ESP32-S3 TFT**: `esp32-wifi-utility-feather-s3-tft-v{version}.bin` - Enhanced with NeoPixel support
539+
- **Feather ESP32-S3 Reverse TFT**: `esp32-wifi-utility-feather-s3-reversetft-v{version}.bin` - Enhanced with NeoPixel
540+
support and reverse TFT layout
531541

532542
### Flash Pre-Built Firmware
533543

@@ -540,7 +550,7 @@ esptool.py --port /dev/ttyUSB0 write_flash 0x10000 firmware.bin
540550

541551
### 🤖 Automated Releases
542552

543-
Every version bump in `platformio.ini` automatically triggers a new release with fresh firmware builds for both boards.
553+
Every version bump in `platformio.ini` automatically triggers a new release with fresh firmware builds for all boards.
544554
See our [Automated Release Documentation](docs/technical/AUTOMATED_RELEASES.md) for details.
545555

546556
## ⚡ Quick Start
@@ -563,7 +573,7 @@ See our [Automated Release Documentation](docs/technical/AUTOMATED_RELEASES.md)
563573
2. Clone or download this project
564574
3. Open the project in your IDE
565575

566-
### 3. Build and Upload (Dual-Board Support)
576+
### 3. Build and Upload (Tri-Board Support)
567577

568578
#### Building for ESP32 Development Board:
569579

@@ -591,10 +601,23 @@ pio run -e adafruit_feather_esp32s3_tft
591601
pio device monitor
592602
```
593603

604+
#### For Adafruit Feather ESP32-S3 Reverse TFT:
605+
606+
```bash
607+
# Using PlatformIO with NeoPixel support
608+
pio run -e adafruit_feather_esp32s3_reversetft -t upload
609+
610+
# Build only to check compilation
611+
pio run -e adafruit_feather_esp32s3_reversetft
612+
613+
# Monitor serial output
614+
pio device monitor
615+
```
616+
594617
#### Build All Configurations:
595618

596619
```bash
597-
# Build both board configurations
620+
# Build all board configurations
598621
pio run
599622

600623
# Run comprehensive test suite

platformio.ini

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111

1212
[common]
1313
monitor_speed = 115200
14+
monitor_filters =
15+
default
16+
time
17+
monitor_eol = CRLF
18+
monitor_echo = yes
1419

1520
[env:esp32dev]
1621
platform = espressif32
@@ -19,6 +24,9 @@ framework = arduino
1924
monitor_speed = 115200
2025
upload_port = /dev/ttyUSB*
2126
monitor_port = /dev/ttyUSB*
27+
monitor_filters =
28+
default
29+
time
2230
build_flags =
2331
-DUSE_WEBSERVER=1
2432
-DVERSION="4.1.0"
@@ -40,6 +48,36 @@ framework = arduino
4048
monitor_speed = 115200
4149
upload_port = /dev/ttyACM*
4250
monitor_port = /dev/ttyACM*
51+
monitor_filters =
52+
default
53+
time
54+
build_flags =
55+
-DARDUINO_USB_MODE=1
56+
-DUSE_WEBSERVER=1
57+
-DVERSION="4.1.0"
58+
-DUSE_NEOPIXEL=1
59+
-Os ; Optimize for size
60+
-ffunction-sections ; Place each function in its own section
61+
-fdata-sections ; Place each data in its own section
62+
-Wl,--gc-sections ; Remove unused sections at link time
63+
-DCORE_DEBUG_LEVEL=0 ; Disable debug output
64+
build_unflags =
65+
-O2 ; Remove default O2 optimization
66+
lib_deps =
67+
ricmoo/QRCode@^0.0.1
68+
adafruit/Adafruit NeoPixel@^1.12.0
69+
; AsyncUDP is built into ESP32 framework, no external dependency needed
70+
71+
[env:adafruit_feather_esp32s3_reversetft]
72+
platform = espressif32
73+
board = adafruit_feather_esp32s3_reversetft
74+
framework = arduino
75+
monitor_speed = 115200
76+
upload_port = /dev/ttyACM*
77+
monitor_port = /dev/ttyACM*
78+
monitor_filters =
79+
default
80+
time
4381
build_flags =
4482
-DARDUINO_USB_MODE=1
4583
-DUSE_WEBSERVER=1
@@ -74,6 +112,9 @@ build_flags =
74112
monitor_speed = 115200
75113
upload_port = /dev/ttyUSB*
76114
monitor_port = /dev/ttyUSB*
115+
monitor_filters =
116+
default
117+
time
77118
test_ignore =
78119
test_desktop_*
79120

@@ -97,6 +138,36 @@ build_flags =
97138
monitor_speed = 115200
98139
upload_port = /dev/ttyACM*
99140
monitor_port = /dev/ttyACM*
141+
monitor_filters =
142+
default
143+
time
144+
145+
test_ignore =
146+
test_desktop_*
147+
148+
[env:test_feather_reversetft]
149+
platform = espressif32
150+
board = adafruit_feather_esp32s3_reversetft
151+
framework = arduino
152+
test_framework = unity
153+
test_build_src = false
154+
lib_deps =
155+
ricmoo/QRCode@^0.0.1
156+
adafruit/Adafruit NeoPixel@^1.12.0
157+
; AsyncUDP is built into ESP32 framework, no external dependency needed
158+
build_flags =
159+
-DARDUINO_USB_MODE=1
160+
-DUSE_WEBSERVER=1
161+
-DUNITY_INCLUDE_CONFIG_H
162+
-DUNIT_TEST
163+
-DUSE_NEOPIXEL=1
164+
-DVERSION="4.1.0"
165+
monitor_speed = 115200
166+
upload_port = /dev/ttyACM*
167+
monitor_port = /dev/ttyACM*
168+
monitor_filters =
169+
default
170+
time
100171

101172
test_ignore =
102173
test_desktop_*
@@ -112,6 +183,9 @@ framework = arduino
112183
monitor_speed = 115200
113184
upload_port = /dev/ttyUSB*
114185
monitor_port = /dev/ttyUSB*
186+
monitor_filters =
187+
default
188+
time
115189
build_flags =
116190
-DUSE_RTOS=1
117191
-DUSE_WEBSERVER=1
@@ -134,6 +208,37 @@ framework = arduino
134208
monitor_speed = 115200
135209
upload_port = /dev/ttyACM*
136210
monitor_port = /dev/ttyACM*
211+
monitor_filters =
212+
default
213+
time
214+
build_flags =
215+
-DARDUINO_USB_MODE=1
216+
-DUSE_RTOS=1
217+
-DUSE_WEBSERVER=1
218+
-DVERSION="4.1.0"
219+
-DUSE_NEOPIXEL=1
220+
-Os ; Optimize for size
221+
-ffunction-sections ; Place each function in its own section
222+
-fdata-sections ; Place each data in its own section
223+
-Wl,--gc-sections ; Remove unused sections at link time
224+
-DCORE_DEBUG_LEVEL=0 ; Disable debug output
225+
build_unflags =
226+
-O2 ; Remove default O2 optimization
227+
lib_deps =
228+
ricmoo/QRCode@^0.0.1
229+
adafruit/Adafruit NeoPixel@^1.12.0
230+
; AsyncUDP is built into ESP32 framework, no external dependency needed
231+
232+
[env:adafruit_feather_esp32s3_reversetft_rtos]
233+
platform = espressif32
234+
board = adafruit_feather_esp32s3_reversetft
235+
framework = arduino
236+
monitor_speed = 115200
237+
upload_port = /dev/ttyACM*
238+
monitor_port = /dev/ttyACM*
239+
monitor_filters =
240+
default
241+
time
137242
build_flags =
138243
-DARDUINO_USB_MODE=1
139244
-DUSE_RTOS=1
@@ -170,6 +275,9 @@ build_flags =
170275
monitor_speed = 115200
171276
upload_port = /dev/ttyUSB*
172277
monitor_port = /dev/ttyUSB*
278+
monitor_filters =
279+
default
280+
time
173281
test_filter = test_rtos_infrastructure
174282
test_ignore =
175283
test_desktop_*

src/command_interface.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ void initializeSerial() {
3232
Serial.begin(115200);
3333
delay(1000); // Wait for serial to initialize
3434

35+
// Ensure proper line ending handling
36+
Serial.setTimeout(100);
37+
3538
#ifndef USE_RTOS
3639
// Legacy mode startup message
3740
Serial.println("\n==========================================");
3841
Serial.println(" ESP32 WiFi Scanner & AP");
3942
Serial.println("==========================================");
4043
Serial.println("🟡 Device initialization starting...");
4144
Serial.println("==========================================\n");
45+
Serial.flush(); // Ensure all data is sent
4246
#endif
4347
}
4448

@@ -108,6 +112,10 @@ void executeCommand(String command) {
108112
#ifndef USE_RTOS
109113
promptShown = false; // Reset prompt flag (legacy mode only)
110114
#endif
115+
116+
// Add command execution logging for debugging
117+
Serial.printf("Executing command: %s\n", originalCommand.c_str());
118+
Serial.flush(); // Ensure command echo is sent immediately
111119

112120
if (command == "scan on") {
113121
if (currentMode == MODE_STATION) {
@@ -146,10 +154,18 @@ void executeCommand(String command) {
146154
showNetworkDetails(networkId.toInt());
147155
}
148156
else if (command == "mode station") {
157+
Serial.println("[CMD] Switching to station mode...");
158+
Serial.flush();
149159
startStationMode();
160+
Serial.println("[CMD] Station mode switch completed");
161+
Serial.flush();
150162
}
151163
else if (command == "mode ap") {
164+
Serial.println("[CMD] Switching to AP mode...");
165+
Serial.flush();
152166
startAccessPoint();
167+
Serial.println("[CMD] AP mode switch completed");
168+
Serial.flush();
153169
}
154170
else if (command.startsWith("mode ap ")) {
155171
String params = originalCommand.substring(8); // Use originalCommand to preserve case
@@ -173,6 +189,8 @@ void executeCommand(String command) {
173189
}
174190

175191
startAccessPoint(ssid, password);
192+
Serial.println("[CMD] Custom AP mode switch completed");
193+
Serial.flush();
176194
} else {
177195
Serial.println("✗ Error: Usage: mode ap <ssid> <password>");
178196
Serial.println(" Examples:");
@@ -196,6 +214,29 @@ void executeCommand(String command) {
196214
else if (command == "clear") {
197215
clearConsole();
198216
}
217+
else if (command == "debug reset") {
218+
// Debug command to reset command task state
219+
#ifdef USE_RTOS
220+
Serial.println("[DEBUG] Resetting command task state...");
221+
// Note: promptShown is managed by CommandTask, not directly accessible here
222+
Serial.println("[DEBUG] Command task state reset complete");
223+
#else
224+
promptShown = false;
225+
Serial.println("[DEBUG] Legacy mode prompt state reset");
226+
#endif
227+
}
228+
else if (command == "debug tasks") {
229+
// Debug command to show RTOS task states
230+
#ifdef USE_RTOS
231+
Serial.println("[DEBUG] RTOS Task Information:");
232+
Serial.printf("Free heap: %d bytes\n", ESP.getFreeHeap());
233+
Serial.printf("CPU frequency: %d MHz\n", ESP.getCpuFreqMHz());
234+
Serial.printf("Core 0 tasks running on: %d\n", xPortGetCoreID());
235+
Serial.flush();
236+
#else
237+
Serial.println("[DEBUG] Not in RTOS mode");
238+
#endif
239+
}
199240
else if (command == "ap info" && currentMode == MODE_AP) {
200241
printAPInfo();
201242
}
@@ -292,6 +333,13 @@ void executeCommand(String command) {
292333
else if (command.length() > 0) {
293334
Serial.println("✗ Unknown command. Type 'help' for available commands.");
294335
}
336+
337+
// Ensure command execution completion is logged and flushed
338+
Serial.flush(); // Force all output to be sent
339+
#ifdef USE_RTOS
340+
// Give other tasks a chance to run
341+
vTaskDelay(pdMS_TO_TICKS(1));
342+
#endif
295343
}
296344

297345
// ==========================================
@@ -554,6 +602,12 @@ void executeLatencyCommand(String command) {
554602
else if (subCommand == "stop") {
555603
stopLatencyTest();
556604
}
605+
else if (subCommand == "reset") {
606+
// Force reset latency state to IDLE
607+
shutdownLatencyAnalysis();
608+
initializeLatencyAnalysis();
609+
Serial.println("✅ Latency analyzer reset to idle state");
610+
}
557611
else if (subCommand == "status") {
558612
Serial.println(getLatencyStatus());
559613
if (getLatencyTestState() == LATENCY_COMPLETED) {
@@ -600,6 +654,7 @@ void printLatencyHelp() {
600654
Serial.println("│ latency test http│ Start HTTP request latency test │");
601655
Serial.println("│ latency test <ip>│ Test latency to specific host/IP │");
602656
Serial.println("│ latency stop │ Stop current latency test │");
657+
Serial.println("│ latency reset │ Reset latency analyzer to idle │");
603658
Serial.println("│ latency status │ Show current test status │");
604659
Serial.println("│ latency results │ Show last test results │");
605660
Serial.println("│ jitter │ Quick jitter analysis (20 packets) │");

0 commit comments

Comments
 (0)