RELEASE HID-Mitm: Rebind buttons and use custom gamepads on your switch!

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by jakibaki, Apr 3, 2019.

  1. jakibaki
    OP

    jakibaki GBAtemp Regular

    Member
    8
    Mar 3, 2017
    Germany
    hid-mitm

    This is the official discussion-thread of hid-mitm.

    https://github.com/jakibaki/hid-mitm

    Disclaimer:
    This sysmodule is in beta! Problems are to be expected. If you encounter any that aren't listed in the known issues section please report it here if nobody else did already.

    Features
    • Rebind buttons on your gamepads.

    • Use custom gamepads on your nintendo switch by using your phone/pc as a proxy.
    Setup
    While hid-mitm will work perfectly fine on stock atmosphere and possibly reinx the recommended setup is to download the latest Kosmos since it comes preconfigured with the awesome Kosmos Toolbox which allows you to easily configure hid-mitm.

    On Kosmos it's just a matter of opening the Kosmos Toolbox, enabling the hid-mitm sysmodule and rebooting.

    On Atmosphere, installing hid-mitm can be done by dragging the content of the release.

    No help for ReiNX is provided, if it runs that's fine but if you run into problems please try on a supported cfw before reporting.

    No support whatsoever for sxos.

    Usage
    Rebinding buttons
    Simply open the Kosmos toolbox, go to the sysmodule menu and continue to the hid-mitm menu from there (it's a simple button-press explained in the bottom bar)

    After that a screen will pop up in which you can select the button you want to rebind and then what you want it to rebind for.
    After you're done, be sure to touch the button in the middle to save your changes.

    You can also configure it manually by editing the /modules/hid_mitm/config.ini file.

    Custom gamepads
    The way that custom gamepads work with hid-mitm is not by directly connecting the gamepad to your switch but by connecting your gamepad to your phone (and experimentally pc) and then running the hid-mitm app which then in turn sends the input to your switch which will recognize it as an additional pro-controller.

    Download the companion_apps.zip from the release page.

    Android
    • Install the hid-mitm.apk from the zip on your phone.
    • Make sure that your switch has hid-mitm enabled and is connected to the same network as your phone. You can use 90dns if you don't want your switch to connect to nintendos servers.
    • Connect your gamepad to your phone
    • Enter the ip-address of your nintendo switch in the hid-mitm app (it can be found in the network settings) and press "connect"
    • Your switch now should now pick up your gamepad as an additional pro-controller! :)
    iOS
    • Install the hid-mitm.ipa from the zip on your phone. You can use Cydia Impactor for that, don't worry it will work just fine even without a jailbreak.
    • Make sure that your switch has hid-mitm enabled and is connected to the same network as your phone. You can use 90dns if you don't want your switch to connect to nintendos servers.
    • Connect your gamepad to your phone (please note that apple is rather restrictive with the choice of gamepads that they allow you to use)
    • Enter the ip-address of your nintendo switch in the hid-mitm app (it can be found in the network settings) and press "connect"
    • Your switch now should now pick up your gamepad as an additional pro-controller! :)
    As a workaround to iOS not recognizing a plus and minus button l1+l2+r1+r2+x will result in a plus and l1+l2+r1+r2+dpad-left in a minus.

    Hid-mitm can also easily be repurposed to do scripted inputs (for example a "twitch plays").
    Check out the input_pc.py for some reference of how to talk to hid-mitm.

    Known issues
    • In some games the "connect gamepad" dialog will pop up every few minutes when playing in multiplayer with a custom gamepad connected
    • There are various problems that happen if hid-mitm and sys-ftpd are enabled at the same time.
    • Some phones have a terrible bluetooth connection which will result in input-delay if using bluetooth gamepads. I can't do anything about that, that's an issue with android.
    • On some wifi-networks iPhones have problems which will result in terrible input delay. You can work around this by just opening a hotspot on your phone and letting the switch connect to that. If you don't want your switch to use up mobile data be sure to enable 90dns.
    • Some gamepads won't have their inputs mapped correctly on android.
      If anyone who has experience with android development wants to get that fixed by adding some kind of "setup interface" it would be greatly appreciated.
    • Tetris 99 doesn't want to recognize custom gamepads for some reason
    • The switch doesn't seem to accept using the custom gamepad as "activity" so the screen will automatically fade out after a while. You can work around that by turning off the auto-screen-off feature in the system settings.
    Planned features
    • Support for connecting multiple custom gamepads
    • Support for motion controls
    • (maybe) vibration support
    • Support for "disguising" gamepads as something else. To allow for example to play pokemon with a pro-controller.
    Support
    The best way to get your questions answered is by asking in the AtlasNX discord.
     
    Last edited by jakibaki, Apr 3, 2019
  2. masagrator

    masagrator File digger

    Member
    5
    Oct 14, 2018
    Poland
    Is linux app only GUI/stdout or both?
     
  3. jakibaki
    OP

    jakibaki GBAtemp Regular

    Member
    8
    Mar 3, 2017
    Germany
    It's an unholy combination :D

    Needs a cli-argument to select the switch-ip but then pops up a window to grab the input.
     
  4. masagrator

    masagrator File digger

    Member
    5
    Oct 14, 2018
    Poland
    It's possible in the future to make whole app working in terminal? Then it could be possible to make something small and cheap to work.
     
  5. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    Oh you can remap buttons on the standard controllers too, that's cool - more likely to be a use case for me :) Nice work!
     
  6. RattletraPM

    RattletraPM GBATemp's official 蒸気イーブイ

    pip Reporter
    13
    Jan 18, 2017
    Italy
    Shinjuku Station
    Very nice job on this homebrew, I'm going to try to play some MK8D with my DS3 sometime soon :P
    Also, I've linked this thread in the Kosmos v12 announcement I made earlier!
     
    KuranKu and jakibaki like this.
  7. iriez

    iriez GBAtemp Fan

    Member
    7
    Oct 27, 2016
    United States
    Next SX OS release -

    "Team Xecuter back with more hard work! This time a feature to Rebind buttons and use custom gamepads on your switch!" :rofl2:

    Awesome work as always jakibaki.
     
  8. jakibaki
    OP

    jakibaki GBAtemp Regular

    Member
    8
    Mar 3, 2017
    Germany
    the input_pc.py from the repo is basically that. Only works with very few gamepads though.
     
  9. masagrator

    masagrator File digger

    Member
    5
    Oct 14, 2018
    Poland
    Which one? DualShock 4, Xbox One Controller?
     
  10. TheZander

    TheZander King of the Level 7's

    Member
    10
    Feb 1, 2008
    United States
    Level 7
    How's the wiiu pro compatibility?
     
  11. jakibaki
    OP

    jakibaki GBAtemp Regular

    Member
    8
    Mar 3, 2017
    Germany
    I tried it with my ds3 and xbox one gamepad.
     
    masagrator likes this.
  12. H1B1Esquire

    H1B1Esquire RxTools, the ultimate CFW machine.

    Member
    9
    Nov 2, 2016
    United States
    Earth, bro-dude.
    I think the BT has a problem communicating unless you have a (possibly) Toshiba BT stack(?), but I think there are videos on how to do it....It'll be a little messy.
     
  13. Kubas_inko

    Kubas_inko "Something funny goes here."

    Member
    13
    Feb 3, 2017
    Czech Republic
    I gues on earth.
    This seems like a good thread to ask. Is connecting 3rd party controller directly to switch possible? (So that you dont need to use any middle device) Like custom HID for controllers right over bluetooth.
     
  14. Kirby567fan

    Kirby567fan Advanced Member

    Newcomer
    3
    Jan 6, 2018
    Morocco
    Anyone here with an Ipega 9021 encountering problems with this.
     
  15. LightBeam

    LightBeam Advanced Member

    Newcomer
    2
    Oct 1, 2018
    France
    How are you supposed to use that on PC ? I would like to use my SNES mini controller but I can't manage to connect my wiimote on my Switch and it would be more convenient for me to get this working on Windows
     
  16. Bakugo

    Bakugo Member

    Newcomer
    3
    Dec 28, 2016
    United States
    Very well done, I've been waiting for something like this. Surprised it took so long.

    How long do you think it will take to add this? If the answer is more than a week, could you share the methods you used for debugging while developing this? I'd like to try adding it myself.
     
  17. jakibaki
    OP

    jakibaki GBAtemp Regular

    Member
    8
    Mar 3, 2017
    Germany
    Probably will be a while, I won't have that much free time anymore for a while soon.

    Well for debugging I just have a small script builds the project, boots the switch over into memloader and copies it over.
    If you need some kind of debug-output fatals are generally useful.
     
  18. hippy dave

    hippy dave BBMB

    Member
    14
    Apr 30, 2012
    United Kingdom
    Re: the screen-off issue, it's possible to disable the auto screen off timeout from homebrew, I bookmarked this commit from pplay as a reference. You could use that to disable screen off at least while there's been recent activity on custom pads.
     
  19. LapCheong

    LapCheong GBAtemp Regular

    Member
    2
    Mar 6, 2019
    Australia
    Xbox one s bluetooth to my pc then to my switch works almost perfectly

    The left thumb button is tied to the xbox logo button for some reason.
     
  20. hellogbatemp

    hellogbatemp Member

    Newcomer
    1
    May 19, 2018
    France
    Nice job!
    the ps4 controller works perfectly, pair with the pc.BUT if I minimize the window "HID" the controller no longer work and
    can we configure the "home" button?
    thanks
     
    Last edited by hellogbatemp, Apr 4, 2019
  21. Zumoly

    Zumoly GBATemp Analyst

    Member
    7
    Apr 27, 2018
    Mali
    Yorosso
    Nice app! I won't need to get an extra 8bitdo adapter for my extra PS3 controllers then.
    I'll be off to try to hotspot option.
     
    narukyuubito likes this.
Loading...