Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: HOWTO: Enabling an analog Joystick (+Flightgear)

  1. #1
    Join Date
    Jul 2005
    Beans
    387

    HOWTO: Enabling an analog Joystick (+Flightgear)

    After about an hour of searching, I finally was able to get my CH products Flight Sim yoke working under Ubuntu as well as Flightgear. I will attempt to document and clarify the steps I used to get my joystick working with Ubuntu in addition to FlightGear. Should any of the information be incorrect, please feel free to correct me.

    This howto assumes you have an analog joystick connected to the gameport/MIDI port of your already functioning sound card.

    Perform the following steps in a terminal:
    Code:
    cd /etc/init.d
    sudo gedit joystick
    Paste the following lines into gedit, and save the file:
    Code:
    #! /bin/sh
    # /etc/init.d/joystick
    #
    
    # Carry out specific functions when asked to by the system
    case "$1" in
      start)
        echo "Enabling Joystick"
        cd /dev
        rm js*
        mknod input/js0 c 13 0
        ln -s input/js0 js0
        modprobe joydev
        modprobe analog
        echo "DONE!"
        ;;
      stop)
        rmmod joydev
        rmmod analog
        echo "DONE!"
        ;;
      *)
        echo "Usage: /etc/init.d/joystick {start|stop}"
        exit 1
        ;;
    esac
    
    exit 0
    Now, make the file executable.
    Code:
    sudo chmod 755 joystick
    Configure the system to run /etc/init.d/joystick on boot:
    Code:
    sudo update-rc.d joystick defaults
    Enable the joystick:
    Code:
    sudo /etc/init.d/joystick start
    If you are not using Flightgear, you are done. Your joystick should now work correctly and be enabled. If you are using Flightgear and hope to get the joystick working with Flightgear, please proceed with the below steps:

    Code:
    cd ~
    fgjs
    [Follow the onscreen directions, assigning the buttons/axies (sp?) as needed.]
    Once you have completed the fgjs program and are happy with the configuration, type:
    Code:
    cat fgfsrc.js >> .fgfsrc
    Now, load FlightGear and your joystick should work and use the button/axis assignments you specified. If you make a mistake during fgjs or are unhappy with your assignments BEFORE you ran the "cat fgfsrc.js >> .fgfsrc" code simply run the below command again to recreate fgfsrc.js
    Code:
    rm fgfsrc.js
    fgjs
    I hope this helps someone, if you have problems or find any sections that are incorrect or do not work correctly please be sure to speak up.

  2. #2
    Join Date
    May 2005
    Location
    Burnley, Lancs.
    Beans
    1,139
    Distro
    Ubuntu

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    Quote Originally Posted by evilghost
    if you have problems or find any sections that are incorrect or do not work correctly please be sure to speak up.
    Code:
    root@ubuntu:/etc/init.d # /etc/init.d/joystick start
    Enabling Joystick
    rm: cannot remove `js*': No such file or directory
    DONE!
    root@ubuntu:/etc/init.d #  /etc/init.d/joystick stop
    DONE!
    root@ubuntu:/etc/init.d #  /etc/init.d/joystick start
    Enabling Joystick
    mknod: `input/js0': File exists
    DONE!
    root@ubuntu:/etc/init.d #
    Is this a problem? And, how does one actually use the joystick? I was wonding if it's possible to use it for tuxracer.
    It's a Thrustmaster FCS MkII
    Some people say I'm a man of few words, but the fact is that most people talk too much without actually saying anything.

  3. #3
    Join Date
    Aug 2005
    Beans
    8

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    Actually, I have the same error (?)

    Code:
    root@Trigeorgis:/home/george #  /etc/init.d/joystick start
    Enabling Joystick
    mknod: `input/js0': File exists
    DONE!
    root@Trigeorgis:/home/george # jstest /dev/js0
    jstest: No such device
    My joystick although, is very old and I am not sure if it is works

    *btw, is a dexxa js.

  4. #4
    Join Date
    Sep 2005
    Beans
    31

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    I've the same problem. My old joypad Gravis is attached to sound card cmi3878. By default the gameport is disabled, and to enable i need to change and option: "joystick 1". I've searched in the web but I've find nothing to help me... Is a option to add in the alsa.conf? I need to rebuild alsa drivers?
    Please HELP ME!!!!

  5. #5
    Join Date
    Sep 2005
    Beans
    31

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    I've solved my problem. I think is important do add this thing in the howto:
    If you have a joystick port attached sound card you must indicate to alsa to activate this port.
    $ cd /etc/modprobe.d/
    $ sudo nano alsa-base
    in this file alsa look the sound card option. Go at the end of the file and add this string:

    options snd-xxxx joystick_port=1

    where xxxx is the driver of your sound card.

    save and restart alsa (or reboot, it's more easy )
    Excuse me for my bad english...

  6. #6
    Join Date
    Jan 2005
    Location
    Brisbane Australia
    Beans
    285

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    you can add the commands to /etc/init.d/bootmisc.sh file.
    for my analog joystick i added
    sudo modprobe ns558
    sudo rmmod ns558 (this is required on my stem because doesnt load correctly)
    sudo modprobe ns558
    Thanks to Happytux for this info.
    Regards
    sharke

  7. #7
    Join Date
    Sep 2005
    Beans
    4

    Re: HOWTO: work for MaxFire G08

    i did the steps of the main post and kubuntu recognize a joystick in /dev/js0, but my JS is of 2 axis and 8 buttons, and it show 4 axis and 4 buttons, how can i do for resolv this?


    kanibalv
    kanibalv@gXail.com ==> X=m
    Last edited by kanibalv; March 26th, 2006 at 03:24 AM.

  8. #8
    Join Date
    Apr 2006
    Beans
    10

    Re: HOWTO: work for MaxFire G08

    Quote Originally Posted by kanibalv View Post
    i did the steps of the main post and kubuntu recognize a joystick in /dev/js0, but my JS is of 2 axis and 8 buttons, and it show 4 axis and 4 buttons, how can i do for resolv this?
    same problem here

  9. #9
    Join Date
    Mar 2007
    Beans
    2

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    I know the only person who's going to be able to fix this problem is the person who wrote the linux joystick driver 2.0 module, BUT i have a similar problem to everyone.

    I have a SB audigy, and have figured out how to get the joystick port to take button presses but it still thinks that i have a 4-axis gamepad. I don't know if autodetection is messed up or what, but i simply need to tell the computer what's plugged into it. a 2 axis, 6 button gamepad.

    the module which should take the option for this configuration is "analog"
    $ sudo modprobe -v analog js=gamepad8
    but that doesn't work and i don't know the real option to use with the module, or what module to use the option with
    here's my dmesg:
    [42949925.400000] gameport: EMU10K1 is pci0000:02:0b.1/gameport0, io 0xdc58, speed 962kHz
    [42949925.440000] input: Analog 4-axis 4-button joystick as /class/input/input6
    [42949958.900000] joydump: Unknown parameter `js'

  10. #10
    Join Date
    Mar 2007
    Beans
    2

    Re: HOWTO: Enabling an analog Joystick (+Flightgear)

    Well I found the module parameter and added this line to /etc/modprobe.conf
    Code:
    options analog map=gamepad8
    Now, js0 still fails to work on a regular basis. Here's what I've been trying
    Code:
    # mknod /dev/input/js0 c 13 0 
    # modprobe -v emu10k1-gp
    # modprobe -v gameport
    # modprobe -v joydev
    # modprobe -v analog
    # modprobe -v joydump
    Everything seems to work but
    Code:
    cat /dev/input/js0
    returns
    cat: /dev/input/js0: No such device

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •