Board index FlightGear Support Compiling

Completely Lost With FGPanel

Building FlightGear from source, and in the need for help?

Completely Lost With FGPanel

Postby BinaryLizard » Wed Feb 17, 2021 8:18 am

I want to use FGPanel on a second monitor, but I am completely lost to get the program to start. I've looked on the Wiki and multiple forms but the subject seems to just not register to me. I've also tried to follow the ReadMe linked on the Wiki but I can't seem to figure out what its really telling me to do. Sorry if this is a stupid question but I really don't know where to go from here. Also I've looked at other alternatives but I'm really drawn to FGPanel, so any help will be grateful.
BinaryLizard
 
Posts: 2
Joined: Wed Feb 17, 2021 8:10 am

Re: Completely Lost With FGPanel

Postby tom_nl » Wed Feb 17, 2021 10:12 am

The wiki isn’t very clear - it took me a while to figure it out too. I’ll do a write up later here (unless someone beats me to it)
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur

Re: Completely Lost With FGPanel

Postby tom_nl » Wed Feb 17, 2021 12:24 pm

Here's a brief guide on how to use FGpanel based on my experiences with it.

First, get it. Not all FG downloads have it compiled by default, so you may need to compile from source. Raspberry Pi being an example here. Follow th instructions on the wiki.

You need several files on both computers to configure FGpanel

First, you need an XML file that defines the panel layout. This needs to be on the computer that's hosting the panel. my example below:
Code: Select all
<?xml version="1.0"?>

<!--
Cessna 172 Skyhawk panel for the ATC 610x.
Started by John Check <j4strngs@rockfish.net> - October 2000
Updated by Curt Olson <curt@flightgear.org> - July 2002
_______________________________________________________________________

This is a panel configuration file for the open-source flight
simulator FlightGear (www.flightgear.org).  The file is an XML-encoded
FlightGear property list defining the panel's background texture and
the location (and optionally, size) of the instruments that will
appear on the panel.

Each instrument is, itself, defined in an XML-encoded property list
in a separate file.

Co-ordinates are relative to the *bottom* left corner of the screen
(as in OpenGL).  The total FlightGear window is always considered to
be 1024x768, whatever its actual display size on the screen.  All
paths are relative to $FG_ROOT.

Note that the name of the element defining each instrument must be
different, or else instrument definitions will be overwritten:
that's not particularly XML-ish, but that's how property lists
work in FlightGear right now.

Each instrument has its own preferred width and height, but you can
override those by providing <w>..</w> and <h>..</h> properties with the
<x>...</x> and <y>...</y> properties.
-->

<!DOCTYPE PropertyList SYSTEM "panel.dtd">

<PropertyList>
       <name>Cessna 172P Skyhawk Pi Panel</name>
<!--    <background>Aircraft/c172p/Panels/panel-610x-bg.rgb</background> -->
    <w>1024</w>
    <h>600</h>
    <view-height>5</view-height>

    <instruments>


     <!-- Engine gauge cluster -->
<!--      <instrument include="Aircraft/Instruments/fuel-c172s.xml">
            <name>Fuel Gauge</name>
            <x>60</x>
            <y>60</y>
            <w>120</w>
            <h>120</h>
        </instrument>  -->
       

       
<!--        <instrument include="Aircraft/Instruments/oil-c172s.xml">
            <params>
                <engine-oil-temp-select>/engines/active-engine/indicated-oil-temperature-degf</engine-oil-temp-select>
                <engine-oil-press-select>/engines/active-engine/indicated-oil-pressure-psi</engine-oil-press-select>
            </params>
            <name>Oil Gauge</name>
            <x>300</x>
            <y>60</y>
            <w>120</w>
            <h>120</h>
        </instrument> -->
       
  <instrument include="Aircraft/Instruments/vac-amp-c172s.xml">
            <name>Vacuum Pressure Gauge</name>
            <x>420</x>
            <y>60</y>
            <w>120</w>
            <h>120</h>
        </instrument>
       
      <instrument include="Aircraft/Instruments/adf-c172s.xml">
            <params>
                <adf-course-rotation-deg>/instrumentation/adf/rotation-deg</adf-course-rotation-deg>
                <adf-needle-deg>/instrumentation/adf/indicated-bearing-deg</adf-needle-deg>
            </params>
            <name>ADF Gauge</name>
            <x>896</x>
            <y>100</y>
            <w>200</w>
            <h>200</h>
        </instrument>
        <!-- End engine gauges cluster -->

        <!-- Engine controls cluster -->
      <instrument include="Aircraft/Instruments/rpm-c172s-digi-hobbs.xml">
            <params>
                <rpm-select>/engines/active-engine/rpm</rpm-select>
            </params>
            <name>RPM Gauge</name>
            <x>60</x>
            <y>60</y>
            <w>120</w>
            <h>120</h>
        </instrument>
        <!-- End engine controls cluster -->

        <!-- Sacred six -->
