Inspiration
Memory leaks in embedded systems have caused severe real-world problems, leading to costly failures and safety risks. In 1997, NASA's Mars Pathfinder Mission experienced unexpected system resets due to a memory leak caused by a priority inversion problem in the real-time operating system. This disrupted communication with the rover causing engineers to actually lose the rover for quite some time. In 2012, Knight Capital Group suffered a catastrophic $440 million loss within 45 minutes due to mismanaged memory resources, leading to incorrect trade executions and forcing the company into insolvency. Similar incidents in automotive, healthcare, and industrial automation underscore the need for proactive and reliable memory monitoring and debugging.
What it does
MemViz is an ESP32-based real-time memory monitoring system that tracks key memory parameters such as free heap, largest memory block, and internal RAM. It detects potential memory leaks and usage trends, sending the data over-the-air to a server for analysis and visualization. With our system, developers can identify and address memory issues early, ensuring better system reliability and performance.
How we built it
Embedded Side:
Used the ESP32-S3 microcontroller and the ESP-IDF framework's robust features to monitor system memory in real time. Our development process involved integrating several components, including reading heap memory using the ESP-IDF's heap API's, Wi-Fi connectivity for remote data transmission, HTTP communication to send diagnostic JSON reports to a server, and ADC capabilities to interface with a TMP36 temperature sensor.
Backend Side:
Our backend, built with Flask, receives memory diagnostics from the ESP32 microcontroller via HTTP requests. The backend then relays this data to a React-based frontend using WebSockets, enabling live updates. Additionally, OpenAI integration provides automated status reports and allows users to inquire about their memory usage in natural language, enhancing accessibility and insights.
Challenges we ran into
Challenges we ran into
- ESP32 Wi-Fi Connectivity: Ensuring a stable connection and proper event handling for data OTA.
- Memory Management: Simulating realistic memory leaks without crashing the system.
Accomplishments that we're proud of
- Successfully implemented a real-time memory monitoring system with accurate reporting.
- Created a practical demonstration where temperature changes simulate memory allocation.
What we learned
- Deepened our understanding of memory management and types of memory.
- Deepened our understanding of ESP-IDF's memory management API and FreeRTOS task scheduling.
What's next for MemViz
- Cloud Integration: Sending data to cloud platforms for long-term storage and analytics.
- Production Optimization: Refining hardware and software to make MemViz a ready-to-deploy solution for IoT devices in industrial applications.
- Expanded Metrics: Adding monitoring for CPU load, power consumption, and network usage.
Built With
- c/c++
- esp-idf
- esp32s3
- http
- json
- nextjs
- python
- react
- sensor
- tcp/ip
- typescript
Log in or sign up for Devpost to join the conversation.