by 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