ESPonWheels is a fun project aimed at controlling a car using a web interface. It utilizes the ESP8266 microcontroller to establish a connection between the car and the controlling device. The project was initially made for a school project.
- Web Interface: Control the car easily through a user-friendly web interface accessible from any device with a browser.
- Customizable: Modify and expand the project to suit your preferences and needs.
- Easy Setup: Set up the project quickly with detailed instructions provided below.
- Uses Little FS: This project uses Little FS to make it easier to edit HTML Code and clean up the .ino file
- ESP8266 microcontroller
- A car that can use the ESP
- A browser :)
-
Software Setup:
- Download the LittleFS-Uploader from GitHub
- Put the downloaded File in a newly created folder called "plugins" inside your ".arduinoIDE" folder. (usually under C:\Users\username)
- Clone this repository to your local machine.
- Open the project in Arduino IDE 2 or higher.
- Configure the project with Wi-Fi network credentials of your liking. (by default: SSID - ESPonWheels; Key - ESPonWheels; IP - 192.168.0.1)
- Upload the code to the ESP8266 microcontroller.
- Press Ctrl + Shift + P and select "Upload LittleFS to ..." (this can be done shortly after the Code was uploaded to the ESP)
-
Access the Web Interface:
- Once the code is uploaded connect your device to the ESPs Network.
- Open a web browser and enter the IP address of the ESP8266.
- You should now see the web interface for controlling the car.
-
Customize Controls: The controls for the car are defined in the
index.htmlfile and their behavior is controlled by the JavaScript code inindex.js. There are three types of button interactions:-
Hold and Release: These buttons trigger an action when pressed and another action when released. They are handled by the
handleButtonHoldfunction inindex.js. To add a new button of this type, add a newdivelement with a uniqueidinindex.htmland callhandleButtonHoldwith theidand a message inindex.js. -
Click: These buttons trigger an action when clicked. They are handled by the
handleButtonClickfunction inindex.js. To add a new button of this type, add a newdivelement with a uniqueidinindex.htmland callhandleButtonClickwith theidand a message inindex.js. -
Toggle: These buttons toggle between two states when clicked. They are handled by the
handleButtonTogglefunction inindex.js. To add a new button of this type, add a newdivelement with a uniqueidinindex.htmland callhandleButtonTogglewith theidand a message inindex.js.
-
-
Backend Code: The backend code is written in C++ and is located in the
ESPonWheels.inofile. It sets up a WiFi access point and a web server, handles HTTP requests from the web interface, and controls the car based on these requests. You can customize the backend code to suit your needs. For example, you can change the SSID and password, add new HTTP handlers, or modify the existing handlers to control the car in different ways. -
Styling Buttons: The appearance of the buttons is controlled by the CSS in
index.css. Each button should have thebuttonclass, and additional classes and ids can be used to apply specific styles. For example, theactiveclass is used to change the appearance of a button when it is in the active state.
Contributions to ESPonWheels are welcome! Whether you want to fix bugs, add features, or improve documentation, your help is appreciated.
This project is licensed under the GPL v3 License.