Skip to content

Dycool/NS-PC-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

545 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon

NS PC Control

Control your Switch or Switch 2 console from a PC (Windows, Linux, macOS) or through your browser/phone with low latency using a Raspberry Pi. 🎮

This project was built from scratch in C++ and uses UDP for low latency. It is designed for playing console games with your PC controller while avoiding the typical lag of Bluetooth or heavy script-based solutions.

👥 Up to 4 players simultaneously - Works with a single Raspberry Pi and a single PC.

⌨️ Keyboard Support - Desktop clients support keyboard controls, either by overriding P1 or by using the keyboard as one player.

🌐 Web App & Mobile Touch Controls - The server includes an embedded web interface with a desktop control panel and touch-optimized mobile gamepad, no client install needed.

🔄 Gyroscope and Rumble - PC clients with gyro-capable controllers (DS4, DualSense, compatible USB motion pads), Android and iOS can send motion data! Rumble is only supported on PC clients or controllers connected through the mobile apps.

⚙️ Macros - Create, record and share your own macros from any PC client!

Wake up your Switch 2 whenever you want to! Click here for more details.

🟢 Supports any Raspberry Pi with USB gadget!

Pre-compiled Binaries Available! You can download ready-to-use GUI/CLI clients and the Raspberry Pi server directly from the Releases page.

The web interface is included in the Raspberry Pi server binary - no additional files needed.

demo.mp4

🚀 Quick Start (Pre-compiled)

1. 🥧 Raspberry Pi (Server):

  • Download ns-pc-control-raspberry-pi.zip to your Pi:
wget https://github.com/Dycool/NS-PC-Control/releases/latest/download/ns-pc-control-raspberry-pi.zip
unzip ns-pc-control-raspberry-pi.zip
  • Enable USB gadget, check the Raspberry Pi setup for more details.
  • Start the backend: sudo chrt -f 99 ./ns-backend

2. 💻 PC / Mobile (Client):

  • Desktop — Download the zip for your OS (Windows, Mac, or Linux), launch ns-client, enter your Pi's IP.
  • Android — Download NS-mobile.apk from the release and install it.
  • iOS — Download NS-mobile.ipa from the release (sideload via iloader).
  • Up to 4 controllers are supported simultaneously on a single client.

Mobile clients do not support rumble with touch controls.

3. 🌐 Web App (Optional):

  • The backend includes an embedded web server with mobile touch controls.
  • Enable it with the -w flag: sudo chrt -f 99 ./ns-backend -w
  • Open http://<pi-ip>:8080 in your browser.
  • See the Web App Guide for details.

🎛️ Controller Emulation Modes

The Raspberry Pi server can emulate two different controller profiles:

Feature Hori Controllers Pro Controllers
HID report size 8 bytes 64 bytes
Latency Fastest Fast
Gyro No Yes
Rumble No Yes

Default mode is the pro controller. Use -hori if you have any issues with the other mode:

sudo chrt -f 99 ./ns-backend -hori

🎮 Controls & Shortcuts

Any SDL-compatible controller connected to your client is supported, so basically any controller on the market.

Action Shortcut
HOME Press GUIDE button, or L3 + R3 simultaneously
CAPTURE Press START + BACK simultaneously

These shortcuts can be disabled on the PC client.


📚 Documentation

Detailed guides and technical information are in the docs/ folder:


🔗 References

Components Sources
Desktop clients Qt6 Widgets / SDL3 Gamepad API / UDP sockets
Android client Kotlin + WebView / JNI C bridge / UDP sockets
iOS client Swift + WKWebView / C bridge / GameController / CoreMotion
Raspberry Pi server Linux USB Gadget (configfs / libcomposite) / UDP sockets
Cryptography HMAC-SHA256 (standalone C++ implementation)
Protocol Custom UDP-based protocol with magic/version/sequence number guards
Pro controller Emulation switch-auto-core by churunfa
Switch 2 Wake Setup Switch2-RPI-Wake by Bill-git1

🐛 Reporting Issues

Found a bug or have a feature request? Open an issue at github.com/Dycool/NS-PC-Control/issues with as much detail as possible (OS, controller model, reproduction steps).


📄 License

See the repository license for details.