Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
amiibo-emulation-with-linux-vm.md

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

Video Guides

Overview

This guide shows you how to use joycontrol to emulate Amiibos. You only need a Bluetooth adapter, and to boot your PC temporarily into Linux! (or you can try to use a Linux VM in Windows, but it has more issues).

Thanks to @mart1nro for joycontrol and @spacemeowx2 for the Amiibo support!

See the bottom for Troubleshooting steps!

Step 1: Boot Linux

Skip this if you are running Linux.

Go ahead and download an Ubuntu disc image Go here, https://mirror.us.leaseweb.net/ubuntu-cdimage/xubuntu/releases/20.04/release/. Download xubuntu-20.04-desktop-amd64.iso.

You have two options now:

  1. WSL is not an option. WSL2 is not an option. If you're asking, Docker will almost guaranteedly not help you either.

  2. Boot from USB

    • DO NOT choose 'Install' when you boot Xubuntu! I am not responsible for you messing up your computer.

    • If you're making a bootable USB, make sure you right click on the ISO file and choose "Burn Image to Disc" (this will wipe your USB drive). You cannot just copy the ISO file onto a regular usb drive with other files.

    • There is a full guide here: How to make bootable Linux USB in Windows (use the xubuntu iso though!)

  3. Boot in a Virtual Machine

    • you can use VirtualBox or similar to boot Linux inside Windows
    • you will need to forward your Bluetooth adapter to the VM. This video, at this timestamp, does a good job of describing what to do. https://youtu.be/zvVNwrseZhg?t=350. This guide used to have slightly different instructions. Go ahead and enable Bluetooth like the video says. If you have Bluetooth issues, see Troubleshooting at the bottom.
    • make sure to allocate at least 3GB of RAM to avoid any freezing, or issues with running out of space during setup
    • you can theoretically "install" Xubuntu so that you don't have to repeat the joycontrol setup steps, but the install takes a while and is unnecessary if you just want to get this up and going once or even a few times (you can just leave the VM run for a few days depending on what your'e doing).

Step 2: Install JoyControl

Run these commands in the VM. You'll want to run these in a Terminal. You can open the Terminal by clicking "Applications" in the top-left corner and then choosing "Terminal" under "Accessories".

Note, these commands will require Internet access, but most VM providers will have Internet wired up to the VM by default. Configuring this is out-of-scope for this guide.

