#if d.name.lower().startswith("lego mario"):
if d.address == LEGO_CHARACTERISTIC_UUID:
diff --git a/src/mario.py b/src/mario.py
index bddee31..e95ede2 100644
--- a/src/mario.py
+++ b/src/mario.py
@@ -17,7 +17,8 @@ BUTTON_TIME_DEFAULT = 0.1
BUTTON_TIME_JUMP = 1.5
# BLE stuff
-LEGO_CHARACTERISTIC_UUID = "00001624-1212-efde-1623-785feabcd123"
+#LEGO_CHARACTERISTIC_UUID = "00001624-1212-efde-1623-785feabcd123"
+LEGO_CHARACTERISTIC_UUID = "C30C5B5B-9B73-41B1-99C3-3E1AAFC7053E"
SUBSCRIBE_IMU_COMMAND = bytearray([0x0A, 0x00, 0x41, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01])
SUBSCRIBE_RGB_COMMAND = bytearray([0x0A, 0x00, 0x41, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01])
@@ -105,6 +106,7 @@ class MarioController:
def notification_handler(self, sender, data):
+ printf("Notify_handler")
# Camera sensor data
if data[0] == 8:
@@ -148,7 +150,8 @@ class MarioController:
self.gui.accel_field.SetLabel("")
devices = await BleakScanner.discover()
for d in devices:
- if d.name.lower().startswith("lego mario"):
+ #if d.name.lower().startswith("lego mario"):
+ if d.address == LEGO_CHARACTERISTIC_UUID:
self.gui.status_field.SetLabel("Found Mario!")
try:
async with BleakClient(d.address) as client:
Hi,
I could not get it to work on name check.
Only with address check. (But that could be my environment related)
The Mario connects, but is not happy with the IMU?
You hear the 'upswing' Mario sound, immediately followd by a 'downswing' Mario sound, that it is not happy.