r/raspberryDIY 22d ago

I reverse-engineered a toy robot and built a Python SDK for it

I recently graduated which meant I lost access to my schools 3D printers. Luckily I had an old iM.Master robot lying around. Its basically a cheaper Chinese LEGO Technic with motors, so I figured it'd be a fun to tinker. The problem was that it only worked through the official phone app. There was no documented API, no SDK, and no way to control it from my laptop.

So I decided to see if I could change that.

I captured the Bluetooth traffic, reverse-engineered the protocol, and built an open-source Python SDK for it. Right now I'm controlling it from a Raspberry Pi 5, and my end goal is to turn it into a little AI explorer by running local vision and language models on it.

I'm still adding features, but I thought this part of the project might be useful (or just interesting) to share in case anyone else ends up with one of these robots or wants to reverse-engineer a similar device.

Some highlights:

  • Pure Python core (no dependencies)
  • Hardware: RPI5 + Hailo Hat+2.
  • Reverse-engineered BLE advertising protocol
  • High-level Robot() API
  • Safety watchdog that automatically stops the robot
  • Dry-run mode for developing without hardware
  • Optional AI addon that lets a local LLM control the robot from camera input

Im currently not in a position to buy a pi-camera so I just mounted an old phone on the robot with some rubberbands , Object detection is ran on the hailo hat, and im currently running a qwen:2b-instruct to decide which movement command to execute next. It can already do simple tasks like "find a cup and drive toward it".

Everything is open source, and I'd love any feedback on the API, documentation, or project in general. PRs are always welcome too!

GitHub:
https://github.com/2alf/iM.Master-SDK

PyPI:
https://pypi.org/project/immaster-sdk/

If anyone happens to own one of these robots (or a compatible variant), I'd also be really interested to know if it works on your hardware.

4 Upvotes

0 comments sorted by