Repository navigation
Make Technic Hub stay connected to PC when connecting to Xbox Controller - #515
Conversation
|
Laurens, in your comment above you have |
|
Test with firmware: All test had telemetry active, not paused at all. Before the xbox-ctrl was paired: Second run: fine 🎉
Minor breaking: now gets: Great improvement of usability of the xbox-controller on the TechnicHub. 🥇 |
|
Thanks! To confirm, did that set of devices have the issue to begin with, so did it get stuck on the stable firmware with |
When connected to an iPad or many other hosts, pairing with an Xbox controller failed because the Bluetooth chip ran out of memory. The iPad asks to send the hub link layer packets of up to 251 bytes instead of the 27 byte default, so the chip has to keep much larger receive buffers for that connection. Some PCs does not ask for this, which is why the same pairing worked there. Fix it by limiting the data length to 27 bytes in both directions during init. This has to be sent before HCI_EXT_setLocalSupportedFeatures(), after which the chip refuses the command but still accepts longer packets. Longer messages are still split up and put back together as before, so the MTU is unchanged. Large program downloads still load at about the same time.
Disconnecting is no longer needed, so we can drop it to reclaim some space.
a48f5eb to
b0c3558
Compare
On v4.1.0b4 I could not get the xbox controller to even pair with the technichub. |
|
Right, so those are being separately fixed. Would be best to test the old Xbox situation on the stable firmware. Thanks for your patience. Your input it much appreciated. All updates are being pushed right now. I think we'll put out a beta with these fixes today or tomorrow. Even if there are some issues left, it's good to have Technic and City Hub back to normal. |
This fixes a longstanding issue where people could not connect the Technic Hub and the Xbox Controller while connected to their PC.
I could not reproduce it on my PC, but it did happen when using my iPad as the host. I think we finally found it:
It works well with my iPad now.
Before we merge this, I'm hoping to get some feedback from people where this failed before. Please try the following script. The light is green when you press something, else red. And blue while still connecting:
To confirm that your computer was affected before
We'd need to know this too, or else we don't know if the fix was intended for you. Because before, it would disconnect by default so you would not see the issue.
Run the script above on the current stable or beta firmware, and use
xbox = XboxController(stay_connected=True). Then it will attempt to stay connected. On the old firmware, this should cause Xbox Controller to never finish pairing or the hub generally just freezes.Other side effects. This may magically fix some other memory issues we saw with the CC2640 too 😄