Board index FlightGear Support Interfacing

Does Avare really work with FlightGear?  Topic is solved

Connecting two computers, using generic protocol, connecting with Matlab?

Does Avare really work with FlightGear?

Postby pb321 » Sun Feb 16, 2020 8:54 pm

I'm trying to get Avare and Avare I/O to communicate with FlightGear. It seems like it would be a great addition when flying, providing plates, maps of all kinds (including weather maps), aircraft position tracking, etc., all on an Android phone or tablet. It uses an xml file placed in $FG_ROOT\data\protocol to communicate along with the following command line:

fgfs.exe –generic=socket,out,2,192.168.1.124,49002,udp,Avare_protocol

Notes on the above command line:
  • Updates per second (2, try different values here to exercise Avare)
  • IP address to send packets to (192.168.141, use the IP shown in the add-on Avare External I/O Plugin app)
  • port to send to (49002 is default, this must match with the port the add-on Avare External I/O Plugin app is listening on)
  • Protocol (udp)
  • Protocol definition to use (the name of the file you copied earlier)

Avare I/O connects to the network and displays the IP address of your device, giving the IP address to enter into the command line above (replaces 192.168.1.124). 49002 is also displayed as the port to enter into the same command line. However, no communication starts (at least not for me) using this address/port. Here is a link to the discussion "Connecting to FlightGear Flight Simulator (Windows)" on the Avare website: https://apps4av.net/site/avare-plugin-for-external-io/#fg

One post on the Avare Forum from back in 2013 states that FG version 3.0 will have the communication parameters built into it, but I find no further discussion of this on either the Avare forum or the FG forum. Here is what a search brought up on this forum: https://forum.flightgear.org/search.php?keywords=avare&fid%5B0%5D=36

Does anyone know if Avare will actually work with FlightGear, as advertised on the Avare website? If so, what am I doing wrong or what might I try?

Thanks in advance!!
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby pb321 » Tue Feb 18, 2020 6:54 pm

I found a problem/solution of the SkyDemon website. SkyDemon is a flight planning tool that works with FlightGear and other simulators. It uses a "foreflight" protocol that is included in $FG_Root/data/protocol. The foreflight protocol is used by X-Plane to connect with Avare and I have had success connecting Avare to X-Plane. Here's a partial description from the SkyDemon website:

