×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Joystick

Replied by Jasem Mutlaq on topic Joystick

You need to change the function getDefaultName() to "GamePad" same as the one in the XML file. Btw, this would a great addition to the *default* INDI installation. Though I'm not thrilled about adding a new dependency, so it could be optional and the MacOS release can enable it.
3 years 3 months ago #65854

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Unfortunately, the Controller class in indicontroller.h requires the joystick to be named "Joystick". I didn't want to introduce breaking changes with this. Also agree that adding a dependency on SDL for main indi would be overkill for this.
3 years 3 months ago #65856

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

I could add a new Snoop Device field to Controller to allow the user to specify the device to snoop on, and have it default to Joystick.

Edit:
github.com/indilib/indi/pull/1321
Last edit: 3 years 3 months ago by Rick Bassham.
3 years 3 months ago #65857

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

FYI, As I couldn't get my Xbox controller working under Kstars I tried setting up INDIGO Server with my mount ( pmc8 ) and joystick, but couldn't get it to work there either. Their joystick driver HID Joystick did seem to see my controlller and read its serial number, and their mount driver does have a "snoop device" field. So I tried entering in that field the name of the driver and also tried the name of my device that the driver presented, but unfortunately no luck. No idea if it's something I'm doing wrong or something in their system, but thought I'd let you know. The INDIGO Server seems to work fine under Kstars / EKOS and one advantage to me is that it DOES recognize my SSAG guide camera, whereas the Kstars internal driver currently does not unfortunately.

If anyone manages to get joystick / gamepad functionality working under Kstars / EKOS on the Mac I'd appreciate if they'd post beginner level instructions on what to enter in what fields to get it working, Thank you, and thanks again for all your efforts in programming this stuff for us!
3 years 3 months ago #65877

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Once I get the gamepad driver working cross platform and stable, I'll post an update here. Right now it isn't ready for general consumption.
3 years 3 months ago #65881

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Ok, if you have the most recent nightly build of INDI or build from git, you can test out my cross platform joystick driver. To see if you can use it, go to the Options tab in the INDI control panel for you telescope and see where it says "Joystick" Enable Disable. If you ALSO see an option for "Snoop Joystick", you have a build that can use it. If you don't, update to latest nightly or build from git and see if it is there.

Then go to github.com/rickbassham/indi_gamepad and build and install the indi_gamepad driver. This will require installing the sdl2 libraries (apt-get install libsdl2-dev on linux or brew install sdl2 on mac).

After building and installing, restart KStars and you should see a GamePad driver in Aux. Add that to your profile and start it. Then set the Snoop Joystick to match the name of your running driver (should be GamePad). On the GamePad driver tab in the INDI control panel, you should see a list of game pads attached to your system. The driver will auto connect to the first one.

I've tested this in Linux and Mac with a Logitech 310 gamepad, but should work with most console style game pads.
3 years 3 months ago #66019

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

Hi Rick, I downloaded and installed the latest 3.5.2 Beta version of Kstars in the hope the joystick support might be included, and I see that there is a Joystick option and a Snoop device option under my telescope Options tab in Ekos, however when I edit a profile I don't see anything named "Gamepad" in the the Aux section. Unfortunately I don't know how to "build and install the indi_gamepad driver" as you suggest in an earlier post. I imagine that would require knowledge of Mac programming environment specifics, which I'm not up on. If you can point me to instructions on how to do this I'd be willing to give it a go. Otherwise if you could let us know if joystick support will be in a future build of Kstars I'd appreciate it. Thank you.
3 years 2 months ago #67643

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

Hey pdmogg, unfortunately, if you're not comfortable building C++ projects on mac, it's not quite ready for you. I'll see if I can create an easy way to install it for non-software engineers.
3 years 2 months ago #67647

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

Thank you. that would be much appreciated.

Out of interest, can a build be made just by learning to use Github? Or do you have to load Xcode and a bunch of other Mac programming environment stuff on your mac to do this? In another lifetime I programmed under MSDOS in C and Assembly language, but have no mac programming experience.
3 years 2 months ago #67649

Please Log in or Create an account to join the conversation.

  • Posts: 216
  • Thank you received: 120

Replied by Rick Bassham on topic Joystick

You do not need to use xcode (but you do need to install it). If you have some programming experience (or are comfortable on the command line), you might be able to get it going pretty easily.

First, you'll need to install homebrew:

brew.sh/

Then install the dependencies needed to build all the things (I think this is comprehensive, but may not be):
brew install sdl2 cfitsio libnova gsl zlib libusb jpeg libtiff fftw cmake

Then you'll need to build libindi to provide the libraries we need to link against:
mkdir -p ~/indi_projects
cd ~/indi_projects
git clone https://github.com/indilib/indi.git
cd indi
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
make
sudo make install

Now that libindi is installed, we can build indi_gamepad and install it.
cd ~/indi_projects
git clone https://github.com/rickbassham/indi_gamepad.git
cd indi_gamepad
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
make
sudo make install

Then you should be able to restart KStars and see the gamepad (hopefully).
3 years 2 months ago #67650

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 1

Replied by Paul Mogg on topic Joystick

Hi Rick,
Thank you for the details of how to do that, unfortunately I just don't have the space free to install Xcode, I tried once before. Please let us know if you do come up with a method for non-programmers to be able to use the Joystick, as it would be make visual observing so much easier. Regards.
3 years 2 months ago #67681

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812

Replied by Rob Lancaster on topic Joystick

Hi there, Jasem gave me a heads up about this thread and this very interesting driver. I thought it might be nice to try to include this in the latest KStars and test it out. So I built it and put it in my latest build for kstars. Then I found an old Logitech Rumblepad 2 in the drawer. So I decided to try it out. I can't get it to connect to the gamepad so far. I keep getting these messages when I try to connect: "GamePad is disconnected." even though I am fairly sure it is connected. When I run it from the command line I get this on the command line: "2021-02-26T03:39:16: Driver ./indi_gamepad: joysticks count: 1" but I still get this when I try to connect from KStars and start the driver: "GamePad is disconnected."

Is there something I need to do to enable the controller to get it to start the driver? I tried this link in Google Chrome and it worked perfectly: gamepad-tester.com/

Any ideas? It would be nice to include if I/you can make it work.

Thanks,

Rob
The following user(s) said Thank You: Jasem Mutlaq
3 years 1 month ago #67805

Please Log in or Create an account to join the conversation.

Time to create page: 0.800 seconds