<<<<<<< HEAD
A comprehensive MicroPython-based file management and remote code deployment system for ESP32 boards. This system allows you to manage files, upload code wirelessly, and configure WiFi settings through a captive portal interface.
- Hardware Button Mode Selection: Choose between different operation modes using physical buttons
- Smart WiFi Management: Automatic connection to stored WiFi credentials with fallback to captive portal
- Captive Portal: Easy WiFi configuration through a web interface
- Remote Code Upload: Upload Python files via HTTP API
- File Management: List, read, write, and delete files on ESP32 filesystem
- Auto-Restart: Automatic restart after uploading main.py
- Multiple Operation Modes: Different file managers for various use cases
- ESP32 board (tested on ESP32-WROOM-32)
- MicroPython firmware installed
- WiFi connectivity
- Two push buttons (optional, for mode selection)
-
Button Configuration (Optional):
- Connect Button A to GPIO14 (with pull-up resistor)
- Connect Button B to GPIO27 (with pull-up resistor)
-
Upload Files: Upload all Python files to your ESP32 board root directory
-
Initial Boot:
# The system will automatically start based on button states: # - No buttons pressed: runs main.py (LED blinker demo) # - Button A pressed: runs file_manager_A.py # - Button B pressed: runs file_manager_B.py
-
WiFi Configuration:
- On first run, the system creates a captive portal
- Connect to "PoulStar" WiFi network (password: 12345678)
- Configure your WiFi credentials through the web interface
esp32-file-manager/
├── boot.py # Boot manager with hardware button selection
├── main.py # Default LED blinker program
├── file_manager.py # Main file management system
├── captive_portal_lib.py # Captive portal library for WiFi setup
├── config.txt # WiFi credentials storage (auto-generated)
├── config.json # Additional configuration storage (auto-generated)
└── README.md # This file
Stores WiFi credentials in the format:
YourWiFiSSID
YourWiFiPassword
Stores additional configuration:
{
"ssid": "YourWiFiSSID",
"password": "YourWiFiPassword"
}Boot Modes:
- Normal Mode: No buttons pressed - runs
main.py - File Manager Mode: Press Button A or B during boot - runs
file_manager.py
The file manager provides:
- List Files: Displays all files in the root directory
- Read Files: Shows content of existing files
- Upload Code: HTTP endpoint for remote code upload
Endpoint: http://esp32-ip-address/
Method: POST
Content-Type: application/json
Payload:
{
"filename": "my_script.py",
"code": "print('Hello from ESP32!')"
}Response:
Code written to my_script.py
POST /- Upload code file- Content-Type:
application/json - Body:
{"filename": "name.py", "code": "python code"}
- Content-Type:
- Check button states on GPIO14 and GPIO27
- Attempt to connect to WiFi using stored credentials
- If WiFi fails, start captive portal for configuration
- List existing files and show main.py content
- Enter code upload mode (HTTP server on port 80)
- IoT Development: Remote code deployment for IoT projects
- Education: Teaching ESP32 programming and file management
- Prototyping: Quick testing and deployment of MicroPython scripts
- Device Management: Remote configuration and code updates
- Modify the appropriate file manager (A, B, or create new variant)
- Test in both WiFi connected and captive portal modes
- Update this README with new functionality
boot.py: Hardware initialization and mode selectioncaptive_portal_lib.py: WiFi and web server managementfile_manager_*.py: File operations and HTTP API
- Default captive portal password should be changed for production use
- Consider implementing authentication for code upload in production
- Validate uploaded code to prevent malicious execution
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly on ESP32 hardware
- Submit a pull request
For support and questions:
- Create an issue in the GitHub repository
- Check existing documentation and examples
- Initial release
- Basic file management functionality
- Captive portal WiFi configuration
- Remote code upload via HTTP API
- Hardware button mode selection
ESP32 Remote File Manager & Code Deployment System
96b3ef4896b8bfe2b0fdcb28f1df56355ba0fe27