-
Notifications
You must be signed in to change notification settings - Fork 341
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
Bounty - Bluetooth support using the Pico W #247
Comments
We chatted about this and are going to break it down into two separate bounties. Part 1 will be a proof of concept. This proof of concept is an MVP to see if it is even viable as a controller and has reasonable lag / performance / etc. This part can be quick and easy. Part 2 will be the full incorporation into GP2040-CE. |
Part 1 should be covered by PR bluekitchen/btstack#209. Extending the HID for more buttons,axis and modes could be seen in https://github.com/lemmingDev/ESP32-BLE-Gamepad and possibly ForceFeedback with https://github.com/YukMingLaw/ArduinoJoystickWithFFBLibrary |
While this is great information to have. What I'm looking for, for the bounty, is someone to actually make a demonstration using our codebase as the example. |
I didn't know Pico W also supports Bluetooth Classic (a crucial thing to have for emulating most console Bluetooth controllers) until now. We might actually get somewhere pretty far with this bounty. GP2040 DIY handheld controller anyone? |
@dogtopus yes please! My dreams of a cord free Switch arcade stick are still within reach :) |
Since the chip is connected via SPI... could this eventually be ported over to use ESP? |
In theory yes but we will eventually run into the issues with Bluekitchen's license agreement since it's not technically free software and from what I heard from them years ago, requires commercial licenses even if the firmware is open source but loaded officially to a board (open source or not) for sale. RPi foundation licensed from them so the Bluekitchen stack can be used on Pico W free of charge but that only limits to Pico W. (Also take this with a grain of salt since looks like their intention was to make it available for use with RP2040 and not just Pico W. It's better to formally ask them once we actually need to use the stack on non-Pico W boards.) |
Bluetooth support would also open the door for DIY receivers to connect bluetooth gamepads to S/NES or Wii extensions, right? That is, using the board as a receiver rather than a transmitter; similar to the SNES 'retro receiver' from 8bitdo? |
For GP2040-CE, we don't have any plans to support any platforms other than the RP2040. You're always welcome to fork, and do your own thing. |
We need to get transmission working first. |
I think they meant using ESP as an HCI, which I'm not sure if the license for the Bluekitchen stack in pico-sdk permits such use case. |
Oh, in that case, we're only utilizing what is available from the SDK, and we'll deviate after we have something working, if we have reason to. |
I know I said I'd have this working last month. I ended up ordering a couple more Pico Ws so I can implement this. |
Just as a sidenote, having done this for a project of my own, there is a bug with the current Bluetooth driver that limits pico hid host polling pretty badly, raspberrypi/pico-sdk#1342 I was mostly focused on making pairs of transmitters and receivers as I was building wireless controllers with console support, but from what I understand that bug should affect receiving from hid in general Mind you, I guess that's only a problem for non classic, and I suspect everything you'd be doing here would be bt classic anyways |
While the CWY43439 driver is licensed for commercial use for users of Pico W, or anyone else who builds their product around RP2040 and CYW43439, this is not the case for the BlueKitchen license. In addition to the standard BTstack licensing terms, a supplemental license which covers commercial use of BTstack with Raspberry Pi Pico W or Raspberry Pi Pico WH has been provided. There is no exception for those using RP2040 on their own boards. |
@aallan Thanks for the clarification. I'm personally not a fan of this licensing model but I guess that's to be expected when using non-free libraries like bluekitchen stack. |
This issue is going to be re-written to better reflect the goals of the project. I will keep it open until the new issue is posted. |
https://github.com/DavidPagels/retro-pico-switch Rough implementation of BlueTooth support with Switch connection is in this project. |
Unfortunately, it uses the Pico SDK, which I believe we can't use. |
We already have that on ESP32 in Blueretro but there must be a reason that Blueretro doesn't get ported to Pico. Maybe because of limited flash storage or the lack of speed. |
It's the same reason why GP2040 is not ported to ESP32. Because it's heavily BSP-specific and effectively not portable without major time and effort spent to rewrite the code. |
"Raspberry Pi Pico W customers benefit from a pre-paid commercial license for BTstack, allowing you to use Pico W as a component in your own products." https://www.raspberrypi.com/news/new-functionality-bluetooth-for-pico-w/ |
The Pico Sdk is exactly what we're using, it's why we can't use other drivers for Bluetooth at the moment, only BlueStacks, since it's already part of the SDK. |
Just adding citations here: The driver is normally a non-commercial piece of software that has been licensed to RPi by BlueKitchen, and RPi has in turn licensed its free use only if you are creating a Pico-W or Pico-W derived product.
Both licenses lead to a scenario where the usage of BTstack would arguably (if not clearly) limit GP2040-CE to non-commercial applications and/or Pico W-only applications, so it's not an option for us at this time. Addendum: but, of course, if someone does demonstrate all of this in a working state, maybe then it'd be worth trying to get our own license terms. A big if, to be clear, but just pointing out that the current reality doesn't shoot down the desire to experiment and get a PoC. |
By the way, i did ask bluekitchen about this for one of my projects and got this response back:
One thing i have seen some RP2040 based boards do is use other bluetooth modules.
As for actually implementing bluetooth, XInput won't be possible since that needs USB due to how windows detects those devices, so you would have to implement something using standard HID, but that is easy enough and i have done that myself for my Pico W based firmware. |
This is an odd line worth more investigation: "If a RP2040 with some other Bluetooth Controller is used, this requires to sign a license agreement with us." Mind reaching back out to see if the license is handled should we choose to use the same parts as the W? Why would I do that if it costs more than the Pico W? Easy! I don't want to solder a bunch of them and I need more GPIO. |
You would 100% have to license it with them if you use anything that isn't a PicoW, even if the parts are the same. I think by that they mean if you wanted to say use btstack on one of the other various RP2040 boards with bluetooth, you would have to license that as well, as its only licensed for use with the PicoW specifically. But i think if we were looking at other bluetooth modules i would assume they have some other bluetooth lib they can use. |
We would like to have support for Bluetooth and the Pico W board.
Requirements
MUST maintain USB compatibility
MUST support at least X-Input modes via Bluetooth.
We need to still be able to use the controller as a USB controller when plugged in, or a Bluetooth controller when not.
This is purely from the firmware perspective. Hardware for battery management and charging will be a separate effort.
Addition Considerations
Would be nice to have.
https://shop.pimoroni.com/products/lipo-amigo?variant=39779302539347
The text was updated successfully, but these errors were encountered: