-
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
Console not pairing since update to 12.0.0 #3
Comments
Update : fixed Device Class setting by doing it AFTER hid.discoverable() in server.py However, still no pairing from the switch, here is the end of hcidump :
The rpi seems to reject the passkey although the AuthenticationRequired=False flag. So nothing happens at python level. T |
OK, what's the practice on git ? Rename an issue or create a new one ? |
Went a step further in the pairing process, by setting a bt-agent to accept the passkey. |
If anyone interested : After gathering info from various projects, I managed to get the amiibo_writing branch work on raspberry pi 3, latest raspbian buster. Please be aware it is still manual, and not ready for easy sharing. Steps to reproduce :
When this is done : try pairing.. Now if you reconnect with -r option, the connection keeps ON, until trying NFC read/write. Of course, these steps should be in some way integrated to the project, but at least the POC is done. Thanks to @Brikwerk from NXBT project for having found the missing information to reach this state ref. Brikwerk/nxbt#18 I need amiibos back ! 💪 |
I am trying your solution on my HP laptop with intel bluetooth on ubuntu and I followed your steps but I got stuck |
This file is specific to the RPi I think. this is the way bluez gets the hostname for bluetooth. On Ubuntu, you may check /etc/bluetooth/main.conf for the Name setting (top of file, just before "Class")
The file is an example found in the bluez source package. I attached my (dirty) modified version to this comment (rename .py or remove extension) Unlike joycontrol it runs on python2, you may need to Does the MAC Address change have an effect on the Intel chipset ? |
Run joycontrol, then, in another shell session, check your controller status by comparing to this :
The simple-agent must be running detached, or in another session, it will auto accept pairing. Once paired, you don't need it to be running to reconnect with T |
Thanks to @thxomas for providing steps to troubleshoot. 1. Change RPi BT MAC address to get in Nintendo OUI range
and after the change:
2. Disable extra SDP Profiles 3. Force default device class 4. Set default hostname in /etc/machine-info 5. Configure an Agent
Moving on to try the rest without the agent but wanted to post in case there's a simple fix for this error |
Try sudo or running the agent as root |
6. Modify server.py by swapping hid.discoverable() and set_class() FINAL |
For more insights if you want, find and install bluez-utils, to get tools liike btlon or btmgmt. They give good clues to the cause of problems (Switch not connecting at all, Authentication errors, etc...) |
I spoke too soon. It disconnected after a minute or so |
Good and bad news ! Maybe @Poohl will look into it ? |
I manually added a These are the relevant lines in my server.py
and again, in my /etc/bluetooth/main.conf @thxomas any thoughts? |
Wait, wait. Sorry for beeing late didn't get notified of the name change. So do I get this right: @thxomas got it working again just by messing with the Bluetooth pairing process and not modifying the input frequency (or to much inside joycontrol in general)? Since NXBT's solution is to limit the speed to 15Hz and 1hz before pairing, that can be done aswell but I highly doubt that this is how it should be done. I'll check old captures to check for something we might be doing wrong, @Brickwerk speculated here that it might be to do with the timing byte or some timing in general. I updated my switch while I was away too, damm it. |
@thxomas figured out how to pair it again. I can pair and connect again with -r but the connection only lives as long as I stay in the switch menus. Entering a game causes the connection to fail |
I noticed that the list of UUIDs is different when connecting the first time and reconnecting. The Human Interface Device UUID isn't present when I |
Any ideas on how I can apply the sdp_record_hid.xml manually? Not having any luck googling. I'm trying to do it with sdptool |
Entering Zelda:BOTW does not disconnect, I'm so lucky :)
I think no need to. SDP is intended for discovery only, once paired, the Switch will remember the UUIDs and PSM to connect to. |
OK, well Pokemon Sword/Shield disconnects :( probably the frequency issue. Just for fun, I connected to Zelda:BOTW and it works fine. I'll test some other games rn too. |
Yes sir ! The new pairing has additional security (PIN&Encryption) and the console does not tolerate much deviation from a true controller (Name, SDP profiles, ...). But I focused on BotW and apparently got lucky. I did not tinker with any core joycontrol logic as I don't get it yet.
I'll try to help you in the timing byte analysis when I understand it ;) |
@thxomas First I'm trying to get anything back to work. I followed @JaredEzz steps but my bluetooth adapter isn't complying. I have a raspi 4, but apparently these also have issues with that on top of the incredibly spotty wifi/bluetooth chip on there. Will take some time. What I found about the timing byte: The switch just increments it by one each message, the joycon (right joycon) increments it by 1 every 0.005 seconds, but increments it a lot more on input mode changes or some MCU commands. Since the joycons run at 60hz, that means incrementing it by 3 every report seems sensible. |
I tried
and
both did not work in changing the mac address of my intel bluetooth. I think I may need to get a usb bluetooth now |
@pokemon-bot Same problem here. If you find one that works please tell me which one (brand, model/type) because if my raspi won't cooperate either I gotta buy one :( For the record:
|
I am starting to think that bluetooth might be harder than emulating wired controller via arduino. I did a quick search and found this. Anyone tried this ? https://github.com/HackerLoop/Arduino-JoyCon-Library-for-Nintendo-Switch |
BTW I can't manage to reconnect the devices, I have to remove and pair them each time. |
@Yamakaky The good news: I got it working after presumably 4 BlueZ devs. I had to convert it to UDP instead of TCP, because L2CAP is frame based and when using queues+asyncio even without nagle's algorithm linux starts combining frames in TCP. That also improved lag and stability quite a bit, since UDP is generally more similar to L2CAP. (will push soon) |
Ok Great news: the Grand Patch is live, please everyone try the following:
And to read amiibos:
Try the same for writing amiibos. Untested yet. It is important, that whenever you want to enter any amiibo-screen you are paused. In general that is the main new thing. When you are paused the switch doesn't axe the connection (at least for a while), so whenever you come to some moment where you assume it's about to happen, try to pause. Note however that anything using the gyro this might not work or result in eradic movement. Also while paused anything but the buttons don't work. Also another debug feature is in there:
sets the input frequency to XHz, if you get a lot of |
I had to give it a few tries and follow the instructions on #4, even though it felt a little random as to why it connected then and why it didn't before, I was able to move around in Animal Crossing and use an NFC too! I did get a disconnection after using the NFC but unlike before, it did read the NFC before disconnecting and I could reconnect right away using the So this looks like a great work to me. Thanks a lot @Poohl ! One question, I do get a lot of |
BTW, tried it with Zelda BotW too and NFC worked once but can't get it to work again, tried 4 times with disconnections. Game says use a controller that supports NFC or not have the Pro Controller charging. For reconnecting, I have to close the game or it will error immediately. |
@mbacalan officially the |
@Poohl yes, I have tried again now with longer times after pausing. It did work once again but couldn't get it to work again even after rebooting both devices and trying multiple times. So that seems to be a little random, at least with BotW. ACNH worked on first try, not sure if it was coincidence or not. The disconnect happens while paused / without using |
On my side, the pairing works, but the connection is lost as soon as I leave the pairing screen:
|
@Yamakaky this happened to me once on initial pairing (opening the controllers menu) but after that, I'm able to connect using the |
Even more amazing news: It's now fully automated. I got the lag in Linux under control and could implement a transport-level fix. Why transport level is good: no game specific detection necessary, no input, output or whatnot dependencies to check. No need to handle NFC-reading, NFC-writing, Pairing etc... Let's hope that's really it. |
@Poohl latest version is working perfectly for me, amazing work! Connecting with |
Hey guys. You don't have to mess with Mac addresses. Changing the device class is enough to be able to connect again. |
@Poohl wow, GG on the great progress ! Just tested the Grand V12 Fix on RPi4 : both joycons attached, pairing at 1st attempt and still on the initial connection 25 min later ! After exiting Grip menu, I started ACNH, read an amiibo card, back home, managed to write to a card, swapped to BOTW, runs OK. goes to controller screen if I use the joycons, and finally crashed some way. After easy reconnect, amiibo use is OK ! Some rare "Code too slow" (a burst when reconnecting while ingame) This issue is gonna close soon... 👏 |
@thxomas Yes, am doing a bit of polish and final testing currently. Just read, wrote and re-read 3 amiibos. Paired and reconnected no problem. Went in and out of game, etc.
Still TODO:
|
Ok, I can pair and reconnect, write amiibos etc no problem. For now I consider this closed. |
@Poohl Are the instructions in this repo's readme still sufficient for v12.0.1? Or are there additional instructions (or no-longer-needed instructions) that still need to be merged? |
@Venryx The instructions in the readme should still work, but joycontrol will now also try to fix these things itself or warn you (wt least when using the cli).
Whether any of these changes are no longer needed only further testing will tell. @dtrunk90 stated that the MAC-stuff is uneccessary. Someone else reported success with the old Plugin-setup. I had success without the Name change. It might be the old steps are still all you need and everything else is just panic-fixes for nonexistent problems. Will test a bit the next week. |
I can now successfully connect to my Switch using the latest version by Poohl, but can't read Amiibo. Connection closes when attempting to read Amiibo. (I have also changed the ExecStart parameters in bluetooth.service, bluetooth MAC address using the change_btaddr.sh, and bluetoothctl system-alias). |
Ouch, v12.0.2 is available... misclick, big sweat.... but everything you fixed seem to work in this new version. |
The v12.0.2 makes changes to Bluetooth Driver. Is it safe to update or should I stick to v12.0.1? |
|
I think the problem is definitely with the device class. Even after changing the MAC address and successfully connecting with the Switch, the device is eventually identified as invalid when reading NFC. I ran the |
Mac address changing can only be considered as a workaround as you can Set the Mac address to one of your Real controllers who already got paired successfully to the switch. If you then connect with a Mac address of one of your Real controllers switch Firmware doesn't check the device class for pairing. So this is only bypassing the device class check when pairing. The Real solution is only to change the device class. That's what we already found out with Joycon Droid. |
@dtrunk90 So even the SDP-changes are unnecessary? Meaning the switch will pair despite too many capabilities, a non-nintendo mac and a random name and alias, as long as the class is ok? or is the Alias still required? |
I can only speak for pairing because i dont have the joycondroid Source Code. But yes, for pairing only the device class is needed. Nothing else. We made a magisk module in order to be able to keep using joycondroid. |
I tested too : Changing the MAC is not mandatory after all. |
I had a working setup on rpi3B with some issues, and after dist-upgrade (bad idea), I cannot connect anymore from the Grip/Order menu.
Joycontrol is indefinitely waiting for Switch to connect :
[EDIT: unrelated issue fixed.]
I'm trying to fix this before being able to troubleshoot amiibo_writing again. :)
The text was updated successfully, but these errors were encountered: