Board index FlightGear Support Hardware

Saitek Switch Panel

Joysticks, pedals, monitors.

Saitek Switch Panel

Postby daibach142 » Tue Dec 22, 2020 12:02 am

Similar to my Saitek Radio driver, I have a Saitek switch panel driver, with configurations for Cessna 172P and Piper PA28-161. This is available, like the Radio, for Linux and for Raspberry Pi. Thanks to robertfm for providing the hardware and extra debugging. If there is sufficient interest expressed on this forum, the Switch panel driver can be made available on GitHub.

Dave
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby Catalanoic » Thu Dec 24, 2020 4:43 pm

I've both Radio and Switch panels, even if its only usable on Linux and Raspberry I bet that not only me some would appreciate being downloadable somewhere. Thanks in advance and merry christmas
User avatar
Catalanoic
 
Posts: 1099
Joined: Mon Mar 05, 2012 1:33 am
Location: Barcelona (LEBL)
Callsign: Catalanoic
Version: 2017.3
OS: Lubuntu/Windows 7

Re: Saitek Switch Panel

Postby daibach142 » Thu Dec 24, 2020 6:50 pm

Some interest at last! OK, the switch panel requires configuring for each aircraft, currently it's available for Cessna 172P and Piper PA28-116 (this is an installation option).
It is possible to configure for other a/c using an XML specification file, so let me know any particular a/c desired.

Hope to have this on Github by end of year.

Dave
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby Ysop » Thu Dec 24, 2020 7:31 pm

Interest +1

I was waiting for this, while the panel got dusted. Thanks for finding a solution!

To be tested in January.
User avatar
Ysop
 
Posts: 1349
Joined: Thu Oct 25, 2018 10:06 pm
Version: 2020.3.18
OS: ubuntu 22.04

Re: Saitek Switch Panel

Postby daibach142 » Wed Dec 30, 2020 7:12 pm

Saitek Switch Panel driver for linux available here:https://github.com/daibach142/FGFS_Saitek_Switch_Panel

Raspberry Pi version available next few days when packaged!
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby daibach142 » Fri Jan 01, 2021 11:44 pm

Raspberry Pi version included in latest release at: https://github.com/daibach142/FGFS_Saitek_Switch_Panel
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby daibach142 » Sun Jan 03, 2021 2:06 am

Added a note on conversion to run directly on Windows to both driver github repositories, hope someone picks this up!
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby shrike » Thu Jun 10, 2021 1:05 pm

Hi Dave,

Thanks so much for the Saitek switch and radio panels solutions. I've corresponded in the past about the way I used your software to set up the radio panel using FGFS running on a Windows 10 machine and your software running on Ubuntu 20.04 in a virtual machine hosted by VirtualBox on the same Windows machine.

Now I'm trying to set up the switch as well, and I've run into some difficulties. I was hoping you might be able to help me out. On the Windows side I've got the following strings in FGFS settings:

--aircraft=c172p --airport=KLWM --runway=05
--generic=socket,out,30,192.168.1.20,49001,udp,saitek_output
--generic=socket,in,30,,49002,udp,saitek_input
--generic=socket,in,20,,60000,udp,stkswitch_input

I've also installed the files saitek_input.xml, saitek_output.xml, and stkswitch_input.xml in the C:\Program Files\Flightgear 2018.3.6\data\Protocol directory.

When I start up flightgear, using netstat on the Windows machine I can see that it begins listening for packets on UDP ports 49002 and 60000.

On the ubuntu side, I compiled the switch software using configure (chose cessna), make, and make install. By running SaiktekSwitchPanel with the right --switch parameter, e.g., /dev/hidraw2, the switch panel is recognized, the red light goes on, and when I press a button SaiktekSwitchPanel recognizes it. Also, I've got Wireshark running on the Ubuntu VM, so I can see that whenever I press a button, a UDP packet is sent to the Windows address on port 60000. Similarly, whenever I press a button on the radio, a UDP packet is sent to the Windows address on port 49002. The Windows machine is also sending a steady stream of UDP packets to the Ubuntu machine on port 49001.

As an example, the payload of one of the UDP packets that is sent when I press a button on the switch contains the following string: controls/hyrdaulic/system/electric-pump/,0