<!--        <instrument include="Aircraft/Instruments/asi-c172s.xml"> -->
        <instrument include="Aircraft/Instruments/asi-160-knot-hi.xml">
            <name>Airspeed Indicator</name>
            <x>128</x>
            <y>480</y>
            <w>240</w>
            <h>240</h>
        </instrument>
<!--        <instrument include="Aircraft/Instruments/ati-c172s.xml"> -->
        <instrument include="Aircraft/Instruments/attitude-indicator-hi.xml">
            <name>Attitude Gyro</name>
            <x>384</x>
            <y>480</y>
            <w>240</w>
            <h>240</h>
        </instrument>
<!--        <instrument include="Aircraft/Instruments/altimeter.xml"> -->
         <instrument include="Aircraft/Instruments/alt-c172s.xml">
            <name>Altimeter</name>
            <x>640</x>
            <y>480</y>
            <w>240</w>
            <h>240</h>
        </instrument>
        <instrument include="Aircraft/Instruments/trn-c172s.xml">
            <name>Turn Coordinator</name>
            <x>128</x>
            <y>240</y>
            <w>240</w>
            <h>240</h>
        </instrument>
        <instrument include="Aircraft/Instruments/hdg-c172s.xml"> -->
        <!--  <name>Directional Gyro</name> -->
<!--        <instrument include="Aircraft/Instruments/hsi-bk-hi.xml"> -->
            <params>
                <heading-deg>/instrumentation/heading-indicator/indicated-heading-deg</heading-deg>
            </params>
            <name>Bendix King HSI</name>
            <x>384</x>
            <y>240</y>
            <w>240</w>
            <h>240</h>
        </instrument>
        <instrument include="Aircraft/Instruments/vsi-c172s.xml">
            <name>Vertical Speed Indicator</name>
            <x>640</x>
            <y>240</y>
            <w>240</w>
            <h>240</h>
        </instrument>
        <!-- End sacred six -->

        <!-- Radio nav instruments -->
               <instrument include="Aircraft/Instruments/vor1-c172s.xml">
            <name>VOR 1 Gauge</name>
            <params>
                <nav-to-flag>/instrumentation/nav[0]/to-flag</nav-to-flag>
                <nav-from-flag>/instrumentation/nav[0]/from-flag</nav-from-flag>
                <nav-radial-selected>/instrumentation/nav[0]/radials/selected-deg</nav-radial-selected>
                <nav-gs-needle-deflection>/instrumentation/nav[0]/gs-needle-deflection</nav-gs-needle-deflection>
                <nav-heading-needle-deflection>/instrumentation/nav[0]/heading-needle-deflection</nav-heading-needle-deflection>
                <nav-has-gs-needle>/sim/instrument-options/nav[0]/has-gs-needle</nav-has-gs-needle>
                <nav-needles-pivot>/sim/instrument-options/nav[0]/needles-pivot</nav-needles-pivot>
            </params>
            <x>896</x>
            <y>500</y>
            <w>200</w>
            <h>200</h>
        </instrument>
       <instrument include="Aircraft/Instruments/vor1-c172s.xml">
            <name>VOR 2 Gauge</name>
            <params>
                <nav-to-flag>/instrumentation/nav[1]/to-flag</nav-to-flag>
                <nav-from-flag>/instrumentation/nav[1]/from-flag</nav-from-flag>
                <nav-radial-selected>/instrumentation/nav[1]/radials/selected-deg</nav-radial-selected>
                <nav-gs-needle-deflection>/instrumentation/nav[1]/gs-needle-deflection</nav-gs-needle-deflection>
                <nav-heading-needle-deflection>/instrumentation/nav[1]/heading-needle-deflection</nav-heading-needle-deflection>
                <nav-has-gs-needle>/sim/instrument-options/nav[1]/has-gs-needle</nav-has-gs-needle>
                <nav-needles-pivot>/sim/instrument-options/nav[1]/needles-pivot</nav-needles-pivot>
            </params>
            <x>896</x>
            <y>300</y>
            <w>200</w>
            <h>200</h>
        </instrument>
        <!-- End radio nav instruments -->

        <!-- Outside air tempurature -->
 <!--       <instrument include="Aircraft/Instruments/oat.xml">
            <name>OAT</name>
            <x>86</x>
            <y>711</y>
            <w>75</w>
            <h>31</h>
        </instrument> -->

        <!-- Place holder for Annunciators -->
 <!--       <instrument include="Aircraft/Instruments/ann-c172s.xml">
            <name>Annunciator</name>
            <x>569</x>
            <y>756</y>
            <w>225</w>
            <h>32</h>
        </instrument> -->

     <instrument include="Aircraft/Instruments/egt-ff-c172s.xml">
            <name>Exhaust Gas Temperature Gauge</name>
            <x>180</x>
            <y>60</y>
            <w>120</w>
            <h>120</h>
        </instrument>

     <!-- Engine gauge cluster -->
      <instrument include="Aircraft/Instruments/fuel-c172p.xml">
            <name>Fuel Gauge</name>
            <x>360</x>
            <y>60</y>
            <w>600</w>
            <h>600</h>
        </instrument>

     <!-- Engine gauge cluster -->
      <instrument include="Aircraft/Instruments/oil-c172p.xml">
            <name>Oil Gauge</name>
            <x>660</x>
            <y>60</y>
            <w>600</w>
            <h>600</h>
        </instrument>


    </instruments>

