Files
audio2midi/README.md

102 lines
3.8 KiB
Markdown
Raw Normal View History

# Audio2MIDI
2025-04-12 21:13:16 +02:00
This project is an Arduino-based application that manages WiFi connectivity, LED control, and ESP device information. It uses the [WiFiManager](https://github.com/tzapu/WiFiManager) library to handle WiFi connections with fallback to Access Point (AP) mode and a captive portal for configuration.
## Features
- **WiFi Management**: Automatically connects to saved WiFi credentials or starts an AP with a captive portal for configuration if no connection is possible.
- **ESP Information**: Displays ESP device information such as chip ID and flash size.
- **LED Control**: Provides functionality for controlling LEDs (e.g., cycling through colors).
- **Web Server**: (Placeholder for potential web server functionality).
## Project Structure
The project is organized as follows:
```
src/
├── esp_info.cpp # Handles ESP device information
├── esp_info.h
├── index.h # Placeholder for web server content
├── led_control.cpp # Handles LED control logic
├── led_control.h
├── main.cpp # Main entry point for the application
├── web_server.cpp # Placeholder for web server functionality
├── web_server.h
├── wifi_manager.cpp # Manages WiFi connectivity
├── wifi_manager.h
```
### Key Components
#### `main.cpp`
The main entry point of the application. It initializes the WiFi manager, prints ESP information, and sets up LED control.
#### `wifi_manager.cpp` and `wifi_manager.h`
Manages WiFi connectivity using the `WiFiManager` library. It attempts to connect to saved WiFi credentials and falls back to AP mode with a captive portal if the connection fails.
#### `esp_info.cpp` and `esp_info.h`
Provides functions to retrieve and display ESP device information such as chip ID and flash size.
#### `led_control.cpp` and `led_control.h`
Handles LED control logic, such as cycling through colors or setting specific patterns.
#### `web_server.cpp` and `web_server.h`
(Placeholder) Intended for implementing web server functionality.
## Setup and Usage
### Prerequisites
- Arduino IDE or PlatformIO
- ESP8266 or ESP32 microcontroller
- [WiFiManager](https://github.com/tzapu/WiFiManager) library installed
### Installation
1. Clone this repository:
```bash
git clone https://github.com/your-username/audio2midi.git
cd audio2midi
```
2. Open the project in your preferred IDE (e.g., Arduino IDE or VS Code with PlatformIO).
3. Install the required libraries:
- [WiFiManager](https://github.com/tzapu/WiFiManager)
4. Configure your microcontroller board and upload the code.
### Usage
1. Power on the ESP device.
2. The device will attempt to connect to saved WiFi credentials.
3. If no connection is possible, the device will start an AP named `AudioToMIDI-AP` with the password `password123`.
4. Connect to the AP and configure the WiFi credentials through the captive portal.
5. Once connected, the device will proceed with its functionality (e.g., LED control, ESP info display).
## Customization
- **AP Name and Password**: Modify the AP name and password in `wifi_manager.cpp`:
```cpp
wm.autoConnect("AudioToMIDI-AP", "password123");
```
- **LED Behavior**: Customize LED patterns in `led_control.cpp`.
## Troubleshooting
- If the device fails to start the AP or connect to WiFi, ensure the `WiFiManager` library is installed and the ESP device is properly configured.
- Check the serial monitor for debug output.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [WiFiManager](https://github.com/tzapu/WiFiManager) for simplifying WiFi configuration.
Visit http://[esp-ip]/list to see all files in SPIFFS
Verify that you see /www/index.html and /www/dashboard.html listed
If files are not listed, you need to upload them to SPIFFS using PlatformIO's "Upload Filesystem Image" task