Introduction
E-scooters have become a popular urban transportation option due to their convenience and low environmental impact. However, for tech enthusiasts and programmers, these devices represent much more than just a means of commuting. In this article, I share my experience of reverse engineering and rewriting the firmware of my Egret GT e-scooter in Rust.
Why Reverse Engineering?
The Egret GT is a high-end model boasting a 100km range and an LCD display. Yet, as a tech enthusiast, I wanted to understand how it worked under the hood. My curiosity was piqued by an undocumented feature: holding the 'down' button during power-on switched the scooter into firmware update mode.
Analyzing the Mobile App
The Egret mobile app allows unlocking the scooter, changing settings, and monitoring battery levels. By delving into the app's Bluetooth handlers, I discovered that the scooter could receive firmware updates across several components like the display and controller. I also found that unreported data, such as time spent in each driving mode and device temperature, was transmitted.
Exploring USB-C Connectivity
The manufacturer's documentation states that the USB-C port on the display is only for charging phones. However, by probing further with a USB-C breakout board, I explored the data communication possibilities. This step allowed me to better understand the scooter's communication protocol and plan the firmware rewrite.
Rewriting the Firmware in Rust
Rust is renowned for its memory safety and high performance, making it an excellent choice for embedded system programming. Rewriting the firmware in Rust required a deep understanding of the scooter's hardware interactions and business logic. I was able to improve energy management and optimize Bluetooth communication between components.
Benefits and Lessons Learned
The project not only enhanced my e-scooter's performance but also allowed me to secure the system further. Moreover, this experience provided me with valuable skills in reverse engineering and low-level programming.
Conclusion
Reverse engineering and rewriting the firmware of your e-scooter is an ambitious project, but with the right tools and a healthy dose of curiosity, it's possible to transform a commercial device into a customized project.
Let's discuss your project in 15 minutes.