It turns out that XGPS1 is implemented in flightgear already under the name "foreflight-xgps". So all that was needed was "--generic=socket,out,2,192.168.0.165,49002,udp,foreflight-xgps" (changing 192.168.0.165 to the tablet's IP address as needed) and flightgear works with SkyDemon without any other effort.


The Avare generic protocol to be used with FlightGear is very similar to foreflight-xgps, so it would seem it SHOULD work. As I stated above, X-Plane works with Avare just fine. So would something be blocking sending port 49002 within FlightGear 2019.2.0? Any other thoughts or ideas?
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby pb321 » Tue Feb 25, 2020 7:25 pm

So I've opened the specific ports used by Avare in the Windows Defender Firewall - Advanced Security, setting an Inbound Rule for UDP ports 49000-49001 and an Outbound Rule for UDP port 49002. When I use the Netstat -p UDP command (elevated prompt), nothing shows up. Shouldn't the ports I opened show up? I've also tried Netstat -aon and the ports don't show up. This would seem to indicate the ports are NOT open, correct?
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby wkitty42 » Tue Feb 25, 2020 8:05 pm

you have to have a client or a server on those ports for them to be seen, don't you? you cannot just open then with nothing anchored to them and have them appear ;)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 6493
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Does Avare really work with FlightGear?

Postby WoodSTokk » Tue Feb 25, 2020 10:26 pm

Per default netstat show you all established connections. UDP work connectionless (there is no handshake in UDP).
To see open ports, use the -l (or --listening) parameter. To see only UDP use the -u (or --udp) parameter.

So, quick for all open UDP ports use:
Code: Select all
netstat -uln


PS: the -n (--numeric) parameter avoid name resolving.
WoodSTokk
 
Posts: 543
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: Does Avare really work with FlightGear?

Postby pb321 » Tue Feb 25, 2020 11:42 pm

Thank you @wkitty42 and @WoodSTokk! I very much appreciate your help. I'm not sure I completely understand what you've said...yet.

I have tried several things today and found out the following:

X-Plane uses the following ports: receives on 49000; sends from 49001; sends to 49002. If I look at these ports in the Netstat listing, I don't see any of them when running X-Plane. So I assume I will not see any when running FlightGear either. If I understand correctly, you have both said this in a somewhat different way. Correct?

Unfortunately, I found out the linux version of netstat includes the -l (listening) and -u parameters but the Windows version does not (lucky Windows users :( ). But I used the -a to show ALL ports and the -p UDP Windows command to view only UDP ports. Neither showed ports 49000-49002.

So, for what I'm trying to determine, will the Netstat command help at all? If I understand correctly, it will not.

Is there a way to determine what exactly is going wrong? to troubleshoot the problem?
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby WoodSTokk » Wed Feb 26, 2020 4:18 am

I see you have only one dash in front of the parameter but it should be two and it looks like your dash is the wrong: '–' insteed of '-' (maybe the forum software change it?).
I have a look in the protocol directory of FG and the xml file is named 'avare'.
So the right commandline should be:
Code: Select all
fgfs.exe --generic=socket,out,2,192.168.1.124,49002,udp,avare
WoodSTokk
 
Posts: 543
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: Does Avare really work with FlightGear?  

Postby pb321 » Wed Feb 26, 2020 7:16 pm

I had tried to connect Avare once before my most recent attempt and I remember reading someone renaming the file Avare_protocol.xml to avare.xml, so I thought that is how I got a "avare.xml" in the fgdata/protocol directory. I realize now (thank you, @WoodSTokk) that avare.xml is included in FGData! I had been following the instructions on the Avare website, which requires copying a script and naming it Avare_protocol.xml. I copied the script and pasted it into Notepad++. So now I've deleted the Avare_protocol file and am referencing the avare.xml file included with FlightGear. I will let the Avare developers know that the script is included in FlightGear so they can change their instructions.

I have been using the Launcher and putting the Avare line
Code: Select all
-–generic=socket,out,2,192.168.2.236,49002,udp,avare
" in Additional Settings. (The IP is the IP of my Android device). So I tried starting FlightGear from the command line with:
Code: Select all
fgfs -–generic=socket,out,2,192.168.2.236,49002,udp,avare

It worked!!

I then quit and tried the launcher again, without success. Finally, I re-typed the Avare "--generic=socket, etc." line in Additional Settings. It "looked" identical to the line as I had entered it before. I deleted the old line, leaving the newly typed line in place, then re-started FG. It worked!!
So the problem apparently was an invisible character in the Avare startup command!!
Thanks very much for your help! It works very well now!
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby WoodSTokk » Wed Feb 26, 2020 9:35 pm

I presume the command line in your first post was copy&paste, so i look closer to the line.
The dash is called 'en dash' and has the unicode 0x2013 --> http://www.fileformat.info/info/unicode/char/2013/index.htm
On the command line we use only the normal dash, called 'hyphen' (unicode 0x002D) --> http://www.fileformat.info/info/unicode/char/002d/index.htm
I dont know where the line in your first post came from, but the dash is absolutally wrong on this place.
Insteed of the 'en dash' there should be two 'hyphen'.

But at the end it is nice that all work well now.

EDIT:
Found the source of the false character --> https://apps4av.net/site/avare-plugin-for-external-io/#fg
I think the user 'R Eart' in the avare furum are you.
Please tell the guys they have a bad formated line (wrong character) on there website and it should be updated.
WoodSTokk
 
Posts: 543
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: Does Avare really work with FlightGear?

Postby pb321 » Thu Feb 27, 2020 12:54 am

Thank you for looking further into this, @WoodSTokk! You've found the source of the problem and I will let Avare developers know what you've discovered. So now I'm a believer, Avare DOES work with FlightGear.

Unfortunately, I've found that I spoke too soon. Things are working intermittently but not well. When the communication starts, I can immediately view the data sent by FlightGear and received by the Avare I/O app as it occurs (or close). However, after a short time communication stops and the plane icon on the Avare sectional also stops. Communications seems to be lost and closing and reopening the Avare programs does not resume the communications.

Any ideas to overcome this problem or is my computer just too slow?
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby pb321 » Thu Feb 27, 2020 3:01 am

Found that Avare and Avare I/O work much better on my phone than on my Fire HD tablet. The moving map stops now and then, but Avare I/O continues to receive data from FlightGear. Clicking "Menu" on the moving map and toggling "Navigate" to "Simulation" and back gets the map going again.
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro

Re: Does Avare really work with FlightGear?

Postby Puffergas » Fri Mar 13, 2020 12:07 am

Avare has been working flawless for me. Maybe something here might help:

http://wiki.flightgear.org/Raspberry_Pi4_How_To#Avare
Puffergas
 
Posts: 49
Joined: Thu Jan 02, 2020 1:09 am

Re: Does Avare really work with FlightGear?

Postby pb321 » Fri Mar 13, 2020 1:53 am

I'll have to try Avare on my Pi3 B+. Maybe it will work better.
Nice writeup! Thank you!
Do you think FlightGear will run on a Pi3 B+?
pb321
 
Posts: 240
Joined: Sun Nov 27, 2016 4:08 pm
Version: 2020.2.1
OS: Windows 10 Pro


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 1 guest