Board index FlightGear Support Interfacing

Webpanel url  Topic is solved

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

Webpanel url

Postby rooman » Tue Dec 27, 2022 8:22 pm

Stupid newbie question;
The c172 web panel works as instructed.
However I'm trying to use it with another plane.
I created the webpanel folder in
/usr/share/games/flightgear/Aircraft/Cessna337
This is the FG root install (Ubuntu)

I also put the folder in
/home/andrew/.fgfs/Aircraft/org.flightgear.fgaddon.stable_2020/Aircraft/Cessna337
Where the plane is installed.

But I cannot find the correct url to show the copied webpanel when I choose to fly with the 337
Grew up with Dr Who then discovered Monty Python and Middle Earth. The world was never the same.
rooman
 
Posts: 188
Joined: Sun Apr 12, 2015 7:26 pm
Location: Lausanne, Switzerland
Callsign: HB-ROO
Version: Next + LTS
OS: Ubuntu latest stable

Re: Webpanel url  

Postby rooman » Wed Dec 28, 2022 4:42 pm

got it showing by putting the WebPanel folder at;
/home/andrew/.fgfs/Aircraft/org.flightgear.fgaddon.stable_2020/Aircraft/Cessna337

and pointing the browser to;
http://localhost:8080/aircraft-dir/WebPanel/webpanel.html

when flying the 337.

Having removed references to the c172p in file names and inside the html file
Grew up with Dr Who then discovered Monty Python and Middle Earth. The world was never the same.
rooman
 
Posts: 188
Joined: Sun Apr 12, 2015 7:26 pm
Location: Lausanne, Switzerland
Callsign: HB-ROO
Version: Next + LTS
OS: Ubuntu latest stable

Re: Webpanel url

Postby Volador » Sat Mar 11, 2023 9:09 pm

Hi Rooman, (thank for your recent help). Regarding your post, are you saying you need to change the code in the html every time you switch aircraft and keep the same url on the device showin g the web page? So there is only ever one location for webpanel? SurferTim said something that suggested that there may indeed be an individual webpanel.html for each aircraft (that had one in it's sub folders)
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit

Re: Webpanel url

Postby SurferTim » Sun Mar 12, 2023 10:08 am

The WebPanels html file can be the same name, but I keep the aircraft type in the filename to avoid confusion.

It doesn't even need to be a WebPanel. Phi will serve up any html doc.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1718
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: Webpanel url

Postby Alant » Sun Mar 12, 2023 10:33 am

It would be useful if the local IP address used by the server machine (i.e. the machine running flightgear) was available in the property tree so that it could be displayed when phi is started.
Alan
Alant
 
Posts: 1223
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: Webpanel url

Postby SurferTim » Sun Mar 12, 2023 10:38 am

The functions ifconfig (Linux) and ipconfig (Windows) run in the FG computer will show the localnet ips. Simple enough.

Unless you set those as static, the IP could change if using dhcp.

Edit: I had to try this first. If you change the filename to index.html, you don't need a filename in the URL
http://192.168.1.20:8080/aircraft-dir/WebPanel/
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1718
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: Webpanel url

Postby Alant » Sun Mar 12, 2023 12:22 pm

Yes, but it would be more helpful if, when starting Phi, instead of a pop-up window saying "The file is shown in your web browser window", a message saying "open a web browser at 192.168.1.44/map" (or other local network address) were shown.
Alan
Alant
 
Posts: 1223
Joined: Wed Jun 23, 2010 6:58 am
Location: Portugal
Callsign: Tarnish99
Version: latest Git
OS: Windows 10/11

Re: Webpanel url

Postby SurferTim » Sun Mar 12, 2023 12:29 pm

That would be helpful if running Phi on the server. I'll have to check if Phi supports php.

Edit: Phi does not support php. Not a bad idea. I'll think about it.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1718
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: Webpanel url

Postby wkitty42 » Sun Mar 12, 2023 2:04 pm

Alant wrote in Sun Mar 12, 2023 10:33 am:It would be useful if the local IP address used by the server machine (i.e. the machine running flightgear) was available in the property tree so that it could be displayed when phi is started.

which "local IP address"?? one of my FG systems has no less than 6 IP addresses and FG listens for connections on all of them...

it is easier to add the FG system to a/the "static DNS" definitions in one's router or in the hosts files so you have a name for the machine associated with its IP address(es)... then you use the name instead of "localhost" or an IP address...

eg hosts file with two IPs for one system:
Code: Select all
192.168.99.7          myflightgear
192.168.99.8          myflightgear


now using "http://myflightgear:5500/#Map" will connect to FG on port 5500 and load the Phi map to follow the craft... the connection will use which ever one of the IPs it can reach so if one is down, the other should work...
"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: 9161
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04

Re: Webpanel url

Postby SurferTim » Sun Mar 12, 2023 2:50 pm

I thought about it. It's not just knowing the IP, but you must knock a hole in your firewall. Getting the IP is the easy part.
Fly low. Fly slow. Land on a dime. Twin Otter. https://github.com/SurferTim/dhc6p
My other aircraft is a Citation-X https://github.com/SurferTim/CitationX
PirateAir videos at https://www.youtube.com/user/SurferTim850
User avatar
SurferTim
 
Posts: 1718
Joined: Sun Dec 09, 2018 6:49 pm
Location: Miramar Beach, FL
Callsign: Pirate
Version: 2020.4.0
OS: Ubuntu 18.04

Re: Webpanel url

Postby Volador » Mon Mar 13, 2023 10:50 am

To update on my question, it seems that the android app doesn't care which aircraft you are in after you've set it up and the data is being sent to it. I've yet to tinker with the interactivity back to FG, I think you can assign switches and change some values from the tablet or phone. I still don't see the OSM map for some reason, just a basic icon for your plane
User avatar
Volador
 
Posts: 1142
Joined: Tue Sep 01, 2020 4:58 pm
Callsign: Volador, G-VLDR
Version: 2020.4
OS: Windows 10, 64 bit


Return to Interfacing

Who is online

Users browsing this forum: No registered users and 3 guests