One of the great things about Python is that there is a library for almost everything; and that includes controlling Lego robots. Recently, our team was brainstorming some ideas for how to make more exciting; and attention-drawing demos for events compared to our standard dashboards and demos run on a laptop.
The end result was repurposing a Lego robot to make an interactive InfluxDB demo; using Python to communicate with the robot via Bluetooth connection.
InfluxDB Lego Robot Design Decisions
One of our team members came up with the idea to use a Lego Boost Robot as the core of the demo after working on one with his kid; who wasn’t exactly pleased to have his toy temporarily commandeered for the prototype phase. This coworker knew there were a few available Python libraries for controlling the robot.
The next stage was figuring out how to connect the different components involved with the robot demo; which basically involved the tradeoff between simplicity and reliability. We needed the setup to be easy enough to use; so that nontechnical event staff would be able to start the demo. There were a few proposed architectures that involved using a Raspberry Pi or ESP32 to interact with the robot. In the end, we determined that it would be easiest to connect to the robot directly from a laptop running the other software required for the demo; rather than using other devices that could be lost or broken while traveling to events.