(If you need to open this page in the VM to copy/paste, this link (to this page) is shorter: https://bit.ly/2z0m09k.)

sudo true # hopefully sudo is happy

sudo apt-get update -qy
sudo apt-get upgrade -qy
sudo apt-get install -qy git python3-pip libglib2.0-dev libhidapi-hidraw0 libhidapi-libusb0 libdbus-1-dev
sudo pip3 install hid aioconsole crc8 dbus-python

mkdir -p ~/joycontrol
git clone https://github.com/mart1nro/joycontrol ~/joycontrol

Step 3: Quick Linux Path Guide (for Amiibo Files)

You need to get the amiibo bin files into the VM. You're on your own for that. If you put them in your "home" folder in Linux, that is /home/xubuntu. It's also sometimes shortened to ~. So ~/Downloads would mean /home/xubuntu/Downloads.

If you drag and drop an amiibo bin named foobar.bin into your home directory, the path would be /home/xubuntu/foobar.bin for example (that you will use later). If you were to use a browser and, as an example, download a backup from your OneDrive account, it will end up in ~/Downloads, and so you could pass /home/xubuntu/Downloads/foobar.bin to joycontrol, as shown below.

Step 4: Use JoyControl!

Notes:

  • If you have problems, you can press CTRL+c and it will kill the app. Also, you can tap the up arrow to pull up the last command and run it again.
  • Only send buttons to the Switch via this app. Do not press buttons on real controllers!
  • After the connection, press <Enter> in the terminal to get the >>> prompt

The following shows someone starting joycontrol, connecting, sending some button presses and then loading up the amiibo bin and activating the amiibo reading:

cd ~/joycontrol
sudo python3 ./run_controller_cli.py PRO_CONTROLLER

# connect the control
# then after the messages and connection, press <ENTER>

# now you can send commands:
# you can send buttons (pressing enter after each line)
home
a
b

# get the amiibo payload ready:
# (see above for what the path should be)
amiibo /home/xubuntu/Downloads/backup-of-my-amiibo.bin

# activate the final dialog to start the NFC/amiibo read
a

Troubleshooting

  • Anything

    Try a few times! Things seem to be a bit flakey, even in pretty ideal conditions...

    Also, try another adapter. People seem to really struggle with the internal laptop adapters and report more luck when they try when they find lying around.

  • OSError: [Errno 97] Address family not supported by protocol

    You can't use WSL (neither WSL1 nor WSL2). If you're still getting this error, please give lots of details about anything you might have done differently.

  • The virtual joycon disconnects when I leave the Grip screen

    You might get an error like this:

    ERROR - [Errno 104] Connection reset by peer [19:39:05] joycontrol.protocol connection_lost::121
    ERROR - Connection lost.
    

    Few things:

    1. Do not touch the real joycons or controller! Remove the joycons entirely, if possible, from the system. Remove other pro controllers.
    2. Send all buttons from the joycontrol app, instead of pressing the real buttons. You should get the game all ready to read the amiibo, then do the steps to attach the controller. Then send the final buttons to get back to the game and activate the amiibo.
    3. If you've done these things and it still disconnects when you leave the Grip screen, then you might be having Bluetooth issues. If this is the case, check your BT forwarding to your VM setup. Try booting into Linux on a USB instead. Or try another Bluetooth adapter.
  • OSError: [Errno 98] Address already in use

    Check two things:

    1. It's likely that you have joycontrol running already. Run ps aux | grep joycontrol. Does it look like there are two sets running. Try to kill them, or reboot.

    2. If you're sure that's not it, you can try this workaround, but it really shouldn't be necessary almost ever. (details)

      sudo sed -i 's|^ExecStart=/usr/lib/bluetooth/bluetoothd.*$|ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=input|g' /lib/systemd/system/bluetooth.service
      sudo systemctl daemon-reload
      sudo systemctl restart bluetooth

      If this still doesn't help, it's the other one...

Old Troubleshooting

These steps are not really recommended by me anymore. I think they tend to cause more problems than good.

Windows + VirtualBox Workaround

You may need to disable your BT adapter so VirutalBox can control it:

  1. Go into Device Manager

    • Find your Bluetooth adapter
    • Right-click -> Disable
  2. Go into Windows Services

    • Disable THREE Bluetooth services:
      • "Bluetooth Audio Gateway Service"
      • "Bluetooth Support Service"
      • "BluetoothUserService_xxxx"

MANY USERS are reporting that they re-enabled the devices in Hardware Manager after the VM booted and THEN were able to complete the steps successfully.

Known Good Setups

  1. Raspberry Pi 4 with built-in Bluetooth + Raspbian
  2. Raspberry Pi 0 with built-in Bluetooth + Raspbian

(it's possible a few steps are slightly different on Raspbian)

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 3, 2020

Thank you @mart1nro and @spacemeowx2!!!

@MonsterDruide1

This comment has been minimized.

Copy link

@MonsterDruide1 MonsterDruide1 commented May 3, 2020

You also need to add

sudo pip3 install aioconsole
sudo pip3 install hid
sudo pip3 install crc8

to install all the requirements for python.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 3, 2020

Hi @MonsterDruide1, does the current pip line not work? I already have sudo pip3 install hid aioconsole crc8 dbus-python in there.

@Snoower

This comment has been minimized.

Copy link

@Snoower Snoower commented May 3, 2020

Hey! I'm using xubuntu with VirtualBox and I've successfully been able to connect to my switch. I'm not sure what to do after that point. I'm trying to use this for ACNH and whenever I try to use the cmds in the terminal to navigate away from the change grip/control, it disconnects.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 3, 2020

@Snoower I updated the notes at the end that describe how to send button presses and/or amiibos.

@Snoower

This comment has been minimized.

Copy link

@Snoower Snoower commented May 3, 2020

@Snoower I updated the notes at the end that describe how to send button presses and/or amiibos.

thanks for the quick reply! I've tried doing so and any command that sends an input will disconnect my switch.
after sending home, a, and b i've received:

[19:39:05] joycontrol.transport write::155 ERROR - [Errno 104] Connection reset by peer [19:39:05] joycontrol.protocol connection_lost::121 ERROR - Connection lost. [19:39:05] joycontrol.protocol input_report_mode_full::192 ERROR - [Errno 104] Connection reset by peer [19:39:05] __main__ _main::206 INFO - Stopping communication... Traceback (most recent call last): File "./run_controller_cli.py", line 229, in <module> loop.run_until_complete( File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "./run_controller_cli.py", line 204, in _main await cli.run() File "/home/benji/joycontrol/joycontrol/command_line_interface.py", line 153, in run await button_push(self.controller_state, *buttons_to_push) File "/home/benji/joycontrol/joycontrol/controller_state.py", line 202, in button_push await controller_state.send() File "/home/benji/joycontrol/joycontrol/controller_state.py", line 59, in send await self._protocol.send_controller_state() File "/home/benji/joycontrol/joycontrol/protocol.py", line 61, in send_controller_state raise NotConnectedError('Transport not registered.') joycontrol.transport.NotConnectedError: Transport not registered.

@mateuspestana

This comment has been minimized.

Copy link

@mateuspestana mateuspestana commented May 4, 2020

Thanks for this! Working perfectly on a RaspberryPi Zero W, on Raspbian.

@chiefx2

This comment has been minimized.

Copy link

@chiefx2 chiefx2 commented May 5, 2020

I got all the way to the end. I can push the .bin and the switch detects and starts the registration process but after I select a Mii and give it a name, the registration process fails. It keeps on saying that Registration Failed. I have tried different .bin files. The game is breath of the wild.

@moonlight-SYY

This comment has been minimized.

Copy link

@moonlight-SYY moonlight-SYY commented May 6, 2020

I seem to be having a similar (or same issue) as @Snoower. I have a little more information to provide; assuming we have the same issue, this should make it a bit easier to solve.

Attempt #1: Connect as normal, adding real joycons as second controller, enter commands from terminal.
Result:
cmd >> a [19:17:17] joycontrol.transport write::155 ERROR - [Errno 104] Connection reset by peer [19:17:17] joycontrol.protocol connection_lost::117 ERROR - Connection lost. [19:17:17] joycontrol.protocol input_report_mode_full::209 ERROR - [Errno 104] Connection reset by peer [19:17:17] __main__ _main::206 INFO - Stopping communication... Traceback (most recent call last): File "./run_controller_cli.py", line 230, in <module> _main(args) File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete return future.result() File "./run_controller_cli.py", line 204, in _main await cli.run() File "/home/yuehyying/joycontrol/joycontrol/command_line_interface.py", line 190, in run await button_push(self.controller_state, *buttons_to_push) File "/home/yuehyying/joycontrol/joycontrol/controller_state.py", line 197, in button_push await controller_state.send() File "/home/yuehyying/joycontrol/joycontrol/controller_state.py", line 62, in send await self._protocol.send_controller_state() File "/home/yuehyying/joycontrol/joycontrol/protocol.py", line 68, in send_controller_state await self._controller_state_sender joycontrol.transport.NotConnectedError
Attempt #2, "A" button pressed on real joycons instead:
`[19:20:28] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SET_PLAYER_LIGHTS
[19:20:32] joycontrol.transport write::155 ERROR - [Errno 104] Connection reset by peer
[19:20:32] joycontrol.protocol connection_lost::117 ERROR - Connection lost.
[19:20:32] joycontrol.protocol input_report_mode_full::209 ERROR - [Errno 104] Connection reset by peer
[19:20:32] joycontrol.transport write::155 ERROR - [Errno 9] Bad file descriptor
[19:20:32] asyncio default_exception_handler::1285 ERROR - Task exception was never retrieved
future: <Task finished coro=<_send_empty_input_reports() done, defined at /home/yuehyying/joycontrol/joycontrol/server.py:17> exception=NotConnectedError(OSError(9, 'Bad file descriptor'),)>
Traceback (most recent call last):
File "/home/yuehyying/joycontrol/joycontrol/transport.py", line 153, in write
await self._loop.sock_sendall(self._itr_sock, _bytes)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 406, in _sock_sendall
n = sock.send(data)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/yuehyying/joycontrol/joycontrol/server.py", line 20, in _send_empty_input_reports
await transport.write(report)
File "/home/yuehyying/joycontrol/joycontrol/transport.py", line 157, in write
raise NotConnectedError(err)
joycontrol.transport.NotConnectedError: [Errno 9] Bad file descriptor
^CTraceback (most recent call last):
File "./run_controller_cli.py", line 230, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
self.run_forever()
File "/usr/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
self._run_once()
File "/usr/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
yuehyying@syy-VirtualBox:/joycontrol$ sudo python3 ./run_controller_cli.py PRO_CONTROLLER
[19:25:29] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[19:25:29] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[19:25:30] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[19:25:30] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[19:25:30] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.
^CTraceback (most recent call last):
File "./run_controller_cli.py", line 230, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
self.run_forever()
File "/usr/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
self._run_once()
File "/usr/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
yuehyying@syy-VirtualBox:
/joycontrol$ sudo python3 ./run_controller_cli.py PRO_CONTROLLER
[19:25:52] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[19:25:52] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[19:25:52] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[19:25:52] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[19:25:52] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.
^[[A^[[B^CTraceback (most recent call last):
File "./run_controller_cli.py", line 230, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
self.run_forever()
File "/usr/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
self._run_once()
File "/usr/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.6/selectors.py", line 445, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt
`

Attempting to connect directly to the switch via MAC address either hangs or yields a "connection refused" error (can't tell what causes each). Interestingly, the MAC address provided under the Switch's settings always yields error #112 (Host is down). Using the address found under bluetooth settings on my computer yields "connection refused".

Hopefully this can help!

@bloodwar

This comment has been minimized.

Copy link

@bloodwar bloodwar commented May 7, 2020

Works perfect on the raspberry pi 4!

@A-Random-Birb

This comment has been minimized.

Copy link

@A-Random-Birb A-Random-Birb commented May 7, 2020

I've done everything correctly, but I'm still stuck at the open grip section, any ideas?

@carrotcn

This comment has been minimized.

Copy link

@carrotcn carrotcn commented May 7, 2020

I am able to send button events but not amiibo.Loading the .bin file seems successful however switch does not seem to recognize it..

@chiefx2

This comment has been minimized.

Copy link

@chiefx2 chiefx2 commented May 7, 2020

I am using Ubuntu 20. Maybe that’s the problem? I’ll give raspbian a go and come back and pot an update.

@junhyung2389

This comment has been minimized.

Copy link

@junhyung2389 junhyung2389 commented May 8, 2020

ubuntu@ubuntu:~$ cd /joycontrol
ubuntu@ubuntu:
/joycontrol$ sudo python3 ./run_controller_cli.py PRO_CONTROLLER
Traceback (most recent call last):
File "./run_controller_cli.py", line 8, in
from aioconsole import ainput
ModuleNotFoundError: No module named 'aioconsole'

error :<

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 8, 2020

One of the lines in setup is this:

sudo pip3 install hid aioconsole crc8 dbus-python

It should have taken care of that issue. Please try re-running the commands in the setup section and make sure they complete successfully.

@junhyung2389

This comment has been minimized.

Copy link

@junhyung2389 junhyung2389 commented May 8, 2020

ubuntu@ubuntu:~$ sudo apt-get install -qy git python3-pip libglib2.0-dev libhidapi-hidraw0 libhidapi-libusb0 libdbus-1-dev
Reading package lists...
Building dependency tree...
Reading state information...
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pip' has no installation candidate
E: Unable to locate package libhidapi-hidraw0
E: Unable to locate package libhidapi-libusb0
ubuntu@ubuntu:~$ sudo pip3 install hid aioconsole crc8 dbus-python
sudo: pip3: command not found

It does not work either

@chiefx2

This comment has been minimized.

Copy link

@chiefx2 chiefx2 commented May 8, 2020

You need to add this repository

sudo add-apt-repository universe

Then do the update

sudo apt update

@junhyung2389

This comment has been minimized.

Copy link

@junhyung2389 junhyung2389 commented May 8, 2020

It worked perfectly in animal crossing! Thank you so much. But it does not work in BOTW unfortunately.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 8, 2020

I have gotten it to work with Lucky in AC, and with several things in BOTW. However, I was unable to get the WOLF.bin to work with BOTW. Not sure why, it just didn't seem to recognize it.

@smthless

This comment has been minimized.

Copy link

@smthless smthless commented May 8, 2020

I got all the way to the end. I can push the .bin and the switch detects and starts the registration process but after I select a Mii and give it a name, the registration process fails. It keeps on saying that Registration Failed. I have tried different .bin files. The game is breath of the wild.

Hi! Did you manage to get past "registration fail"?

@LookingForACVillagers

This comment has been minimized.

Copy link

@LookingForACVillagers LookingForACVillagers commented May 8, 2020

I am struggling to get it to work on my end. Once I get to the "Change Grip" screen, leaving the screen boots it out. I even tried the Bluez stuff and still got an error. (Had to take a picture rather than copy paste it, so sorry if something is missing. If it is, I'll try to find it upon request)

IMG_4901

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 8, 2020

@LookingForACVillagers Hm. Did you boot into Linux, or is this a VM? Seems like people have issues with certain BT adapters + VM. If you're not in a VM, I'm actually pretty surprised...

@moonaker

This comment has been minimized.

Copy link

@moonaker moonaker commented May 9, 2020

... Seems like people have issues with certain BT adapters + VM. If you're not in a VM, I'm actually pretty _surprised..

I've had the same or similar issue as @Snoower and @LookingForACVillagers and @moonlight-SYY. Disconnects with any input command or key press on the controller, despite booting up Xubuntu by USB.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 9, 2020

It seems there might be some fundamental BT incompatibility. Recently in Discord... someone that was booting Linux was having issues, tried a new Bluetooth adapter and now has gotten it to work.

@sirensong-git

This comment has been minimized.

Copy link

@sirensong-git sirensong-git commented May 9, 2020

Has anybody else had this errors?
[15:07:36] joycontrol.server create_hid_server::58 WARNING - [Errno 98] Address already in use
[15:07:36] joycontrol.server create_hid_server::60 WARNING - Fallback: Restarting bluetooth due to incompatibilities with the bluez "input" plugin. Disable the plugin to avoid issues. See mart1nro/joycontrol#8.
[15:07:36] joycontrol.server create_hid_server::65 INFO - Restarting bluetooth service...
[15:07:36] joycontrol.utils run_system_command::75 DEBUG - ['systemctl restart bluetooth.service' exited with 0]
[15:07:37] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[15:07:37] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[15:07:37] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[15:07:37] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[15:07:37] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.
I've already restarted bluetooth services through terminal, I only get these after i fix the bluez commands.

@LookingForACVillagers

This comment has been minimized.

Copy link

@LookingForACVillagers LookingForACVillagers commented May 9, 2020

@sirensong-git For context, where does this error occur?

@sirensong-git

This comment has been minimized.

Copy link

@sirensong-git sirensong-git commented May 9, 2020

@LookingForACVillagers I’m not really sure, I tried the “sudo python3 ./run_controller_cli.py PRO_CONTROLLER” command and got stuck on “open change grip/controller menu”. Then I went and did all of the steps under “bluez input plugin workaround, after that I tried starting joycontrol again with the same way I had at the beginning, which this second time shows the two warnings listed near the top of my comment.

@sirensong-git

This comment has been minimized.

Copy link

@sirensong-git sirensong-git commented May 9, 2020

Do I have to do anything other than open the change grip/order menu on the switch? Is the a "sync" command I'm missing?

@carrotcn

This comment has been minimized.

Copy link

@carrotcn carrotcn commented May 9, 2020

@sirensong-git the symptom of yours is actually similar to one of my failed attempt with Ubuntu 20 inside of a VM. After that I switched to the RPi Zero setup (which is a native Raspbian OS) and it started to work.

@scoobydeezy

This comment has been minimized.

Copy link

@scoobydeezy scoobydeezy commented May 12, 2020

I'm getting this error when attempting to run the joycontrol program on my Raspberri Pi:

pi@magicmirror:~/joycontrol $ sudo python3 ./run_controller_cli.py PRO_CONTROLLER
Traceback (most recent call last):
  File "./run_controller_cli.py", line 10, in <module>
    from joycontrol import logging_default as log, utils
  File "/home/pi/joycontrol/joycontrol/logging_default.py", line 31
    name_of_file = today.strftime(f'%Y-%m-%d_%H-%M_{logfile_name}.log')
                                                                     ^
SyntaxError: invalid syntax
@scoobydeezy

This comment has been minimized.

Copy link

@scoobydeezy scoobydeezy commented May 12, 2020

Found the error. My version of python3 was 3.5 - the f string syntax was introduced in Python 3.6, resulting in the syntax error reported above.
Also worth noting to anyone else installing Python 3.6 that bluetooth.h is not included by default, and libbluetooth-dev must be installed prior to building your version of Python.

@haozyuan

This comment has been minimized.

Copy link

@haozyuan haozyuan commented May 13, 2020

I have some error:
Traceback (most recent call last):
File "./run_controller_cli.py", line 231, in
loop.run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 163, in _main
transport, protocol = await create_hid_server(factory, reconnect_bt_addr=args.reconnect_bt_addr,
File "/home/haozyuan/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.8/socket.py", line 231, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

@asktheeightball

This comment has been minimized.

Copy link

@asktheeightball asktheeightball commented May 13, 2020

Awesome work! I couldn't get this working with virtualbox however it does work on a raspberry pi zero w. That said the only way to load amiibos at harvey's in AC is to send the amiibo, then send b and down. Otherwise nothing happens. Any idea why?

@shamash89

This comment has been minimized.

Copy link

@shamash89 shamash89 commented May 14, 2020

I connect to the controller, but then in AC I keep getting "Failed to read amiibo" spamming amiibo /home/jordan/pietro.bin

@shamash89

This comment has been minimized.

Copy link

@shamash89 shamash89 commented May 14, 2020

After quite some time I figured out the issue with Amiibo. If you do ANYTHING on your real joycon, the Amiibo will be cleared. Get to where you need to be on the game, do the "amiibo" command, then use console to hit "a a a" etc until it's read.

@ghostsonz

This comment has been minimized.

Copy link

@ghostsonz ghostsonz commented May 14, 2020

I have some error:
Traceback (most recent call last):
File "./run_controller_cli.py", line 231, in
loop.run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 163, in _main
transport, protocol = await create_hid_server(factory, reconnect_bt_addr=args.reconnect_bt_addr,
File "/home/haozyuan/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.8/socket.py", line 231, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

I have the same problem

@leoleoasd

This comment has been minimized.

Copy link

@leoleoasd leoleoasd commented May 15, 2020

Anyone got this working under ubuntu inside Parallels Desktop?

@vlenav

This comment has been minimized.

Copy link

@vlenav vlenav commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol

same problem here~

@Ruoruo-0v0

This comment has been minimized.

Copy link

@Ruoruo-0v0 Ruoruo-0v0 commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol

also same problem...

@pacamara-1024

This comment has been minimized.

Copy link

@pacamara-1024 pacamara-1024 commented May 15, 2020

Traceback (most recent call last):
File "./run_controller_cli.py", line 231, in
loop.run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 163, in _main
transport, protocol = await create_hid_server(factory, reconnect_bt_addr=args.reconnect_bt_addr,
File "/home/zhangwh/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.8/socket.py", line 231, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

Same problem here

@shamash89

This comment has been minimized.

Copy link

@shamash89 shamash89 commented May 15, 2020

Anyone got this working under ubuntu inside Parallels Desktop?

I didn't try parallels but did it on the free version of VMware.

@huandrew99

This comment has been minimized.

Copy link

@huandrew99 huandrew99 commented May 15, 2020

Traceback (most recent call last):
File "./run_controller_cli.py", line 232, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 166, in _main
device_id=args.device_id)
File "/home/huandrew/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.6/socket.py", line 144, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

Same problem here!! Does anyone encountered this before?

@suq87739918

This comment has been minimized.

Copy link

@suq87739918 suq87739918 commented May 15, 2020

~/joycontrol$ sudo python3 ./run_controller_cli.py PRO_CONTROLLER
[sudo] password for suq19991211:
Traceback (most recent call last):
File "./run_controller_cli.py", line 232, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 166, in _main
device_id=args.device_id)
File "/home/suq19991211/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.6/socket.py", line 144, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol

Hmmm.......how can I solve this.......

@mn8928

This comment has been minimized.

Copy link

@mn8928 mn8928 commented May 15, 2020

same here, OSError: [Errno 97] Address family not supported by protocol

@iris-wang-22

This comment has been minimized.

Copy link

@iris-wang-22 iris-wang-22 commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol

Same problem......

@Cartman84

This comment has been minimized.

Copy link

@Cartman84 Cartman84 commented May 15, 2020

I'm able to connect to the Switch either using xubuntu 20.04 in VMWare or natively. However, both options fail to fully connect to the Switch when it comes to this step:

[10:04:52] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SET_PLAYER_LIGHTS

After this command, the Switch still shows that a controller is connected, however the Script freezes and does not proceed anymore.

Any ideas?

/edit: meanwhile I also tested witch Ubuntu 19.10 as well as on my RPi4 with Raspbian. Also there I stuck at this SET_PLAYER_LIGHTS command.

@formftur

This comment has been minimized.

Copy link

@formftur formftur commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol

Same here

@qtm001

This comment has been minimized.

Copy link

@qtm001 qtm001 commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol
can anyone solve this?

@ggmyfrind

This comment has been minimized.

Copy link

@ggmyfrind ggmyfrind commented May 15, 2020

OSError: [Errno 97] Address family not supported by protocol

Same here

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 15, 2020

You can't use WSL, in case anyone is trying that.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 15, 2020

@Cartman84, are you sure it froze? Please check the directions, after it connects you just press enter to get the >>> prompt where you can then type buttons or the amiibo command.

@GiveMeSix

This comment has been minimized.

Copy link

@GiveMeSix GiveMeSix commented May 15, 2020

[01:39:28] joycontrol.server create_hid_server::58 WARNING - [Errno 98] Address already in use
[01:39:28] joycontrol.server create_hid_server::60 WARNING - Fallback: Restarting bluetooth due to incompatibilities with the bluez "input" plugin. Disable the plugin to avoid issues. See mart1nro/joycontrol#8.
[01:39:28] joycontrol.server create_hid_server::65 INFO - Restarting bluetooth service...
[01:39:34] joycontrol.utils run_system_command::75 DEBUG - ['systemctl restart bluetooth.service' exited with 0]
Traceback (most recent call last):
File "/home/six/joycontrol/joycontrol/server.py", line 55, in create_hid_server
ctl_sock.bind((hid.address, ctl_psm))
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./run_controller_cli.py", line 231, in
loop.run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 163, in _main
transport, protocol = await create_hid_server(factory, reconnect_bt_addr=args.reconnect_bt_addr,
File "/home/six/joycontrol/joycontrol/server.py", line 71, in create_hid_server
ctl_sock.bind((socket.BDADDR_ANY, ctl_psm))
OSError: [Errno 98] Address already in use

@Cartman84

This comment has been minimized.

Copy link

@Cartman84 Cartman84 commented May 15, 2020

@colemickens omg thanks. Sometimes it is that easy. Pressing Enter solved it. Thank you!

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 15, 2020

@GiveMeSix refresh the guide, I just added a troubleshooting section and a new entry just for that error

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 15, 2020

@Cartman84 sweet! happy to hear it.

@Ruoruo-0v0

This comment has been minimized.

Copy link

@Ruoruo-0v0 Ruoruo-0v0 commented May 15, 2020

Hi, I did the workaround in #8 and I am still stuck at the Please open the "Change Grip/Order" menu. I used VMware for win10 to run a ubuntu linux machine.

[11:55:09] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[11:55:09] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[11:55:09] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[11:55:09] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[11:55:09] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.

Would this be the same problem described in #20? Or is this due to other problems... Thanks!!

@Ruoruo-0v0

This comment has been minimized.

Copy link

@Ruoruo-0v0 Ruoruo-0v0 commented May 15, 2020

Hi, I did the workaround in #8 and I am still stuck at the Please open the "Change Grip/Order" menu. I used VMware for win10 to run a ubuntu linux machine.

[11:55:09] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[11:55:09] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[11:55:09] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[11:55:09] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[11:55:09] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.

Would this be the same problem described in #20? Or is this due to other problems... Thanks!!

Sorry I forgot to mention... I did use my phone to detect bluetooth advice and did not find any device called pro controller. I only found one DESKTOP-4NRTE60... I assume the name was not changed successfully? Not sure what to do...

@formftur

This comment has been minimized.

Copy link

@formftur formftur commented May 15, 2020

Running Linux

After sending cmd>> home, it gets disconnected.

It worked once yesterday after several attempts and I invited a villager successfully. Tried it today and did not work. Automatically disconnected after sending one command. But I guess it has nothing to do with the bluetooth or me touching joycon.

I am so confused.

@SylvanWang

This comment has been minimized.

Copy link

@SylvanWang SylvanWang commented May 15, 2020

@colemickens Thank you so much! Working well on my VM. I got a question, is it possible to do long press? Like in Mario Odyssey, you need to long press right button to load amiibo. I read the output of 'help' and see no related command.

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 16, 2020

Ooh! Interesting question @SylvanWang. You might open an issue on joycontrol to ask about it. If I had to guess, it might not have support, but seems like something that could potentially be hacked quickly.

@irvinalcaraz

This comment has been minimized.

Copy link

@irvinalcaraz irvinalcaraz commented May 16, 2020

Worked great on a Raspberry Pi 3 B+. Thanks!

@GuilhermeBarizon

This comment has been minimized.

Copy link

@GuilhermeBarizon GuilhermeBarizon commented May 16, 2020

Is there anyway to use two buttons at the same time , on splatoon for instance you need to press both Zl an Zr to open the game

@jxWho

This comment has been minimized.

Copy link

@jxWho jxWho commented May 17, 2020

Anyone got this working under ubuntu inside Parallels Desktop?

I didn't try parallels but did it on the free version of VMware.

VMware for MacOS? I just tried but couldn't connect to Switch.

@vicyoung I think it doesn't work for mac os.

@Kevin-happy

This comment has been minimized.

Copy link

@Kevin-happy Kevin-happy commented May 17, 2020

Traceback (most recent call last):
File "./run_controller_cli.py", line 267, in
loop.run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 182, in _main
transport, protocol = await create_hid_server(factory, reconnect_bt_addr=args.reconnect_bt_addr,
File "/home/kevin/joycontrol/joycontrol/server.py", line 45, in create_hid_server
ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP)
File "/usr/lib/python3.8/socket.py", line 231, in init
_socket.socket.init(self, family, type, proto, fileno)
OSError: [Errno 97] Address family not supported by protocol
same here

@carrotcn

This comment has been minimized.

Copy link

@carrotcn carrotcn commented May 17, 2020

@colemickens Thank you so much! Working well on my VM. I got a question, is it possible to do long press? Like in Mario Odyssey, you need to long press right button to load amiibo. I read the output of 'help' and see no related command.

It is possible but you need to write your own code to invoke the lower level method of the joycontrol library. Check controller_state.py and you will find this class method: async def button_push(controller_state, *buttons, sec=0.1). So by default all button presses last for 0.1 second. You can simply pass in the sec value of your own to override the default value.

@carrotcn

This comment has been minimized.

Copy link

@carrotcn carrotcn commented May 17, 2020

Is there anyway to use two buttons at the same time , on splatoon for instance you need to press both Zl an Zr to open the game

the command line interface does not support that but the joycontrol library actually provided hint on how to achieve that. class method "button_push" in controller_state.py accepts a list of buttons to be pressed at the same time. But you will have to write your own code to call that method.

@Kris69w

This comment has been minimized.

Copy link

@Kris69w Kris69w commented May 18, 2020

Running Linux

After sending cmd>> home, it gets disconnected.

It worked once yesterday after several attempts and I invited a villager successfully. Tried it today and did not work. Automatically disconnected after sending one command. But I guess it has nothing to do with the bluetooth or me touching joycon.

I am so confused.

Was having the same issue. Worked once and stopped working ever since. After a few testing I find this happens on intel BT while Broadcom BT is much stabler....

@Kevin-happy

This comment has been minimized.

Copy link

@Kevin-happy Kevin-happy commented May 19, 2020

[22:35:39] joycontrol.device set_name::69 INFO - setting device name to Pro Controller...
[22:35:39] joycontrol.device set_class::61 INFO - setting device class to 0x002508...
[22:35:39] joycontrol.utils run_system_command::75 DEBUG - ['hciconfig hci0 class 0x002508' exited with 0]
[22:35:39] joycontrol.server create_hid_server::84 INFO - Advertising the Bluetooth SDP record...
[22:35:39] joycontrol.server create_hid_server::94 INFO - Waiting for Switch to connect... Please open the "Change Grip/Order" menu.
Would this be the same problem described in #20? Or is this due to other problems... Thanks!!

@DanteDraconi

This comment has been minimized.

Copy link

@DanteDraconi DanteDraconi commented May 19, 2020

Reading how people have been trying different adapters... What are the ones that would be recommended? Or it just causes problems with internal laptop BT?

@realLyans

This comment has been minimized.

Copy link

@realLyans realLyans commented May 19, 2020

I just hanged on change grip/order menu indefinitely...
Does it have anything to do with Switch language? Or it is just laptop bluetooth is too weak?

@JefferyW

This comment has been minimized.

Copy link

@JefferyW JefferyW commented May 19, 2020

I always get the error 104, how can i do?

@richardnseven

This comment has been minimized.

Copy link

@richardnseven richardnseven commented May 19, 2020

Every time the process will stop at subCommand.SET_NFC_IR_MCU_STATE. How can I fix it??

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 19, 2020

@richardnseven as the instructions say, just press enter...

@AlftheElf

This comment has been minimized.

Copy link

@AlftheElf AlftheElf commented May 20, 2020

I can verify, Pi 3 with raspbian worked with no issues whatsoever. 🦄

@QingzhouLi

This comment has been minimized.

Copy link

@QingzhouLi QingzhouLi commented May 20, 2020

I also met the error Connection reset by peer.

I tried on two different PC to connect the same console, but both failed with the same error.

Not sure if it's my NS issue. Did Nintendo also upgrade their bluetooth adapter when they improved the battery performance? I bought my NS console in 2017.

@ymanhei

This comment has been minimized.

Copy link

@ymanhei ymanhei commented May 20, 2020

I am also a victim of the error Connection reset by peer.
It didn't work on my 2 laptops with switch and switch lite in my experiments.

@GuilhermeBarizon

This comment has been minimized.

Copy link

@GuilhermeBarizon GuilhermeBarizon commented May 20, 2020

Anyone has any idea on how to fix the no amiibo loaded spam screen ?

@ymanhei

This comment has been minimized.

Copy link

@ymanhei ymanhei commented May 21, 2020

For the error Connection reset by peer when leaving the change/grip screen, avoid using internal bluetooth adapter. I plugged in an USB BT adapter, forwarded it in virtualbox, and it worked.

@sslesar

This comment has been minimized.

Copy link

@sslesar sslesar commented May 21, 2020

Any idea of how to turn on BT with WLS (ubuntu). I just installed Windows Linux Subsystem and installed Ubuntu.
WindowsTerminal_rP8yym2kIi

@colemickens

This comment has been minimized.

Copy link
Owner Author

@colemickens colemickens commented May 21, 2020

@sslesar from the guide: "WSL is not an option. WSL2 is not an option. If you're asking, Docker will almost guaranteedly not help you either."

@ArtemisOfLegend

This comment has been minimized.

Copy link

@ArtemisOfLegend ArtemisOfLegend commented May 22, 2020

Hi guys, i did everything right and it worked. Today I tried again and I got this message : reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.bluez.Error.Blocked: Blocked through rfkill :( any advice?

@AlftheElf

This comment has been minimized.

Copy link

@AlftheElf AlftheElf commented May 22, 2020

@ArtemisOfLegend I had this error, Bluetooth wasn’t enabled. Have you manually enabled it?

@ArtemisOfLegend

This comment has been minimized.

Copy link

@ArtemisOfLegend ArtemisOfLegend commented May 22, 2020

@AlftheElf
Many thanks, that was the problem.
I did not look at it since bluetooth desactovated by itself and I did not expect that. Thanks ♡

@ArtemisOfLegend

This comment has been minimized.

Copy link

@ArtemisOfLegend ArtemisOfLegend commented May 22, 2020

Hello guys,
I followed every step and I reached the point when I can control my switch with Linux. However, I tried to enter severals Amiibo files and I always get this error message : joycontrol.ir_nfc_mcu update_nfc_report::114 INFO - nfc content is none
The file I''m using seems to work for othe rpeople so I don't understand. If anyone have an idea... Many thanks :)
Your work is incredible

@ymanhei

This comment has been minimized.

Copy link

@ymanhei ymanhei commented May 23, 2020

Hello guys,
I followed every step and I reached the point when I can control my switch with Linux. However, I tried to enter severals Amiibo files and I always get this error message : joycontrol.ir_nfc_mcu update_nfc_report::114 INFO - nfc content is none
The file I''m using seems to work for othe rpeople so I don't understand. If anyone have an idea... Many thanks :)
Your work is incredible

execute amiibo command before you execute 'a' to confirm reading amiibo in the game.

@ArtemisOfLegend

This comment has been minimized.

Copy link

@ArtemisOfLegend ArtemisOfLegend commented May 23, 2020

Splatoon 2 is asking le to register an owner and nickname to the amiibo, and for this it ask me ti hold the amiibo to the NFC touchpoint, but the registration always failed. Anyone had this problem aswell? Thanks guys

@yangcrazy30

This comment has been minimized.

Copy link

@yangcrazy30 yangcrazy30 commented May 23, 2020

I am using Ubuntu 20. Maybe that’s the problem? I’ll give raspbian a go and come back and pot an update.

when i am using ubuntu 20.i am suck at change grip/control,xbuntu 20 hava same problem.but when i use ubuntu 18.04.4 everything is ok.maybe you can try ubuntu 18.04

@Zolters

This comment has been minimized.

Copy link

@Zolters Zolters commented May 24, 2020

Splatoon 2 is asking le to register an owner and nickname to the amiibo, and for this it ask me ti hold the amiibo to the NFC touchpoint, but the registration always failed. Anyone had this problem aswell? Thanks guys

I have the same problem! I think everyone doesn't work either! Does anyone know a solution? Help pls!

@AirRambler

This comment has been minimized.

Copy link

@AirRambler AirRambler commented May 28, 2020

My own solution to 104:
After the connection (with the icon), enter the search (next to the return bottom), click the handle just connected, and the connection will be stable.
I succeeded in disconnecting and reconnecting three times in a row.

@QingzhouLi

This comment has been minimized.

Copy link

@QingzhouLi QingzhouLi commented May 29, 2020

I also met the error Connection reset by peer.

I tried on two different PC to connect the same console, but both failed with the same error.

Not sure if it's my NS issue. Did Nintendo also upgrade their bluetooth adapter when they improved the battery performance? I bought my NS console in 2017.

According to @ymanhei, I bought a USB Bluetooth Adapter and this time it's working!!! The connection is stable and perfect!!!

Thank you all. Hope my experience can help you.

@AlejandroArC

This comment has been minimized.

Copy link

@AlejandroArC AlejandroArC commented May 30, 2020

I have a error when I use sudo python3 ./run_controller_cli.py PRO_CONTROLLER

Captura de pantalla de 2020-05-30 02-30-07

@AirRambler

This comment has been minimized.

Copy link

@AirRambler AirRambler commented May 30, 2020

I also met the error Connection reset by peer.

I tried on two different PC to connect the same console, but both failed with the same error.

Not sure if it's my NS issue. Did Nintendo also upgrade their bluetooth adapter when they improved the battery performance? I bought my NS console in 2017.

According to @ymanhei, I bought a USB Bluetooth Adapter and this time it's working!!! The connection is stable and perfect!!!

Thank you all. Hope my experience can help you.

Yesterday, I tried again and found that my previous method failed again.
So I came up with a new idea, which is to "remove the handle" as the author said.
But I only removed the right handle.
And my computer will never connect the first time it runs the virtual Box.

@Just1nGao

This comment has been minimized.

Copy link

@Just1nGao Just1nGao commented May 31, 2020

When I send a, it will disconnect. Who can help me pls!!
cmd >> home
cmd >> a
[02:53:43] joycontrol.transport write::155 ERROR - [Errno 104] Connection reset by peer
[02:53:43] joycontrol.protocol connection_lost::117 ERROR - Connection lost.
[02:53:43] joycontrol.protocol input_report_mode_full::209 ERROR - [Errno 104] Connection reset by peer
[02:53:43] main _main::244 INFO - Stopping communication...
Traceback (most recent call last):
File "./run_controller_cli.py", line 268, in
_main(args)
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "./run_controller_cli.py", line 242, in _main
await cli.run()
File "/home/justin/joycontrol/joycontrol/command_line_interface.py", line 190, in run
await button_push(self.controller_state, *buttons_to_push)
File "/home/justin/joycontrol/joycontrol/controller_state.py", line 201, in button_push
await controller_state.send()
File "/home/justin/joycontrol/joycontrol/controller_state.py", line 66, in send
await self._protocol.send_controller_state()
File "/home/justin/joycontrol/joycontrol/protocol.py", line 68, in send_controller_state
await self._controller_state_sender
joycontrol.transport.NotConnectedError

@Zolters

This comment has been minimized.

Copy link

@Zolters Zolters commented Jun 8, 2020

Splatoon 2 is asking le to register an owner and nickname to the amiibo, and for this it ask me ti hold the amiibo to the NFC touchpoint, but the registration always failed.
help me please!

@RaphaelDBS20

This comment has been minimized.

Copy link

@RaphaelDBS20 RaphaelDBS20 commented Jun 8, 2020

Can we get banned from Nintendo Switch Online using this?

@chiefx2

This comment has been minimized.

Copy link

@chiefx2 chiefx2 commented Jun 8, 2020

Zolters - you don’t need to register the Amiibo. It will work in game without registering, if the image is going to work at all.

@adeng1919

This comment has been minimized.

Copy link

@adeng1919 adeng1919 commented Jun 9, 2020

Can we get banned from Nintendo Switch Online using this?

Why? This use real amiibo data

@RaphaelDBS20

This comment has been minimized.

Copy link

@RaphaelDBS20 RaphaelDBS20 commented Jun 9, 2020

Idk

@GuilhermeBarizon

This comment has been minimized.

Copy link

@GuilhermeBarizon GuilhermeBarizon commented Jun 9, 2020

@DarkAngel7

This comment has been minimized.

Copy link

@DarkAngel7 DarkAngel7 commented Jun 13, 2020

Anyone got this working under ubuntu inside Parallels Desktop?

I didn't try parallels but did it on the free version of VMware.

VMware for MacOS? I just tried but couldn't connect to Switch.

@vicyoung I think it doesn't work for mac os.

Well, there is a way to get this work under ubuntu inside Parallels Desktop on Mac OS.
Just buy a USB Bluetooth Adapter which supports Mac OS.
Using External Bluetooth Adapter to emulate a Nintendo Switch Joycon or amibo will get this work, enjoy it.

@aheph

This comment has been minimized.

Copy link

@aheph aheph commented Jun 13, 2020

I can connect to the Switch but when I do the amiibo command it says "failed to read amiibo". Anyone able to help?

@av332

This comment has been minimized.

Copy link

@av332 av332 commented Jun 13, 2020

I can connect to the Switch but when I do the amiibo command it says "failed to read amiibo". Anyone able to help?

I'm not sure if I got the same issue as yours, I tried to paste "nfc /home/xubuntu/Downloads/backup-of-my-amiibo.bin" when I do the amiibo command since the terminal hinted me that "use nfc instead of amiibo"

hope this could help you and the friends that might have the same issue.

@daweze

This comment has been minimized.

Copy link

@daweze daweze commented Jun 26, 2020

This great work and love what you are doing here. i do have a question what is the syntax for reconnect?? everything works great but i have to hit the change grip menu every time. i am on a RPI 3b+ running rasb OS. this is what i get but i have zero'd my mac for obvious reasons

pi@raspberrypi:~/joycontrol $ sudo python3 run_controller_cli.py PRO_CONTROLLER -r 00:00:00:00:00:00
[12:34:06] joycontrol.protocol connection_made::112 DEBUG - Connection established.
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.REQUEST_DEVICE_INFO
cmd >> [12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SET_SHIPMENT_STATE
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SET_INPUT_REPORT_MODE
[12:34:07] joycontrol.protocol set_reader::412 INFO - Setting input report mode to 0x30...
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.TRIGGER_BUTTONS_ELAPSED_TIME
[12:34:07] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:08] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:08] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:08] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:09] root _reply_to_sub_command::295 INFO - received output report - Sub command SubCommand.SPI_FLASH_READ
[12:34:09] joycontrol.transport read::105 ERROR - No data received.
[12:34:09] joycontrol.protocol connection_lost::117 ERROR - Connection lost.
[12:34:09] joycontrol.transport write::155 ERROR - [Errno 9] Bad file descriptor
[12:34:09] asyncio default_exception_handler::1608 ERROR - Task exception was never retrieved
future: <Task finished coro=<_send_empty_input_reports() done, defined at /home/pi/joycontrol/joycontrol/server.py:17> exception=NotConnectedError(OSError(9, 'Bad file descriptor'))>
Traceback (most recent call last):
File "/home/pi/joycontrol/joycontrol/transport.py", line 153, in write
await self._loop.sock_sendall(self._itr_sock, _bytes)
File "/usr/lib/python3.7/asyncio/selector_events.py", line 425, in sock_sendall
return await fut
File "/usr/lib/python3.7/asyncio/selector_events.py", line 434, in _sock_sendall
n = sock.send(data)
OSError: [Errno 9] Bad file descriptor

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/joycontrol/joycontrol/server.py", line 20, in _send_empty_input_reports
await transport.write(report)
File "/home/pi/joycontrol/joycontrol/transport.py", line 157, in write
raise NotConnectedError(err)
joycontrol.transport.NotConnectedError: [Errno 9] Bad file descriptor
^CTraceback (most recent call last):
File "run_controller_cli.py", line 278, in
_main(args)
File "/usr/lib/python3.7/asyncio/base_events.py", line 571, in run_until_complete
self.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)

@Sakurakawa

This comment has been minimized.

Copy link

@Sakurakawa Sakurakawa commented Jun 30, 2020

Nice! But It seems that the amiibo command is deprecated, I use nfc instead and it works for me

@HydroReaper666

This comment has been minimized.

Copy link

@HydroReaper666 HydroReaper666 commented Jul 13, 2020

i get to the very end where i find my .bin file but i dont know what i have to type into the command thing to get my vm to have the rite .bin file im already connected via Bluetooth and can control the game from the vm

@HydroReaper666

This comment has been minimized.

Copy link

@HydroReaper666 HydroReaper666 commented Jul 15, 2020

i have everything done rite im connected to the switch thats no problem but when i try to load my amiibo file it says nfc content none
saying i dont have the file yet i have tried multiple animal crossing .bin files but to no avail i cant get any working at all can someone please tell me whats wrong or what im doing wrong

@Sakurakawa

This comment has been minimized.

Copy link

@Sakurakawa Sakurakawa commented Jul 15, 2020

i have everything done rite im connected to the switch thats no problem but when i try to load my amiibo file it says nfc content none
saying i dont have the file yet i have tried multiple animal crossing .bin files but to no avail i cant get any working at all can someone please tell me whats wrong or what im doing wrong

What command you use to load the .bin file?

@HydroReaper666

This comment has been minimized.

Copy link

@HydroReaper666 HydroReaper666 commented Jul 15, 2020

@HydroReaper666

This comment has been minimized.

Copy link

@HydroReaper666 HydroReaper666 commented Jul 15, 2020

Has anyone got this to work for breath of the wild for some reason it wont work for me but animal crossing works perfect

@HydroReaper666

This comment has been minimized.

Copy link

@HydroReaper666 HydroReaper666 commented Jul 15, 2020

I am struggling to get it to work on my end. Once I get to the "Change Grip" screen, leaving the screen boots it out. I even tried the Bluez stuff and still got an error. (Had to take a picture rather than copy paste it, so sorry if something is missing. If it is, I'll try to find it upon request)

IMG_4901

yup type nfc before/home/xubuntu

@etienne-k

This comment has been minimized.

Copy link

@etienne-k etienne-k commented Jul 19, 2020

Worked for me too on a Raspberry Pi 3B+ with Ubuntu Server (had to apt install pi-bluetooth to enable Bluetooth) and Docker (bind-mounting the DBus socket).

Dockerfile:

FROM ubuntu

ARG DEBIAN_FRONTEND=noninteractive

RUN apt update
RUN apt install -y git python3-pip libglib2.0-dev libhidapi-hidraw0 libhidapi-libusb0 libdbus-1-dev bluez
RUN pip3 install hid aioconsole crc8 dbus-python

WORKDIR /opt/app
RUN git clone https://github.com/mart1nro/joycontrol
WORKDIR /opt/app/joycontrol
RUN echo '#!/bin/sh' > start.sh && \
	echo 'python3 ./run_controller_cli.py PRO_CONTROLLER' >> start.sh && \
	chmod 755 start.sh

Build and tag: docker build -t joycontrol .

Convenience script start-container.sh (replace /your/bin/directory accordingly) to start the container:

#!/bin/sh

docker run --rm --net=host --cap-add=SYS_ADMIN --cap-add=NET_ADMIN --cap-add=NET_BIND_SERVICE --privileged \
	--mount type=bind,source=/var/run/dbus,target=/var/run/dbus \
	--mount type=bind,source=/your/bin/directory,target=/opt/bin \
	-it joycontrol

And now, whenever I need to scan something:
Start the container: ./start-container.sh
And in the container: ./start.sh

When the time has come to push the bin file: nfc /opt/bin/yourfile.bin

It's nice, clean and easy to repeat. :)

@lucasdina

This comment has been minimized.

Copy link

@lucasdina lucasdina commented Aug 13, 2020

Doing this on OSX and I ran into a snag:
server.py", line 45, in create_hid_server ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP) AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
after running
sudo python3 ./run_controller_cli.py PRO_CONTROLLER
Is this related to permissions issues with iTerm or is it something else?

@lucasdina

This comment has been minimized.

Copy link

@lucasdina lucasdina commented Aug 13, 2020

Doing this on OSX and I ran into a snag:
server.py", line 45, in create_hid_server ctl_sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET, socket.BTPROTO_L2CAP) AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
after running
sudo python3 ./run_controller_cli.py PRO_CONTROLLER
Is this related to permissions issues with iTerm or is it something else?

After 2 minutes of the googling I should have done already, OSX doesn't support AF_BLUETOOTH. AF_BLUETOOTH is a linux only socket type.

@LarrysGIT

This comment has been minimized.

Copy link

@LarrysGIT LarrysGIT commented Aug 14, 2020

Confirmed works in Macbook pro 2015 15 inch boot from xubuntu USB live.

@lucasdina

This comment has been minimized.

Copy link

@lucasdina lucasdina commented Aug 14, 2020

Confirmed works in Macbook pro 2015 15 inch boot from xubuntu USB live.

I know the Macbook hardware supports it, I was curious about the OS. It's definitely possible on OSX but I don't have the time. Ended up using a Pi I had lying around.

@onesaucy

This comment has been minimized.

Copy link

@onesaucy onesaucy commented Aug 24, 2020

Hi,

whenever I run the run_controller_cli.py in the terminal, I get this error:

File "run_controller_cli.py", line 57
async def test_controller_buttons(controller_state: ControllerState):
^
SyntaxError: invalid syntax

does anyone know a fix? I'm using a RPi 3B+.

Thanks!

@onesaucy

This comment has been minimized.

Copy link

@onesaucy onesaucy commented Aug 24, 2020

I get the same error when running with Python3, just on a different line. This is the error i get when running Python3:

File "run_controller_cli.py", line 147
raise ValueError(f'Button {button} does not exist on {controller_state.get_controller()}')
^
SyntaxError: invalid syntax

@josemiranda96

This comment has been minimized.

Copy link

@josemiranda96 josemiranda96 commented Aug 27, 2020

Which USB Bluetooth adapter can be used?
I've seen 4.0 and 5.0

@zhangwei9046

This comment has been minimized.

Copy link

@zhangwei9046 zhangwei9046 commented Aug 28, 2020

I get "Command was removed - use "nfc" instead" when I paste amiibo command in the console. Any idea about this?

@zhangwei9046

This comment has been minimized.

Copy link

@zhangwei9046 zhangwei9046 commented Aug 28, 2020

I get "Command was removed - use "nfc" instead" when I paste amiibo command in the console. Any idea about this?

Worked after I replaced "amiibo" with "nfc".

@Victorzer

This comment has been minimized.

Copy link

@Victorzer Victorzer commented Sep 4, 2020

Mine gets stuck at "Please open the change Grip/Order menu" any ideas?

@kyokuheishin

This comment has been minimized.

Copy link

@kyokuheishin kyokuheishin commented Sep 5, 2020

Mine gets stuck at "Please open the change Grip/Order menu" any ideas?

Just wait for about 5 minutes.

@kyokuheishin

This comment has been minimized.

Copy link

@kyokuheishin kyokuheishin commented Sep 5, 2020

Sending NFC data has been removed from joycontrol, check this mart1nro/joycontrol#80

@Victorzer

This comment has been minimized.

Copy link

@Victorzer Victorzer commented Sep 5, 2020

Mine gets stuck at "Please open the change Grip/Order menu" any ideas?

Just wait for about 5 minutes.

I did! I waited many times, tried to rebooting, repeating the process, and still nothing seems to work. Do you think my Bluetooth adaptor could be the issue? The version of the Bluetooth is 2.0, maybe it's too old? And yes, i'm using the older commit with NFC support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.