After many frustrations about having to constantly recalibrate my controller (Graupner MZ-12 via a cheap HobbyKing's wireless 9 in 1 adapter in wired mode), I wanted to explain how I solved the issue.
First, you need the jstest and jscal utilities (in Fedora these are in the linuxconsoletools package), or alternately there's a graphical version of jstest (jstest-gtk or similar).
It looks like /dev/input/js0 is my joystick. Lets test it:
1 2 3 4 5 6
$ jstest /dev/input/js0 Driver version is 2.1.0. Joystick (FeiYing Model SAILI Simulator - G6 Controller) has 6 axes (X, Y, Z, Rx, Ry, (null)) and 5 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2). Testing ... (interrupt to exit) Axes: 0: -5958 1: 0 2: 0 3: 32766 4: 0 5: 0 Buttons: 0:off 1:off 2:off 3:off 4:off ^C
Move the sticks. The values should vary between -32768 and 32767, with the sticks centered at 0 (well, approximately). If this is the case then you're done (press Ctrl+C to quit the test app), otherwise you need to calibrate.
1 2
$ jscal /dev/input/js0 ...
Do as the program says (it may want you to hold the sticks in position for a couple of seconds sometimes to estimate jitter). Afterwards, run jstest again to test that you get the correct values out. If you do... great, fire up neXt, do neXt's calibration (you shouldn't need to repeat this), and go fly.
... except, you want to make the calibration persistant, right? While the calibration is still correct, run jscal-store (sudo for root). [Note: this may not be available on all distros; see below.]
1
$ sudo jscal-store /dev/input/js0
Now, whenever you reconnect the transmitter/adapter, you'll still need to restore the calibration, but it's easy:
1
$ jscal-restore /dev/input/js0
It should be possible to restore the calibration automatically [apparently this is done for you on Debian] with something like the following udev rule; however it doesn't work for me. You can find suitable ATTRS to identify your device via "udevadm info --attribute-walk /dev/input/js0".
Update: I noticed that the jscal calibration leaves quite large dead-zones, which makes flying horrible (no precision with the sticks close to center).
Instead, use jstest-gtk to do the calibration (jscal-store etc. as before). It lets you adjust the calibration manually so you can check there are no dead-zones. [If jstest-gtk is not available as a package, you can download the source from github and compile it yourself; it's pretty easy:]