Skip to content

Remote control for the Nintendo Switch via UDP or with a single computer

License

Notifications You must be signed in to change notification settings

hisptoot/Nintendo-Switch-Remote-Control

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT Build Status

Nintendo-Switch-Remote-Control

Remote control for the Nintendo Switch via UDP or with a single computer. Pro Controller emulation in AVR firmware

This project uses the LUFA library and reverse-engineering of the Pro Controller for Nintendo Switch for remote control of the console. It consists on two main parts:

  • GUI: Java project with two programs, client and server.

    The client takes input from a real controller, keyboard or a Discord bot and sends it to the server over UDP.

    The server receives the input and sends it to an AVR microcontroller which acts as a controller. The MCU is plugged into the Switch dock and the console recognizes it as a Pro Controller. If you have a USB-C adapter, you should also be able to use this in handheld mode/Switch Lite.

  • Firmware: firmware that runs on the microcontroller. The server PC sends the received commands to the microcontroller via UART. When the Switch requests HID reports, the microcontroller sends them. It uses the LUFA library.

The goal of this project is to provide a way to play Switch games remotely (two computers) or control the console locally (one computer). Keep in mind this project doesn't include any video streaming service.

A complete diagram is shown below: Hardware diagram

NOTE: if you're using a FTDI-based serial adapter, yo need to reduce the latency timer value.

Additional information can be found on the specific README files.

  • The README inside the gui folder contains information about the Java project, required setup and steps, and instructions for configuring a Discord bot.

  • Inside firmware folder there are instructions for compiling and flashing the firmware for different boards, as well as a list of changes made to the original code.

Prerequisites

  • A LUFA-compatible microcontroller such as the Teensy 2.0++, Arduino UNO R3, or the Arduino Micro
  • A USB-to-UART (TTL) adapter. Popular ones are based on FTDI and CH340 chip. Can be easily found online.
  • A PC with Java and JDK installed.

TODO list

List of things that I might do in the future, no guarantee. Pull requests are welcome.

  • More flexible communication between server and client. Maybe requests to increase or decrease send rate (basic flow control).
  • Automatically decrease read timeout for FTDI-based serial adapters (see https://github.com/projectgus/hairless-midiserial/blob/master/src/PortLatency_win32.cpp).
  • Power the board from the serial adapter and not USB (Switch), so that console can suspend without turning off the MCU. In that case, the Switch could be remotely turned on by long pressing the HOME button.
  • Power reduction techniques (section 9.9 from ATmega16U2 datasheet).
  • Refactoring of SerialAdapter.java. Blocking/non-blocking operations, use default procedures for syncing.
  • Migrate from Jamepad to sdl2gdx (?).
  • Java i18n (ResourceBundle?).
  • Remove absolute positioning in layouts.

Acknowledgments

  • mzyy94 for its work on Pro Controller emulation using a Raspberry Pi.
  • wchill for the SwitchInputEmulator project. My firmware was initially based on his work.
  • progmem for the Switch-Fightstick repository, which itself is the base of wchill work and created the opportunity to control the Switch with a LUFA-compatible MCU.
  • ItsDeidara author of the CommunityController repository and host of the namesake Twitch channel. Gave some tips for hardware configuration and some of the serial port code is based on his work.
  • abcminiuser, who created the LUFA library (Lightweight USB Framework for AVRs).

About

Remote control for the Nintendo Switch via UDP or with a single computer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 65.6%
  • C 30.0%
  • C++ 2.3%
  • Makefile 2.1%