|Garrett Wilson 4d832ef50f||1 year ago|
|ppmadapter||1 year ago|
|.gitignore||5 years ago|
|LICENSE||5 years ago|
|README.md||1 year ago|
|setup.cfg||5 years ago|
|setup.py||5 years ago|
This is a userspace application that reads the PPM audio stream produced by many RC controllers, and produces a virtual joystick using the uinput system.
This was forked from amckee/ppmadapter that provided a Python 3 compatible version of PPM Adapter. However, it seemed not to work with my controller, so I modified it to use the PPM to TX logic (but still being userspace not requiring a user-compiled kernel module) at nexx512/txppm/ppm.c.
This application requires two libraries, pyaudio and python-evdev. They are
declared in the setup.cfg file, so will be installed if you
but you can also install them using your system package manager, looking for
packages similar in name to:
You need user access to /dev/uinput. To create a udev rule giving access to users in the "input" group, put in /etc/udev/rules.d/99-uinput.rules
KERNEL=="uinput", GROUP:="input", MODE:="0660"
Then make sure the uinput driver is loaded on boot, creating
/etc/modules-load.d/uinput.conf (note: if you don't want to reboot, load
sudo modprobe uinput).
Then reload the udev rules with (and make sure you're in the "input" group, if not, add yourself and logout/login or reboot):
sudo udevadm control --reload-rules && sudo udevadm trigger sudo usermod -a -G input your_username
To select which microphone input you wish to use, list them with:
python3 -m ppmadapter inputs
Start PPM Adapter specifying one of the inputs (e.g. hw:0, hw:1,7, or default):
python3 -m ppmadapter -i default run
Also see options --plot and/or --debug for debugging and --average and
--buffer for adjusting smoothness and latency. After running,
show the input has been created:
input: ppmadapter as /devices/virtual/input/inputXX
Tested controllers: Spektrum DX6i, RadioLink AT9S
A few options for checking the joystick inputs are reasonable:
crrcsim. For a simulator, I've tried using
crrcsim (either as audio
input directly or with the input from PPM Adapter),
neXt, and FlightGear.
For neXt, you can create a config file ~/neXt/controllerconfigs.txt something like the following and then configure/calibrate the channels within the simulator:
(Alternatively generate your own config using controllermap)