Have you ever missed a flight? Sucks, doesn't it? It sucks even more when it is a fun flight that you get to skydive from above the fluffy clouds. The plane we jump out of cost more than $1.3M USD so it is unrealistic to expect it to wait on us. We have to be at the loading area ready to jump by 5 minutes call. Manifest staff make courtesy calls every 5 minutes, but they may get too busy with other office duties. This solution will make automated calls over PA system or for more personable experience it can be a reminder inside the office so staff can make the calls themselves.
Skydive Auto Reminder is a project that started in 2019 (Consuela) with a Single Board Computer (SBC) and a Microcontroller. In 2020 (Julie), the SBC has been replaced with ESP8266. Finally, in 2021 (JoeWez), the whole project was just an ESP8266 and a transistor for audio amplification.
In engineering, downsizing isn't always equal to rightsizing. We don't just race to the bottom all the time. We might have a situation where a feature is worth the extra money spent. We might also want to leave room for future upgrades because it is much harder to patch hardware than it is to patch software.
M5StackFirst of all, many thanks to Blossom Hu who facilitates a factory tour while I was in Shenzhen.
With all the capabilities available in M5Stack Core2 we added several features including:
- OTA firmware update
- Drop Zone selection
- Current status via display and LEDs
- High quality audio
Here's what we got when we asked ChatGPT for Flow Diagram of the code we already wrote:
+-------------------------------+
| Device Powers On |
+---------------+---------------+
|
v
+-------------------------------+
| Initialize M5 Hardware |
| (LCD, Buttons, Speaker) |
+---------------+---------------+
|
v
+-------------------------------+
| Connect to Wi-Fi |
| (via WiFiManager) |
| If fails → Restart |
+---------------+---------------+
|
v
+-------------------------------+
| Initialize OTA + I2S |
| Load stored Dropzone |
| (HOU / SSM / DAL) |
+---------------+---------------+
|
v
+-------------------------------+
| Wait for Dropzone Selection |
| [Buttons A: HOU | B: SSM |
| | C: DAL] |
+---------------+---------------+
|
v
+-------------------------------+
| Get Socket.IO SID from DZ URL |
| e.g., houstonclock... |
+---------------+---------------+
|
v
+-------------------------------+
| Join "announcements" channel |
| via POST request |
+---------------+---------------+
|
v
+-------------------------------+
| Fetch latest Jump Load JSON |
+---------------+---------------+
|
v
+-------------------------------+
| Parse JSON |
| For Selected Dropzone |
| Extract: |
| - Plane Name |
| - Load Number |
| - Jump Run & Departure Time |
+---------------+---------------+
|
v
+-------------------------------+
| Display Info on LCD: |
| Plane + Load + Time Diff |
+---------------+---------------+
|
v
+-------------------------------+
| Generate Text to Say |
| (e.g., "Otter 5, 10 minutes") |
+---------------+---------------+
|
v
+-------------------------------+
| Build Google TTS URL |
| Stream MP3 Audio to Speaker |
+---------------+---------------+
|
v
+-------------------------------+
| Reboot in 30s via Ticker |
+-------------------------------+
Speaking of chatbots, when we started this project, we visited https://community.m5stack.com/ for some help. At the top of the page, we found a link to https://chat.m5stack.com/ which was able to provide few helpful pieces of code.
Explaining The CodeThis is a PlatformIO project, and the code can be used in Arduino IDE after renaming main.cpp to <file name>.ino and installing the correct library versions. We listed five libraries in platformio.ini because they are used in main.cpp. The libraries are:
- M5Unified: Controls the M5Stack hardware.
- WiFiManager: For Wi-Fi setup with a configuration portal.
- ESP8266Audio: To stream MP3 audio (Google TTS).
- ArduinoJson: For parsing Drop Zone load data (from JSON).
- FastLED: For LED feedback.
We also defined HostName which is used in platformio.ini and main.cpp to avoid using IP addresses for Over-the-air (OTA) firmware updates.
In main.cpp we have a function to standardize writing to the display. We also have another function to read from and write to Non-Volatile Storage (NVS). There is nothing in the loop section because all of the code runs in setup section. Once an announcement has been made, M5Stack Core2 will restart and rejoin Wi-Fi quickly. If Wi-Fi is out of range or never been defined, the user can set ssid and password on a portal served by M5Stack Core2 once connected to M5Stack-Config Wi-Fi. M5Stack Core2 finds the last used Drop Zone location in NVS then start getting data from the webpage. If the load at 5 minutes increments an announcement will be made.
Finally, we added few lines of code to test when airplanes are not flying and we're not getting data from the webpage.
DemoThe first part of the demo shows how to use OTA in PlatformIO (first upload must be done using USB). Next, we show the code running on M5Stack Core2. The last half of the video shows different Drop Zones on the same webpage then M5Stack Core2 making the calls.
Comments