5.8 KiB
5.8 KiB
🎉 Project Migration Complete!
Summary
Successfully migrated the DCC-Bench project from WiFi/WebServer control to ESP32-2432S028R touchscreen control.
✅ What Was Changed
1. Hardware Platform
- ✅ Changed from generic ESP32 to ESP32-2432S028R (with built-in ILI9341 touchscreen)
- ✅ Updated
platformio.iniwith correct board and TFT configuration - ✅ Added TFT_eSPI and XPT2046_Touchscreen libraries
2. New Features Added
- ✅ TouchscreenUI: Full graphical interface with buttons and slider
- ✅ RelayController: 2-rail/3-rail track switching via relay
- ✅ Power Control: ON/OFF button with safety features
- ✅ Mode Switching: DCC ↔ Analog with automatic power-off
- ✅ Settings Persistence: All settings saved to NVS
3. Components Removed
- ✅ WiFiManager (no longer needed)
- ✅ WebServer (replaced by touchscreen)
- ✅ Web interface files (data/ folder)
- ✅ Bootstrap dependencies
4. Safety Improvements
- ✅ Auto power-off when switching modes (prevents dangerous transitions)
- ✅ Visual power state indication (green/red button)
- ✅ Clear mode indication (cyan for DCC, yellow for Analog)
5. Updated Pin Assignments
All pins updated to avoid conflicts with ESP32-2432S028R peripherals:
| Component | Old Pins | New Pins |
|---|---|---|
| DCC Output | 32, 33 | 17, 16 |
| Motor Control | 25, 26, 27 | 18, 19, 23 |
| Relay | - | 4 |
| Touch/Display | - | 2, 12-15, 21, 22 |
6. Documentation Created
- ✅
ESP32-2432S028R_MIGRATION.md- Detailed migration guide - ✅
WIRING_ESP32-2432S028R.md- Complete wiring guide - ✅
QUICK_REFERENCE.md- Quick reference card - ✅ Updated
README.md- Main documentation
📋 Files Modified
Created:
include/TouchscreenUI.hsrc/TouchscreenUI.cppinclude/RelayController.hsrc/RelayController.cppESP32-2432S028R_MIGRATION.mdWIRING_ESP32-2432S028R.mdQUICK_REFERENCE.md
Modified:
platformio.ini- Board config and librariesinclude/Config.h- Removed WiFi, added rail mode and power statesrc/Config.cpp- Updated save/load logicinclude/MotorController.h- Updated pin assignmentsinclude/DCCGenerator.h- Updated pin assignmentssrc/main.cpp- Completely rewritten for touchscreenREADME.md- Updated documentation
Removed:
include/WiFiManager.hsrc/WiFiManager.cppinclude/WebServer.hsrc/WebServer.cpp
Kept (not used, but preserved):
include/LEDIndicator.h- Can be used for future featuressrc/LEDIndicator.cpp- Can be used for future featuresdata/folder - Web files (not needed but preserved)
🚀 Next Steps
To Build and Upload:
# Build the project
pio run
# Upload to ESP32-2432S028R
pio run --target upload
# Monitor serial output
pio device monitor
To Test:
- ✅ Power on via USB-C
- ✅ Verify display shows UI
- ✅ Test touch responsiveness
- ✅ Toggle each button
- ✅ Test speed slider
- ✅ Verify relay clicking
- ✅ Test mode switching (should power off)
- ✅ Verify settings persist after reboot
📚 Documentation Reference
- Main README: README.md
- Migration Details: ESP32-2432S028R_MIGRATION.md
- Wiring Guide: WIRING_ESP32-2432S028R.md
- Quick Reference: QUICK_REFERENCE.md
⚠️ Important Notes
Power Safety
- Switching modes automatically powers OFF - this is by design for safety
- Always verify power state before testing with a locomotive
Pin Conflicts Resolved
- Original design had GPIO 33 conflict (DCC_B and Touch CS)
- Resolved by moving DCC to GPIO 16/17 and Touch to GPIO 22
External Circuits Required
- DCC Mode: Requires DCC booster circuit (LMD18200 or similar)
- DC Mode: Requires motor driver (LM18200 or similar)
- Relay: Requires 5V relay module for 2-rail/3-rail switching
Settings Storage
All settings stored in ESP32 NVS and persist across:
- Power cycles
- Firmware updates (unless NVS is erased)
- Reboots
🎯 Feature Highlights
User Interface
┌─────────────────────────────────────────┐
│ [POWER] [MODE] [RAILS] [DIR] │
│ ON/OFF DCC/DC 2/3Rail FWD/REV │
│ │
│ Speed: 45% │
│ │
│ ═══════════════○════════════ │
│ │
│ PWR:ON | Mode:DCC | 3-Rail | Addr:3 │
│ Speed:45% FWD │
└─────────────────────────────────────────┘
Button Colors
- Power: Green (ON) / Red (OFF)
- Mode: Cyan (DCC) / Yellow (Analog)
- Rails: Green (3-Rail) / Gray (2-Rail)
- Direction: White text
🔄 Version Information
- Previous Version: 1.0 (WiFi/WebServer based)
- Current Version: 2.0 (Touchscreen based)
- Platform: ESP32-2432S028R
- Framework: Arduino via PlatformIO
✨ Future Enhancement Ideas
- DCC Address Entry: Numeric keypad on touchscreen
- Function Buttons: F0-F12 control for DCC mode
- Speed Presets: Quick buttons (25%, 50%, 75%, 100%)
- Current Monitoring: Display track current (requires sensor)
- Locomotive Profiles: Save/load multiple loco configurations
- Emergency Stop: Large dedicated button
- Sound Feedback: Beep on button press
- Brightness Control: Adjust display backlight
Migration Date: December 1, 2025
Git Branch: ESP32-2432 (feature branch)
Status: ✅ Complete and ready for testing