-
-
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
[Feature] Support for Remote Controllers for PrimeHub/InventorHub #191
Comments
Thanks for this request.
It may be possible, but it's not currently high on our priority list. We might prioritize #186 for the time being. |
Basic bluetooth and BLE libraries would go a long way. Just make it convenient? Maybe support for specific controllers can be left up to users? Releasing mpy files to be included in your project? |
that would be nice! I agree at minimal the powered up remote would be good and the xbox controller sounds like it can work. additionally BLE connectivity for messaging with raspberry pi for example would be the bees knees |
Hi @dlech and @laurensvalk, |
No, I don't think it would be easy, especially for someone not familiar with BLE. If you think you are up to the challenge I would start with https://github.com/pybricks/pybricks-micropython/blob/master/pybricks/iodevices/pb_type_iodevices_lwp3device.c. It shows how to scan and connect to a device and enable notifications. Some research or reverse engineering will need to be done to figure out how the XBox controller works (what does the advertising data look like? is there any config needed after connecting or do we just enable notifications on an HID characteristic?, etc.) to know what sort of changes need to be made to that code. |
Sounds like fun :) I'll have to buy xbox controller and give try to do it. |
We use VS Code on Ubuntu 22.04. |
Hello @dlech, I'm debugging the connection of xbox controller to technic hub. I'm fiddling with bluetooth_stm32_cc2640.c conditions based on sniffed advertisment packets. Is there any way how to connect the Visual Studio Code to live debugging on target? Because otherwise it is quite pain to debug (update code build/flash/run and guess). |
Unfortunately, no. The hubs are protected to disallow debugging with a hardware probe. We feel your pain too. |
Hi @dlech,
Similar case applies also for the scanning of xbox parameters. I can see the communication between technic hub and controller but events I'm capturing in get_vendor_event function do not correlate to any data captured by by the dongle. (capturing data by wireshark following xbox controller address)
|
yes
Please see pybricks/pybricks-micropython#80 (comment) for some explanation about why using print for debug is difficult.
It contains a "Legacy NPI" header and the HCI packet data for data received from the Bluetooth chip. Most of the Bluetooth stack is running on the Bluetooth chip. The Bluetooth chip uses vendor specific commands to communicate with the MCU. So the MCU doesn't receive what is seen going over the air, but usually there is a very closely related vendor specific command with the same information.
I would need to see more info on the Xbox Controller to know if it follows the standards that I am used to. But there is already code in Pybricks for the LEGO remote control that should show how to scan and connect to a BLE device. |
Hi @dlech and @laurensvalk,
With the new SPIKE/Inventor sets designed to work with in-app controllers set up in iPhone/iPad/laptop and standard controllers (e.g. XBox), what is your latest thinking re: PyBricks support for such controllers?
I notice that such support is currently not present in LEGO's SPIKE/Mindstorms Python API either. Technically, how complex is it for Python programs to receive inputs from the modern remote controllers?
Thank you.
Vinh
The text was updated successfully, but these errors were encountered: