oscillatingpump
PublicLoading…
UCSD MAE 156 Capstone Project
Link to UCSD Capstone Project Overview https://sites.google.com/eng.ucsd.edu/mae156b-2025winter-team06
The provided code was developed using Arduino IDE and the Platform.io extension on VS Code. While it is possible to flash/deploy our software to an ESP32 through other means, we heavily recommend the two for ease of installing dependencies and following subsequent instructions.
Setup
In order to flash the GPIO ESP or Web ESP, first make a local copy of the most recent version of this repository by clicking <Code> and either:
- Copying and running the command in terminal (requires github cli installation or git)
- Opening through Github Desktop (requires installing the Github Desktop app)
- Downloading and extracting the code from a .zip file
The next steps assume you have a local copy of the provided code.
Installing Libraries
GPIO ESP
Click the Platform IO icon on the left edge of VS Code, then navigate to Quick Access > PIO Home > Projects & Configuration.
Select Add Existing.
Navigate to the directory drive/path/to/repository/OscillatingPump/ESP32_CTRL and select Open "ESP32_CTRL.
Shortly, Platform IO should be setting up the project according to the platform.ini file in the selected folder, most importantly installing libraries that are used in the project.
Web ESP
Open the Arduino sketch named webesp.ino located in /WebappCode/webesp/webesp/.
Navigate to the library manager.
Search for and install the following libraries:
- Arduino_JSON by Arduino
- Async TCP by ESP32Async
- ESP Async WebServer by ESP32ASync
- EspSoftwareSerial by Dirk Kaar, Peter Lerup
In the top menu, Navigate to Sketch > Include Library, and include the following:
- WiFi
- LittleFS
The next step is to install ESP32 LittleFS uploader to the Arduino IDE.
Go to [[https://github.com/earlephilhower/arduino-littlefs-upload/releases]] and download the latest version of arduino-littlefs-upload-x.x.x.vsix.
Windows:
- In File Explorer, navigate to
C:\Users\<username>\.arduinoIDE\ - Create a folder called
pluginsif it doesn't already exist. - Move the downloaded
.vsixfile into this folder.
Mac OS:
- In Finder, navigate to
~/.arduinoIDE - Create a new folder called
plugins - Move the downloaded
.vsixfile into this folder.
Restart the Arduino IDE, and make sure the plug-in was successfully installed by opening the command palette with Ctrl/Cmd + Shift + P and ensuring Upload LittleFS to Pico/ESP8266/ESP32 is an available command.
Uploading/Deploying code to the ESP32's
With the environments and libraries set up, one can compile and deploy the code through the following procedures.
GPIO ESP
On the bottom bar, ensure that the Platform IO project is ESP32_CTRL and you are deploying to the right COM port (leave as Auto unless multiple ESP's are connected to same computer).
The code will be compiled and deployed to the ESP32 when pressing the → button.
- one can also compile the code without deploying by pressing the
✓button.
A new terminal should open within VS Code, displaying compile messages. When the terminal says Connecting...
Press and hold the Boot button on the ESP until the terminal shows that code is being written to the ESP32.
Web ESP
First, Go to Sketch > Show Sketch Folder and ensure that the data/ folder from our repository is there. This contains files that are to be uploaded to the ESP32 filesystem.
Open the command palette and run Upload LittleFS to Pico/ESP8266/ESP32.
After getting a Completed upload message, compile and deploy the sketch to the ESP32 by pressing the → button.
- one can also compile the code without deploying by pressing the
✓button.
When the terminal says Connecting...
Press and hold the Boot button on the ESP until the terminal shows that code is being written to the ESP32.
Troubleshooting code
If the ESP's are consistently not behaving as expected, we provide debugging statements through Serial Monitors, which can be accessed through the Command Palette of both VS Code and Arduino IDE.
Issues to check may include whether an ESP is:
- constantly restarting (stuck in a boot loop)
- unable to communicate through serial with the other ESP
- some particular features are not behaving as expected
- error codes being thrown by an ESP
The GPIO ESP has an ongoing task that reads the Serial port between the computer and ESP, providing the user with the following inputs and features:
| User Input | Feature |
|---|---|
debug | toggles debugging statements for Serial communication between ESPs |
cal debug | toggles debugging statements for during calibration |
wave debug | toggles debugging statements for wave generation |
show pm | prints out the current pressure map vector |
m:#.## M:#.## | manually overwrite the target min and max pressure |
c:# | manually overwrite the calibration state |
No comments yet. Be the first to ask about this board.