Building a Mesh Network with XIAO ESP32 for RC Lawnmowers

I recently embarked on a project to create a mesh network using the Seeed Studio XIAO ESP32C6 to control my RC lawnmowers (Hy-550CJ). This endeavor was driven by four main motivations:

  • Purpose-built connectivity: I needed a robust network to streamline the control of my RC devices in a field.

  • Cost efficiency: I leveraged inexpensive, off-the-shelf components to keep the project budget-friendly.

  • Resourcefulness: I wanted to put those leftover vape batteries (13450 cells) to good use.

  • Speed: Although I have a 900 MHz network in the pipeline for GPS RTK applications, for general bulk control I needed speed, simplicity, and plenty of both. I plan to fine-tune the 900 MHz setup at a later stage.

The Journey and Its Challenges

While the core concept was straightforward, the execution proved far more complex. I initially turned to the painlessmesh library—a popular option among hobbyists. However, I soon discovered that its reliance on C++ and JSON didn’t quite fit my vision. My goal was to implement a binary communication protocol for faster and leaner data handling, but transitioning away from JSON was challenging. The situation was exacerbated by integration issues with PlatformIO—functions, lists, and memory built-ins simply wouldn’t link. I wasn’t comfortable modifying external libraries without a clear understanding of their inner workings.

Moreover, I encountered several quirks using the Arduino IDE with the XIAO ESP32-C6. Anyone who’s ever tried holding down the “boot” button while plugging in a USB-C connector during an Arduino compile session knows how maddening that can be—especially when your project is housed in a custom enclosure. This is where PlatformIO truly shined. Its straightforward “upload” functionality felt like a breath of fresh air, even though I’m still wrapping my head around exactly how its technical internals compare to the Arduino environment. For now, ensuring that my code runs seamlessly is the top priority.

Diving Deeper: PlatformIO and ESP-IDF

Parallel to my experiments with painlessmesh, I began exploring ESP-IDF as an alternative framework. Here, I encountered another challenge: Seeed Studio’s PlatformIO integration didn’t support ESP-IDF out of the box. This gap pushed me to design a custom board definition based on the ESP32-C6-DevKitC-1. The necessity for this custom solution arose from a critical memory issue—the default ESP-IDF memory configuration is 8 Mb, but the XIAO ESP32C6 provides only 4 Mb. Resolving this discrepancy was essential before moving forward.

Hardware Considerations

I initially assumed that the built-in battery pads and integrated charge controller on the XIAO ESP32-C6 would allow me to simply measure the voltage or charge state. However, after consulting Seeed Studio’s wiki, I discovered that wasn’t the case. I had to solder resistors directly onto the board to form a voltage divider. In my configuration, an analog pin is connected across the battery leads as follows:

Bat+ — [R200k] — A# — [R200k] — Bat–

This straightforward yet effective solution enabled real-time battery status monitoring, ensuring the project stayed within safe operational limits and helped predict when solar-powered nodes might drop offline.

Reflections and Takeaways

Despite the setbacks, this project has been an immensely enriching learning experience. PlatformIO has proven to be a powerful tool—even though mastering its nuances took time, the payoff in streamlined development was significant. Additionally, working with ESP-IDF has become one of the highlights of my embedded systems journey. Its intuitive configuration system and promising over-the-air (OTA) update capabilities are nothing short of transformative.

I’ve also come to appreciate the standard mesh implementation built into ESP-IDF. While painlessmesh has its charm with its C++ approach, the streamlined, lean C-based implementation in ESP-IDF aligns better with my vision for embedded applications. Call me old school, but I favor the clarity and efficiency that C brings to the table.

What’s Next?

If you’re considering building your own mesh network or diving into the world of ESP32-based projects, I hope my experiences offer valuable insights into both the challenges and rewards of this technology journey. Whether you’re repurposing vape batteries or wrestling with memory configurations, every obstacle is an opportunity to innovate and grow.

Looking ahead, I plan to explore advanced OTA configurations and even integrate some machine learning elements to optimize network performance. If you’re interested in my CAD files, BOMs, or PlatformIO workspace, feel free to reach out. I’m just wrapping everything up and it is still a work in progress, but it is a good start: https://github.com/Zmotive/esp32-Mesh

Happy building, and here’s to pushing the boundaries of embedded technology!

Next
Next

Welcome to My Blog: Exploring the Future of Automation, Innovation, and Technology