raspberry-switch-control icon indicating copy to clipboard operation
raspberry-switch-control copied to clipboard

Unreliable Startup

Open Radiant-Xyz opened this issue 6 months ago • 3 comments

I've attempted to set this project up by following the README.md but can't seem to get controller inputs to actually be sent to a Switch. I've tried both the Switch and my Windows PC so far, the latter to see using the Game Controller settings if there are inputs coming through at all. They do sometimes and a popular piece of emulation software reads them just fine when they do. But I don't even get so far on a Switch console.

Here's my environment I'm trying to run this on:

  • Raspberry Pi 4B rev 1.1
  • Raspberry Pi OS 6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux
  • go version 1.24.4

I've tried to use the following controllers:

  • Xbox Series Controller
  • PlayStation 4 Controller
  • Nintendo Switch Pro Controller

I have attempted to run the program both on a remote Pi as well as on the same Pi (connecting nsfrontend using an ssh session to localhost). Both resulted in the following:

pi@raspberrypi4:~ $ nsfrontend -j /dev/input/js0 -o >(ssh pi@localhost ~/.local/share/go/bin/nsbackend)
nsfrontend started: Accepting command from stdin... (^D to finish)
nsbackend: Waiting for input... (^D to exit)
Opening /dev/hidg0...
Opened /dev/hidg0

When I got it working on my Windows machine there was a constant line of dots (.) so I am guessing that's what it should look like when it works. But no matter how often I try it on a Switch I never get these dots to show. Connected to a USB port on my Windows machine I get it pretty constantly to work by now on a fresh boot. But after quitting and restarting it won't work again until I reboot.

I've tried to enable the debug mode for the frontend and was able to see the controller inputs actually being read properly. When I had the debug mode enabled on the backend it also showed me the input and they were all translated to the Switch Pro Controller layout. So the connection between the controller and the Raspberry and the data sent from frontend to backend looks good.

Radiant-Xyz avatar Jun 20 '25 23:06 Radiant-Xyz

This was user error due to a lack of understanding of how the Switch (and Switch 2) treat controllers connected over USB. I will create a PR later to expand the README to include a section about changing the Switch settings to use Pro Controller over USB. Without this setting the Switch only attempts to pair the controller to then connect using Bluetooth, but it never communicates over USB at all.

By the way, the program works using the Switch 2 just fine and startup is completely reliable for me now as well!

Radiant-Xyz avatar Jul 21 '25 16:07 Radiant-Xyz

This was user error due to a lack of understanding of how the Switch (and Switch 2) treat controllers connected over USB. I will create a PR later to expand the README to include a section about changing the Switch settings to use Pro Controller over USB. Without this setting the Switch only attempts to pair the controller to then connect using Bluetooth, but it never communicates over USB at all.

By the way, the program works using the Switch 2 just fine and startup is completely reliable for me now as well!

Hello, I am attempting to do this on a Pi Zero 2W on my switch 2, but I cannot get it to be recognised in "Change Grip/Order". Can you outline the steps you used to get it working on switch 2? Thank you so much!

Lacept avatar Oct 23 '25 15:10 Lacept

Hi @Lacept, sorry for the late response. You have to enable the following setting: System Settings > Controllers & Accessories > Nintendo Switch Pro Controller Wired Communication

The connection should work afterwards. Let me know if this solved your issue as well!

Radiant-Xyz avatar Nov 09 '25 19:11 Radiant-Xyz