Link Nintendo Switch Joy-Cons to Chillout VR/VRChat! Uses OSC Mod in ChilloutVR and the OSC system in VRChat.
For now, only simple on/off rumble haptics are supported!
- Nintendo Switch Joy-Con controller(s). Only tested with knockoffs from Aliexpress.
- A customisable avatar or a compatible avatar
- Bluetooth Dongle or similar. You can use another Windows device as relay
- Something to attach controller to body/headset straps, for example "Exercise Patch Self Adhesive Tape Sports Gym Fitness"
- Unity editor
vrcjoycon.exe
from this repository's Releases- ChilloutVR
- OSC Mod (Recommended to install via CVR Assistant)
- Other avatars need CVR Pointer on at least one index finger.
- Your avatar needs CVR Advanced Avatar Trigger boxes and parameters
Only tested with knockoff joycons. Does it work with real joycons? Apparently not. We need to fix this!
Only tested on Debian 12 (bookworm) and python 3.11
Steps
# Our dependencies
sudo apt install libhidapi-dev
# https://innovativeinnovation.github.io/ubuntu-setup/python/pyenv.html
# Pyenv dependencies
sudo apt install make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncursesw5-dev \
xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
# Get pyenv so we can get python 3.11 exactly
curl https://pyenv.run | bash
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# ^^^ Follow comments above to install pyenv lines in .bashrc ^^^
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pyenv install 3.11 # build 3.11 python
pyenv virtualenv 3.11 joycon # create joycon virtualenv
. .bashrc # reload .bashrc (or restart shell here)
git clone "https://github.com/Python1320/vrcjoycon.git" && \
cd vrcjoycon && \
pyenv local joycon
# Make sure you see (joycon) prefix on your shell now
# install poetry dependency manager
pip install poetry # OR: curl -sSL https://install.python-poetry.org | python3
poetry install # install python dependencies with poetry
####### Do steps 2 and 3 below and (*) ##########
cd src
./main.py
# Start controllers for discovery
# Modify config
${EDITOR:-nano} config.ini
(*) you may need to try poetry add hid
and poetry add hidapi
to find a working one (remove the other one).
echo "blacklist hid_nintendo" > /etc/modprobe.d/blacklist_hid_nintendo.conf
rmmod hid_nintendo
See: https://www.reddit.com/r/Stadia/comments/egcvpq/comment/fc5s7qm/
cat << 'EOF' > /etc/udev/rules.d/50-nintendo-switch.rules
# Switch Joy-con (L) (Bluetooth only)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2006.*", MODE="0666"
# Switch Joy-con (R) (Bluetooth only)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2007.*", MODE="0666"
# Switch Pro controller (USB and Bluetooth)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", MODE="0666"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", KERNELS=="0005:057E:2009.*", MODE="0666"
EOF
Run udevadm control --reload-rules
- Example haptics avatar + world (please submit in PR!)
- Button input possibility
- Gyroscope?
- Switch joy-con to poll only to reduce wireless interference (partially done)
Rather simple. Just add a few components with right parameter name and it should just work.
-
Add joyconrumble1 to avatar parameters
-
Add CVR Advanced Avatar Trigger to your head
-
Add CVR Pointer on at least one finger
- Position one or multiple Contact Receivers components to your chosen avatar bone
-
Choose at least some collision tags or you will receive no contacts
-
Haptics can be set to
local only
.Allow Self
is recommended for testing. -
Select
Proximity
fromReceiver Type
. -
Set target parameter to
joyconrumble1
. For right controller choosejoyconrumble2
. -
Add the above parameters to your animator parameters with default float value of 0.0. This is used by OSC to relay the status to VRCJoyCon.
-
- Put controllers into pairing mode by pressing the pairing button.
- Pair controllers manually over Bluetooth with Windows.
- Launch vrcjoycon.exe
- When pairing is successful, the controller should vibrate. You may need to press the pair button in the controllers a few times before Windows notices the controllers. They should say "connected" in the windows settings when this is so.
- In case of trouble, test with other joycon software first
- Launch VRChat if not already launched
- From the VRChat's circular menu, inside settings, inside OSC, choose Enable OSC. Additional help here. (If the haptics do not work, try reset configuration option in the same menu ATTN. The OSC Debug menu does not help you with debugging haptics, only output)
If you have no bluetooth on your VR PC or are experiencing interference it should also be possible to use vrcjoycon.exe
on a different Windows Laptop, for example.
- You will need to configure VRChat to relay the OSC output data to your target computer: https://docs.vrchat.com/docs/osc-overview#vrchat-ports
- Start
vrcjoycon
with command line argumentsvrcjoycon.exe --listen=any --port=9001
- You can replace
any
with an IP address. Any is an alias for0.0.0.0
- The default port is 9001
- Make sure your firewall allows listening on
UDP
protocol port9001
forvrcjoycon.exe
- You can replace
Test with OSC receiver to see if your avatar is transmitting. Try transmitting 1
to /avatar/parameters/joyconrumble1
with OSC sender to see if vrcjoycon.exe
works.
- joycon-python library
PENDING MISSING LICENSE ON: https://github.com/tocoteron/joycon-python