-
Notifications
You must be signed in to change notification settings - Fork 66
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
Cursed Bluetooth Hardware #4
Comments
Hi @Poohl ! Tip of the day : Change MAC Address on Intel Wireless Bluetooth Adapters (got Intel 9560 in my Thinkpad)
I also patched bdaddr to support Intel, but don't know how to share |
@thxomas You could push your source to a github repo maybe? or How does the patch look? Modified C-Code? Some fancy bash scripting? Anyway I'll update the post. |
Basically, Made a repo : |
@thxomas Just confirmed on my PCIE-Card that the magic numbers actually work. Also: You might wanna consider contributing this to BlueZ's bdaddr .
|
I've been digging the web for BT datasheets, forums, and quickly got sure that the feature was available but it seems Intel decided to disable it in recent windows drivers. So here is the magic trick revealed for Intel : 😁 OGF I have no clue whether it works on all Intel controllers or just a subset. I'd just guess that the vendor codes do not change often, and that it worked with my recent Wireless 9560 model so there's a chance it's global. The fact that Intel decided to remove the feature, made me hesitate to push it to bluez, so I dirty cloned a repo with the bdaddr files only. You can look at the commits to see what I've patched. I'm now testing joycontrol with a third setup : laptop Intel BT Ubuntu 20. Pairing is successful but reconnects get refused immediately. The SDP is messy and I think they are too many interfering plugins/daemons to keep the hacked Class in place while joycontrolling. Last but not least : still no clue on why the Switch drops the connection when trying NFC 😭 anyway I enjoy researching this. Let's keep up ! |
@thxomas Something interesting you might want to look into: when the simulated controller is paired, pair a real on aswell and try to read an amiibo on that. |
@Poohl unfortunately I have zero true amiibo. My actual theory is Max Slots Changed may mean that the switch is closing channnels and I suspect it has requested sniff mode before, but the host refuses hence the disconnect. (Remember my previous tip on link policy to disable SNIFF mode ? I cannot reconnect when it's disabled, so the Switch may request it sometimes.) Fact against this theory : sniff mode is for powersaving when low traffic, is it a good idea for 60/120Hz messages when you want to minimize input lag ?) |
Sniff mode is very low level in the controller, and bluetoothd debug messages have no hints on why the host would request the controller to deactivate sniff mode after the request from the Switch. |
@thxomas You don't need an amiibo. It kicks the simulated controller as soon as you enter the "read amiibo" screen. Sniff mode can also be used to talk to another devices when not busy with the one the Sniff-policy is negotiated with. When proxying you see a Sniff-mode change after every 2 packets or so, since it switches to talking to the other device. (and it works despite that), I'll try to get some NFC going with the Proxy. So I assume there is some weird behaviour in that Mode-change. It might signal the controller to lower the rate or to go to some kind of sleep mode. Since the controllers-code lives within this low level enviroment of the Bluetooth controller, I think this would be feasable. |
Hello, It now also supports Cypress Semiconductor chips found in the Pi4. |
Had some trouble getting it to work on v12.0.1. I basically tried everything multiple times. I don't know exactly what made it work, but it did. I used a RPi 4B, with a Cypress BT adapter. NFC emulation worked in MH Rise as a Pro Controller. I had to remove and reconnect the joycons for it to trigger, somehow. First time, after setting amiibo content via |
@RawBOT How did you trigger the NFC-read in game?
|
I still can't get mine to connect. I get It says I modified it already with Anything else I need to do? It hangs on To clarify, I'm on a Raspberry Pi 3B, and like everyone else, pre-v12.0.0 it worked. |
Just wanted to mention that I installed Linux Mint on a ASUS ROG laptop that had long since had its screen busted. Wasn't using it for anything else, so I figured why not, right? Turns out that it has a Broadcomm bluetooth adapter. Had to manually install the driver, but...
Works perfectly. And I could never get the darned BT adapter working at all when it was alive and running Windows 10. Decided to post this so you can add it to the pile of hardware that works.
|
Mac address needs to be changed to start with 94:58:CB: ? maybe ? Poohl/joycontrol#4 Probably will move back away from async. Not sure why I was doing it, but this is some old code
i dont know what im doing wrong cus i did everything i changed the mac addres changend this thing with the input flashed my raspberry 3b+ multiple times and the raspberry pi even says connection succesfull on a little pop up (not the on the console) but i just cant get out of the change grip order step (the bluetooth menu says something about no being able to connect cause its a non usable device or something) i just dont know what im doing wrong it just doesnt work and it would be nice if a video tutorial for the raspberry installation would be on youtube cause theres only one italian guy that made such a video and that method doesnt work pls help |
@Poohl just for the list of cursed bluetooth hardware (broadcom manufacturer btw) |
thread on what we know about bluetooth-adapters and how to make them work: (TLDR commands below)
Brands & Chips
How it should be
tested on Raspi 4B and switch V10 - v12.0.1
pairing
change the
ExecStart
option in/lib/systemd/system/bluetooth.service
toExecStart=/usr/lib/bluetooth/bluetoothd -C -P sap,input,avrcp
(After this BT-controllers, headphones etc. stop working due to a lack of drivers)
bluetooth.service
(latest patch does this, but any manual changes still require it)sudo systemctl daemon-reload
sudo systemctl restart bluetooth.service
reconnecting
The switch doesn't care a bit beyond the automated class and alias change.
You can change
ExecStart
back and restart bluetooth to get other bluetooth functionality back.How to improve success sometimes
Raspi 3/4 "code is running to slow"
FYI: the code is not nearly running as fast as intended. Currently it's targeting 60Hz instead of the default 120Hz for the PRO_CONTROLLER (because I can't get it any higher). However on RasPi 3 and 4 (and potentially others) you can improve the situation by disabling the builtin WIFI. The issue seems to be that the integrated Bluetooth and Wifi are attached to the same Bus (UART 0) and don't cooperate as well as they should affecting performance. You can verify this by running a speedtest over WIFI while running joycontrol.
Switch V12+ connection issues
credit to @thxomas and @JaredEzz for figuring this out
When V12 released, we had better success with the following additional modifications. This however might just have been correlation and not causation.
Change mac
When the MAC is in nintendo's range (
94:58:CB:
) it sometimes works better. All examples will try to changehci0
's address to94:58:CB:44:55:66
In general:
If
bdaddr
reports "Unsupported Manufacturer" you have the wrong version ofbdaddr
for your chip vendor.Intel Bluetooth adapters in Laptops
Thanks to @thxomas, you can use this version of
bdaddr
compatible with Intel chips and proceed like normal or use the following magic numbers for hcitool to change the MAC (instead ofbdaddr
):Raspi 3B+ & 4B
the included
bdaddr
should work, but after a fresh boot you once have to use these magic numbers additionally:Change Name
Usually the alias is enough, but the name can be changed to.
Either in
/etc/bluetooth/main.conf
or in/etc/machine-info
if you have the latter and thehostinfo
bluez plugin enabled (default).Pause input
If you get consistent disconnects in some situation do the following:
install
tshark
and runtshark -i bluetooth0 -w output.pcapng
while it happens (started preferably before joycontrol). Submit an Issue with the file (eg on Gdrive) and output ofbluetoothctl show
while joycontrol runs.pause
just before it happens. This will stop any input and usually prevents disconnects for 10 seconds. But you have tounpause
within those 10 seconds, else the connection times out.Troubleshooting
Most commonly: It worked and now it doesn't...
-r <switches mac>
option (keep the pairing) and see if you can get a connection on the home screenbluetoothctl scan off
)git checkout v12_fixes
) if you try to connect to v12 switchesTLDR - Just gimme the commands
change mac related stuff
Minor warning:
hcitool cmd
checks formatting, but other than that the ones and zeros are just send as command to the controller like that.bluetooth configs
pairing related stuff
The text was updated successfully, but these errors were encountered: