The purpose of this repository is to illustrate an issue with HTTP POST
method from a WiFi-enabled device. The device is meant to record audio and upload a file via a REST API. If this all seems like an overblown example, well...it is. But I only copied from documentation already written.
Tip
Be sure to follow the instructions in the README
files under each project's directory.
This system is using a WiFi-enabled device with a microphone to collect audio. I'm temporarily storing the audio to the onboard SD card before uploading.
For the software side of the implementation, I am trying to keep it lightweight while also learning something new (...so don't judge too harshly). The APIs are built upon and served up via the MAN
™ stack. (...or, should it be the NAM
™ stack? ....nam
nam
nam
)
Important
--> This is where my problems lie, at the moment.
The remote device has all the things built-in: MicroSD, WiFi and microphone. Specifically, this example targets the Seeed Studio XIAO ESP32 S3 (Sense).
I built some simple APIs which are well-documented via Swagger. As such, I'm not going to write it all out here. If you don't know what that is, it's okay. All you need to know is how to run the following things:
- Command-line.
Okay. Scratch that - you need to know how to use the one thing.
NestJS Handles the APIs
NestJS handles the APIs for managing content - you know? The basic CRUD operations (Create Read Update .Delete)
These methods are simple enough. I following some pretty standard practices in developing this. When it is up and running, you should find a Swagger-generated page with all the APIs at http://localhost:3000/apis
.
Created a simple UI for visualizing results.
- Home Page, with basic instructions/guide to using the subsequent pages
- List all recordings
- Listen to associated audio
I should also make note that I styled this with Material. You can see all that stuff on The Angular Material site.
Persistance layer, obvy.
I am sure there will be arguments and challenges for using a database to store the actual files. Just know that we don't fully intend on keeping it this way. For now, it makes the most sense to use MongoDB for all of this.
There is an assumption here that you, reader, understand how to install and run all the aforementioned software.
At a high-level, we're going to:
- Install Dependencies
- Build/Run the NestJS application
- Optionally build/run the Angular UI
- Change IP and port for
localhost
proxy- Only necessary if you're running the Angular UI
- Install the firmware on your XIAO ESP32 S3
- Change configuration values in
xiaos3-playground
project - Build and deploy firmware
- Open a Serial Monitor and watch the magic unfold.