</PropertyList>


The format of this is as follows:
- the <instrument></instrument> line is the instrument to display. Paths are relative to FG data root.
- the <name></name> is a description of the instrument - this can be anything as it's not used for display
- the x and y are the position of the centre of the instrument, referenced to the top left of the screen.
- the w and h are the width and height of the instrument in pixels

If you look at the individual xml files that define the instrument, these have the properties in the property tree that need to be sent. the <params> block lets you alias different parameters from the property tree to these parameters.

The next file you need is an xml file that tells FG which parameters to send to the panel. This needs to be on both the FG computer. and the panel computer, and they need to be identical. My example below:
Code: Select all
<?xml version="1.0"?>

<PropertyList>
 <generic>

  <output>
   <line_separator>newline</line_separator>
   <var_separator>,</var_separator>

        <chunk>
            <name>Altitude</name>
            <node>/instrumentation/altimeter/indicated-altitude-ft</node>
            <type>integer</type>
            <format>%i</format>
        </chunk>

        <chunk>
            <name>Airspeed</name>
            <node>/instrumentation/airspeed-indicator/indicated-speed-kt</node>
    <type>float</type>
    <format>%.1e</format>
        </chunk>
       
        <chunk>
            <name>VSI</name>
            <node>/instrumentation/vertical-speed-indicator/indicated-speed-fpm</node>
            <type>integer</type>
            <format>%i</format>
        </chunk>

   <chunk>
    <type>float</type>
    <format>%.2e</format>
    <node>/position/altitude-agl-ft</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.2e</format>
    <node>/instrumentation/attitude-indicator/indicated-roll-deg</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.2e</format>
    <node>/instrumentation/attitude-indicator/indicated-pitch-deg</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.2e</format>
    <node>/instrumentation/attitude-indicator/horizon-offset-deg</node>
   </chunk>

   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/attitude-indicator/spin</node>
   </chunk>
   
   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/slip-skid-ball/indicated-slip-skid</node>
   </chunk>
   
   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/systems/electrical/outputs/turn-coordinator</node>
   </chunk>   
   
   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/turn-indicator/indicated-turn-rate</node>
   </chunk>   

      <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/consumables/fuel/tank[0]/level-gal_us</node>
   </chunk>   

   <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/consumables/fuel/tank[1]/level-gal_us</node>
   </chunk> 

          <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/engines/active-engine/indicated-oil-final-temperature-degf</node>
   </chunk>   
 
   <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/engines/active-engine/indicated-oil-pressure-psi</node>
   </chunk>
   

            <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/systems/vacuum/suction-inhg</node>
   </chunk>   
 
   <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/adf/rotation-deg</node>
   </chunk>   
   
      <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/adf/indicated-bearing-deg</node>
   </chunk>

          <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/engines/active-engine/rpm</node>
   </chunk>
   
              <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[0]/to-flag</node>
   </chunk>

                  <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[0]/from-flag</node>
   </chunk>
   
                   <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[0]/radials/selected-deg</node>
   </chunk>   
   
                     <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/nav[0]/gs-needle-deflection</node>
   </chunk>   
 
                       <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/nav[0]/heading-needle-deflection</node>
   </chunk> 
 
                        <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/sim/instrument-options/nav[0]/has-gs-needle</node>
   </chunk> 
 
                          <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/sim/instrument-options/nav[0]/needles-pivot</node>
   </chunk> 

                <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[1]/to-flag</node>
   </chunk>
   
                  <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[1]/from-flag</node>
   </chunk>
   
                   <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/instrumentation/nav[1]/radials/selected-deg</node>
   </chunk>   
   
                     <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/nav[1]/gs-needle-deflection</node>
   </chunk>   
 
                       <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/nav[1]/heading-needle-deflection</node>
   </chunk> 
 
                        <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/sim/instrument-options/nav[1]/has-gs-needle</node>
   </chunk> 
 
                          <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/sim/instrument-options/nav[1]/needles-pivot</node>
   </chunk> 
       
                             <chunk>
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/heading-indicator/indicated-heading-deg</node>
   </chunk> 
   
                             <chunk>
    <type>integer</type>
    <format>%i</format>
    <node>/autopilot/settings/heading-bug-deg</node>
   </chunk>       
   
                 <chunk>           
    <type>float</type>
    <format>%.4e</format>
    <node>/instrumentation/altimeter/setting-inhg</node>
   </chunk>               
 
                <chunk>   
                <type>integer</type>
    <format>%i</format> 
        <node>/consumables/fuel/tank[0]/level-gal_us</node>
           </chunk>   
           
                 <chunk> 
    <type>integer</type>
    <format>%i</format> 
        <node>/consumables/fuel/tank[1]/level-gal_us</node>
           </chunk>     

                   <chunk> 
    <type>integer</type>
    <format>%i</format> 
        <node>/engines/active-engine/egt-degf</node>
           </chunk>   
 
                    <chunk> 
    <type>integer</type>
    <format>%i</format> 
        <node>/systems/electrical/volts</node>
           </chunk>   
 
                     <chunk> 
    <type>integer</type>
    <format>%i</format> 
        <node>/systems/electrical/amps</node>
           </chunk>   

  </output>
 </generic>