(Interestingly, the UDP packets sent when I press radio buttons are short, with payloads of around 6 bytes, whereas the packets sent when I press switch buttons are longer, with payloads of around 40 bytes.)

The problem is that while flightgear responds properly to the radio buttons, it doesn't do anything when I press the switch buttons.

Any ideas?

Thanks!!

Bruce
shrike
 
Posts: 15
Joined: Wed Sep 16, 2020 2:12 pm

Re: Saitek Switch Panel

Postby daibach142 » Thu Jun 10, 2021 3:44 pm

Are you sure you have the (little) file Switch.nas in your (Windows username/.../Nasal) directory?

BTW, the size of the packets are correct - Radio sends 'COMM,1' as a typical message whereas the switch panel sends 'controls/lighting/landing-light,1' as the switch target is the configurable item here.

Also, there is a native Windows driver for the Radio Panel, see this post - https://forum.flightgear.org/viewtopic.php?f=24&t=39140
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby shrike » Thu Jun 10, 2021 7:16 pm

Hi Dave,

Thanks for responding so quickly!

Oops, no, I didn't put Switch.nas in the Windows directory! I had searched around for instructions about which files to put where on the Windows machine, and had trouble finding them. I'll put Switch.nas in the right place this evening, and let you know what happens.

Yes, I saw that there was a native Windows driver for the Radio Panel -- thanks for creating that! But for now since I can get the Ubuntu VM solution working for both switch and radio, I think I'll stick with that.

Bruce
shrike
 
Posts: 15
Joined: Wed Sep 16, 2020 2:12 pm

Re: Saitek Switch Panel

Postby daibach142 » Thu Jun 10, 2021 9:29 pm

Hi Bruce
I noticed that there is no Windows info in the 'INSTALL' file for the switch panel. If you look at the top level 'Makefile' you can see the (Linux) move of the 'Switch.nas' file. On windows, this goes in <username>/Appdata/Roaming/flightgear.org/Nasal.

I'm working on a native Windows driver for the SwitchPanel (although I'll need help testing, as I don't have the switch hardware). I'll announce on this forum when it's ready.
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby shrike » Fri Jun 11, 2021 3:35 pm

Hi Dave,

Thanks, I got it to work! At first I mistakenly put the Switch.nas file in the C:\Program Files\Flightgear 2018.3.6\...\Nasal directory, which isn't the right place, and didn't work, but then I followed your suggestion and put it in <username>/Appdata/Roaming/flightgear.org/Nasal, and now everything works. I feel like I've been performing maintenance on my plane and now it's finally back in the air.

One small issue I noticed is that when I use the landing gear up/down lever, I can see the primer lever in flightgear go in and out but flight gear doesn't print "primer (1)", "primer (2)", etc., as it does when I click on the lever with my mouse. It seems as if, although the lever is moving in and out, flightgear isn't giving me credit for actually priming the engine -- and the engine won't start. So there's something a little different about the way the SwitchPanel is operating the primer lever than the way the mouse operates it.

What kind of equipment do you need to test the Windows version of the SwitchPanel driver? Perhaps I can help you out.

All the best,

Bruce
shrike
 
Posts: 15
Joined: Wed Sep 16, 2020 2:12 pm

Re: Saitek Switch Panel

Postby daibach142 » Fri Jun 11, 2021 6:12 pm

Hi Bruce
I'll look into the primer lever issue - maybe a slight configuration change will do it?
I don't have a switch panel for testing (Rob Feal-Martinez lent me his for the development), but I have a 'sort of' graphical emulator using wxwidgets, so can test most of the logic. The bit I can't test is the hidapi connection for the panel. Maybe you could do some testing of that aspect when I've something ready?

Regards
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Re: Saitek Switch Panel

Postby shrike » Fri Jun 11, 2021 6:48 pm

Hi Dave,

Sure, I'd be happy to help with testing :)

Bruce
shrike
 
Posts: 15
Joined: Wed Sep 16, 2020 2:12 pm

Re: Saitek Switch Panel

Postby daibach142 » Fri Jun 11, 2021 9:10 pm

Hi Bruce
Great - I'll PM you when it's ready - maybe a week or so

Thanks
Dave
daibach142
 
Posts: 40
Joined: Wed May 16, 2018 12:54 am
Location: EGNR
Version: 2020 3.13
OS: Ubuntu 22.04

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 3 guests