Retrospective: Three years working on BlueRetro #289
Replies: 4 comments 2 replies
-
Ah, quite informative.to hear about the project trajectory |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing. I followed the instructions and now I'm playing my N64 with a generic blueetoth gamepad. |
Beta Was this translation helpful? Give feedback.
-
sorry for the extra job, keep going you're so talented |
Beta Was this translation helpful? Give feedback.
-
Brazilian here! First of all, thanks for this amazing project! A little clarification on why we like the project so much. Before the pandemic, retro systems and accessories were sold a decent prices. But after the pandemic everything retro gaming related got insane prices. GameCube controllers for example, here in Brazil can be sold at a good U$ 120,00. And for systems that weren't popular here like OG Xbox, GameCube and PC-Engine for example, prices can go crazy. On the other hand, you can get genuine PS4 controller at a good U$ 45, 40 in Amazon. Also, 8Bitdo joysticks can be delivered here at a good price from AliExpress. So, BlueRetro is a great alternative for us! Also for systems like Dreamcast, GameCube and N64 with 4 controllers, Getting for joysticks for each system can be pretty expensive! This is just a simplification, but I think that it can give you some background! Again, Thanks for the amazing project and also thanks for sharing it! |
Beta Was this translation helpful? Give feedback.
-
Two years ago today, I open sourced BlueRetro [1] v0.1 in the context of the Hackaday Prizes 2020 [2]. Up to that point I had been working on the project for about a year in private. So we could say BlueRetro is three years old now! Let’s do a small retrospective!
Background
At a very young age I somehow got really fascinated by game controllers. I recall my dad fixing Atari 2600 controllers by replacing the contact domes and showing me at the same time how the wiring worked. I recall being mind blow at the fact that, for each generation of console released, the button count kept going up while the number of wires in the cables kept going down! Some magic was going on in those black chips for sure!
By the time I got to colleges, I understood pretty much how all controller protocols worked except those using Bluetooth. I forked the Cube64 [3] project and started adding new features. After graduating, I worked professionally on 802.11 (Wi-Fi) testing & driver development for almost 10 years and I still had very little knowledge about Bluetooth besides knowing it was frequency hopping in the 2.4 GHz spectrum (Annoying interference!).
So leaning Bluetooth was a major factor why I started this project. Another reason was that I always wanted to maintain a significant open source project. I felt like a universal and multiplayer Bluetooth adapter was a missing piece in the retro gaming ecosystem and that, if successful, the project could really catch on. Finally, selling a hardware product done entirely by myself was a professional goal I had ever since I started my engineering studies.
Learning Bluetooth the
HardEasy WayLearning how Bluetooth protocol worked had a major impact on how I decided to develop BlueRetro. My first reflex as someone having previously worked with 802.11 devices was to try to get a wireless trace of a controller connecting to my Linux laptop. The first thing I leaned here is that true wireless trace isn’t much of a thing in the BT world and that making a trace of the HCI layer [4] is much easier and give you pretty much all you care for as a developer. Looking at the trace, I saw that after a long dance of packets between the two devices at the beginning, the end result was simply the controller sending status packets at some interval without any intervention from the host.
I had chosen to go with the ESP32 chip [5] and the Bluetooth stack that is included in the ESP-IDF is Bluedroid. Going through the sources and the docs my first impression was that it was quite bloated and I didn’t really see how it was going to help me in the simple task of getting reports from a HID device. I looked at the USB_Host_Shield_2.0 [6] project which had its own Bluetooth stack and had support for the most common Bluetooth controller but in the end I felt it was a bit too messy for my taste. I also looked at BlueKitchen's BTstack [7] for a few seconds until I noticed the non-free license.
Base on my perception that nothing complex was going in the HCI trace and that none of the Bluetooth stack I reviewed pick up my interest, I naively decided to make my own! I thought I just needed to mock enough of the protocols in a stateless fashion until the controller started to send the HID report. Plus I felt I would learn much more this way and I did! The first version of the project only supported the WiiU Pro controller. The BT stack was pretty much a mock over the HCI interface at first. But progressively as I added support for more devices it became much more dynamic and closer to a proper Bluetooth stack with the notable quirk of supporting only HID devices.
That may sound like a hard way to do it but in retrospect I think writing my own stack allowed me to learn at my own pace and was the easiest way to get a deep understanding of the various protocols involve with using HID devices. When I use an existing library, I rely a lot on examples and I don’t really know what I’m doing until I face an issue that requires digging into the library internal. You essentially cross your finger it won’t break.
Having my own stack made it much easier IMHO to support console controllers quirks. 7th generation console controllers like PS3 (No inquiry mode, require magic command) and Wii (PIN is BDADDR, no proper HID descriptor, requires configuration) are base on Bluetooth but don’t really fully follow the standard for a proper BT HID devices. 8th gen and over consoles offer a dumb-down standard HID interface but also got a more feature rich proprietary mode (Rumble, player LEDs, etc.).
On the other hand, it put on me the burden of supporting standard devices like mouse and keyboard. That may sound like a one-time effort to add support for something “standard,” in really I keep getting reports weekly of some random devices not working due to some wrong assumption I made in the generic device code. The fixes are always trivial but I can see I would likely avoid those issues entirely by using an existing mature stack.
Pivot From Making Hardware to Providing Software Only
For the first year after making the project open, my focus was still to turn this into a product I was going to sell myself. A few people attempted to make their own adapter base on my hardware design but very few had success.
The two main ESP32 development board available from Espressif are the small DevKit-C [8] and the big WROVER-Kit [9]. BlueRetro early on was using an SD card for its file system as I wanted to avoid CPU stalls that occurs when accessing the same flash that the application code is running from. The easiest way to get ready to use SD card slot was to use the WROVER-Kit board. Unfortunately that board had a lot of peripheral conflicting with the pins used by BlueRetro and required a lot of rework removing/adding small surface mount resistors to make it work. Using the DevKit-C was easier because no rework was needed. All you had to do is add the SD card slot!
Turn out the fact my SD card bus was running at 40 MHz made adding an SD card slot to the DevKit-C with jumpers wires very difficult in practice. So most people using BlueRetro omitted it and were missing out on features making use of the persistent storage. A few people suggested using the internal flash instead but I was extremely reluctant in doing so as it wasn’t something I was going to use with my planned product. I could have reduced the bus speed to make it work with jumper wire but again the real product didn’t need that after all.
My design was also to make a universal adapter that used different dummy cables to connect externally to console each controller port to allow multiplayer using a single adapter. To make this work on any console the GPIO interface is carefully designed so that each console got at least one dedicated input pins (all other consoles use it as output). When the adapter gets an interrupt on ones of those pins it then know which console, it’s talking to. This adds some complexity for building the cable as it is important that all the detection pins to be stabilized with a pull down to ground even if that pin is not used by the target system.
The feedback I got, however, was that the vast majority of people are looking for dedicated one player only dongle with not even a 1-inch cable visible! Another significant number of people want to install the adapter directly into their console as a mod kit. Turn out my design is the least popular option. Base on that feedback over that year I finally gave in and decided to provide multiple different build variations of BlueRetro rather than a unique one. I made dedicated FW for each console (in addition to the universal one) both in SD card and internal flash variant. This change really made the project pick up in popularity.
I haven’t given up on making my product yet but I kept pushing the hardware release as I much preferred to use my limited free time to add software features. To prevent people from selling their own hardware running BlueRetro I purposely hold on releasing the much requested over the air firmware (OTA) update feature. By the start of summer 2021 I realized making, selling and shipping the hardware wasn’t something I was interested to do at all.
v0.19 in July 2021 finally added OTA update support. That same month Will's Console Modifications [10] announced his intention of releasing the PSUnoRetro adapter (a dongle for PS1 & PS2) running the BlueRetro firmware. Interest in the project skyrocketed past that point. Later that fall I even discontinued the SD card support as I wasn’t using it myself anymore. I was from now on only going to provide the FW.
Slowly Building a User Base and a Community
On May 24, 2020, I pretty much silently uploaded v0.1 of the project on GitHub and then initially made a project page on hackaday.io for entering the Hackaday Prizes 2020. I didn’t try to promote much as it was still missing at lots of features. The project draw some attention when it made the main Hackaday site front page [11] in July but it ultimately didn’t draw any user. In retrospect Hackaday wasn’t the right channel for this kind of project as my work on BlueRetro is more software oriented. The hardware part is quite minimal.
I finally got feedback from one person in August 2020 [12] that build one and had issues accessing the web configuration and pairing controllers. After a quick troubleshooting chat, BlueRetro had finally it’s first successful DIY user. Then someone posted on the German forum circuit-board.de about the project and a lot of the active users that provided feedback came from there.
While Will's Console Modifications announcement draw a lot of attention, the big jump in DIY usage came in October 2021 when I managed within a week of release to add support for the official Nintendo Switch Online N64 Bluetooth controllers [13]. A lot of people looked for ways to use the controller on original N64 and BlueRetro was there ready. N64 is one of the easiest consoles to build a BlueRetro for as it requires only three wire connection.
DIY usage kept increasing when in December 2021, YouTuber Mundo Yakara [14] from Colombia started making videos tutorial on how to install BlueRetro into the console themselves (even if I’m not really supporting that properly yet!). I learned at that point that Latin America is much more into DIY console modding than US people. Following that I noticed a lot of other Latin YouTuber started making the same kind of videos. My social media following on YouTube and Twitter doubled within that month.
This boom in DIY usage generated a lot of bug reports which turnout out mostly to be hardware related problems. Most people use “clone” ESP32 module that lacks any quality control and makes weird problems hard to troubleshoot remotely. As most of the user only speak Spanish or Portuguese bug reports are often made using translator tools which make remote communication even harder. As a result I became a lot less responsive to user requests as it is draining the little energy I got left after a day at my real job.
Where am I Going With This?
I’m really happy that I added over the last two years all the features I had on my original TODO list. I’ll keep adding new features and try to fix bugs as I really love working on the software part. I still got a lot to learn about Bluetooth especially the low-level baseband part of it. I got a lot of weird issues with some controller that would need to do some real wireless traces. I’ll try to rent a Sodera Bluetooth Protocol Analyzers one day for a month or so.
I’m definitely not going to build or sell any hardware in the foreseeable future. I simply don’t have the time nor the interest to deal with this. WillConsole, Humble Bazooka, RetroTime, RetroOnyx & GrechTech are selling amazingly good looking 3D printed dongle already for various consoles and I expect this to keep growing until all console supported are covered. On top of this there is already a lot of different model on AliExpress from Shenzhen!!
The one I'm the most impressed about is Laser Bear Industries's GameCube BlueRetro Internal Adapter. The launch video made by MachoNacho is quite amazing!
I got a lot of other pet projects I’ll like to start working on but I don’t see how I can do so while still being active on BlueRetro. I guess my goal should be to get the project in a good place within a year and move on to other things.
Support my work
https://github.com/sponsors/darthcloud
http://patreon.com/darthcloud
http://ko-fi.com/darthcloud
https://darthcloud.itch.io/blueretro
Follow me on social
@[email protected]
https://twitter.com/darthcloud64
http://youtube.com/darthcloud
References
[1] https://github.com/darthcloud/BlueRetro
[2] https://hackaday.io/project/170365-blueretro
[3] https://github.com/darthcloud/cube64-dx
[4] https://hackaday.io/project/170365-blueretro/log/178249-learning-bluetooth-classic-bredr-with-hci-traces
[5] https://hackaday.io/project/170365-blueretro/log/177934-background-and-current-status
[6] https://github.com/felis/USB_Host_Shield_2.0
[7] https://github.com/bluekitchen/btstack
[8] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-devkitc.html
[9] https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-wrover-kit.html
[10] https://www.willsconsolemodifications.co.uk/index.php?route=product/product&path=59_67&product_id=52
[11] https://hackaday.com/2020/07/01/blueretro-is-the-ultimate-console-controller-adapter/
[12] https://hackaday.io/project/170365-blueretro/log/181547-2020-07-29-progress-update-first-blueretro-diy-user
[13] https://www.youtube.com/watch?v=bxocb5ziI6s
[14] https://youtu.be/0vbnkY_3Q6o
Beta Was this translation helpful? Give feedback.
All reactions