-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recent commit broke Mario hub connection #442
Comments
pybricks/pybricks-micropython@1235b35 added a hack to allow connecting to a Mario hub, however pybricks/pybricks-micropython@d82175c and pybricks/pybricks-micropython@a4a85dd broke the workaround while fixing other issues. |
Further observations while trying to connect to Mario from a Technic hub: It seems the technic hub gets stuck in the PT_WAIT_UNTIL from line: 550-578 in bluetooth_stm32_cc2640.c |
This seems to be working since pybricks/pybricks-micropython@98fa91c. |
For me this is still an issue. I just tried (on a Technic Hub) the code you mentioned here: pybricks/pybricks-micropython#68: from pybricks.hubs import ThisHub
from pybricks.iodevices import LWP3Device
from pybricks.parameters import Color
MARIO = const(0x43)
PORT_VALUE_MSG = const(0x45)
hub = ThisHub()
# Connect to the Mario
mario = LWP3Device(MARIO)
print("connected")
#subscribe to Mario barcode/color sensor
mario.write(b'\x0a\x00\x41\x01\x00\x01\x00\x00\x00\x01')
while True:
msg = mario.read()
kind = msg[2]
if kind != PORT_VALUE_MSG:
continue
color = msg[6]
print("color:", color)
if color == 21: # Mario is on red
hub.light.on(Color.RED)
else:
hub.light.on(Color.BLUE) Mario seems to connect, but the line Since you mentioned you succeeded to run this example: could it be that our Mario's run different firmwares? I just updated the firmware of my Mario through the official app (So I am assuming my Mario is running the latest Firmware). A firmware request through the LWP3 REPL yields the following result: |
I have the same Mario firmware version. I was testing using City hub (and Move hub). Does the hub unfreeze if you disconnect Mario? |
Just tested using a city hub, that one does work... So it might be Technic hub specific (I didn't expect it to be different to the city hub)
No, the technic hub stays frozen when I shutdown Mario. |
I didn't expect it to be different either. I will try the Technic hub later. |
Connecting is working for me with my Technic hub. |
Maybe one thing to check... with the official LEGO firmware, read the Radio Firmware Version hub property of the hub. This might tell us if we have different firmware on the Bluetooth chip between our two Technic hubs. |
I can confirm it is this specific hub that is causing the issue. I just tested with another Technic hub which can run the program successfully. I flashed the official LEGO firmware on the first hub, but it is not recognized by the pybricksdev LWP3 REPL. Which is strange in itself. But also prevents me from checking the radio firmware version at the moment. I can investigate this specific hub a bit more in the coming days. Just as an FYI:
|
Very interesting. Let's start a new issue for this specific hub. Since it doesn't work with Pybricksdev either, it is not just a Mario thing. |
On the other hand mario does have issues connecting with this update. I will investigate further!
Originally posted by @NStrijbosch in #432 (comment)
The text was updated successfully, but these errors were encountered: