Hi @Sid_coder,
If you're still looking for this, I've been building an open-source App Inventor extension for LEGO SPIKE Prime BLE control as a personal project:
https://github.com/edcheng1010/appinventor-lego-spike-prime-extension/releases/tag/v0.1.0
It's still a minimum viable product (MVP) at this stage, but it already supports BLE scanning/connection, motor control (speed, position, stall detection), coordinated drive-base movement, LED matrix, and sensor readings (color, distance, force, tilt), all from App Inventor blocks. Feel free to have a try!
Cheers.
Ed
6 Likes
Thanks for moving this to the right place! Here's a more complete write-up following the community guidelines.
Extension: SPIKE Prime BLE Extension
Unofficial integration. This is an independent open-source project. It is not affiliated with, endorsed by, or sponsored by the LEGO Group or the Massachusetts Institute of Technology.
What it does:
An open-source App Inventor extension that connects to LEGO SPIKE Prime hubs over Bluetooth Low Energy (BLE). It lets students control motors, read sensors, display on the LED matrix, and coordinate drive-base movements — all from App Inventor blocks, without needing the official LEGO software.
What makes it unique:
There is currently no other App Inventor extension that communicates with SPIKE Prime over BLE. The official LEGO app uses a proprietary protocol (COBS-XOR framing over a custom GATT service). This extension reverse-engineers that protocol and exposes it through simple, student-friendly blocks.
Features (v0.1.0 — MVP):
-
BLE scanning and connection (auto-reconnect, ghost device filtering)
-
Motor control: speed, position (absolute/relative), stall detection, stop
-
Coordinated drive-base: forward, turn, arc, tank-style (left/right speed)
-
LED matrix: set pixels, display patterns, clear
-
Sensors: color, distance, force, tilt/orientation
-
Event-driven: sensor change events, connection status events
Blocks:
LegoSpikeConnectivity
LegoSpikeMotors
LegoSpikeMovement
LegoSpikeSensors
LegoSpikeLight
Example project: SPIKEPrimeTest.aia
Available in the GitHub release, under Assets:
https://github.com/edcheng1010/appinventor-lego-spike-prime-extension/releases/tag/v0.1.0
Android compatibility:
-
Minimum: Android 8.0 (API 26) — required for BLE
-
Tested on: Samsung Galaxy S6, Android 13; Google Pixel 5, Android 13
Changelog:
- v0.1.0 (May 2026): Initial MVP release — BLE connection, motor control, sensors, LED matrix, drive-base coordination
Source code:
Fully open-source (Apache 2.0): https://github.com/edcheng1010/appinventor-lego-spike-prime-extension
Credits:
Built on top of the MIT App Inventor BLE component. Protocol reverse-engineering based on community documentation of the SPIKE Prime UART service.
Price: Free and open-source.
2 Likes