</PropertyList>


Each <chunk> section defines which property is sent. These need to be the same as defined in the instrument definition, or those that are aliased. Tip here - make sure that any value that needs decimals is sent as a float.

The next file you need is an XML on the receiving (panel) computer that configures FGpanel. My example below:
Code: Select all
<PropertyList>

  <!-- true: run full-screen, false; run in window -->
  <game-mode type="bool">false</game-mode>

  <!-- include the panel definitions (2d-panel syntax)-->
  <panel include="c172-610x-panel_pi.xml"/>

  <!-- compose your property-tree here -->
  <sim>
    <panel>
      <flip-x type="bool">false</flip-x>
    </panel>
    <instrument-options>
      <omit-knobs type="bool">true</omit-knobs>
    </instrument-options>
  </sim>

  <!-- network communication settings -->
  <communication>
    <listen>
      <!-- interface to bind to,
           leave empty for all interfaces -->
     <host></host>   <!-- multicast address! -->
<!--     <host>192.168.2.197</host> -->  <!-- multicast address! -->
      <port>5432</port> <!-- tcp port to listen to -->
      <style>udp</style> <!-- udp or tcp (forget about tcp!) -->
    </listen>

    <!-- the generic protocol definition

    -->
    <protocol include="panel_drive.xml"/>
  </communication>
</PropertyList>


The important lines in this are:
<panel include="xxxxxxx.xml"/> - the path to and name of the XML above that defines the panel layout
<host> - the IP address of the FG computer. The panel computer will listen for data coming from this computer. if you leave this blank it will listen to all hosts on the network.
<port> the port that the FG computer is sending data on - this has to be specified.
<style> - needs to be UDP
<protocol-include="xxxx"/> - this is path to and name of the file that defines the parameters being sent from the main computer. This needs to be the name and location of the copy of the file on the panel computer

Once these three files are in place, you can launch FG on the main computer and FGpanel on the remote

When launching flightgear, you need to add an additional command line parameter to tell it to transmit the panel data via UDP. for example, add this to the launch parameters:
Code: Select all
--generic=socket,out,25,192.168.3.10,5432,udp,"path_to/panel_drive.xml"


Theres' some parameters you have to specify here:
panel_drive.xml is the path to and name of the file above where you specify which values from the property tree to send
'25' is the frequency of sending the updates in Hz - i.e. in this example is sends 25 updates per second
192.168,3.10 is the IP address to send to - i.e. the IP address of the panel computer
5432 is the port you specified above
udp is the protocol specified above

On the panel computer, you will need a copy of the fgdata directory - in particular the instruments directory, in addition to the FGpanel executable and a possibly a full FG install (FGpanel has some dependencies).

Now, on the panel computer, you can launch FGpanel. I use the non-X version so I use the following syntax:

Code: Select all
fgpanel --fg-root=/path/to/fg/data --panel=Aircraft/MyAircraft/Panels/MyPanel.xml


This should then work, and you have a remote panel :D

Tom
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur

Re: Completely Lost With FGPanel

Postby Hooray » Wed Feb 17, 2021 4:32 pm

it might make sense to update the wiki accordingly, i.e. at the very least by copying your posting to it
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Completely Lost With FGPanel

Postby tom_nl » Wed Feb 17, 2021 5:13 pm

Will do - I registered an account a few weeks ago, so i'll get it copied and pasted in shortly.

Tom
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur

Re: Completely Lost With FGPanel

Postby tom_nl » Wed Feb 17, 2021 8:12 pm

Wiki now updated - feedback welcome https://wiki.flightgear.org/FGPanel

Tom
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur

Re: Completely Lost With FGPanel

Postby BinaryLizard » Thu Feb 18, 2021 12:45 am

Thank you so much for an indepth guide and also updating the wiki as well! Will get working on it now
BinaryLizard
 
Posts: 2
Joined: Wed Feb 17, 2021 8:10 am

Re: Completely Lost With FGPanel

Postby zakalawe » Thu Feb 18, 2021 12:46 pm

FGPanel received some code updates, so it should work nicely on RPi etc. Other option is to use FGQCanvas, for a Canvas-based instrument/panel. (FGQCanvas also works on Android and iOS, but I think it should be possible to port FGPanel to those with a bit of work)
zakalawe
 
Posts: 1259
Joined: Sat Jul 19, 2008 5:48 pm
Location: Edinburgh, Scotland
Callsign: G-ZKLW
Version: next
OS: Mac

Re: Completely Lost With FGPanel

Postby tom_nl » Thu Feb 18, 2021 1:30 pm

I can confirm it works VERY nicely on a Raspberry Pi zero. One of the great things about FGpanel compared to the other solutions, and the reason I went for it, is that it needs barely any computing power, so will run very happily on a PI Zero or Pi 1 which cost peanuts.

On my panel i'm using a raspberry pi zero set up as a USB ethernet gadget connecting to a Mac. On the Mac side I have the ethernet via USB assigned a static IP address (on a different subnet to the house network) and the Raspberry Pi also has a static IP. Eventually once I add extra power to my panel with a separate mains adapter, i'll be able to connect the yoke, The Arduino Mega that drives all the switches and LCD displays, and the Pi that runs FGpanel, all through one USB cable, so keeping things nice and neat and easy to connect and disconnect.

Tom
tom_nl
 
Posts: 84
Joined: Tue Aug 04, 2020 11:41 am
Location: Netherlands
OS: OS X Big Sur


Return to Compiling

Who is online

Users browsing this forum: No registered users and 3 guests