Ysurac / FlightAirMap

Open source project displaying live aircrafts, ships or trackers on 2D/3D map. Browse through the data based on a particular aircraft, airline, airport, tracker or vessel to search through the database or see extensive statistics. Can use ADS-B in SBS1 format (dump1090, Radarcape,...), VRS, VA (VATSIM, IVAO whazzup.txt, phpvms,...), ACARS (acarsdec, acarsdeco2), APRS, AIS as datasource.
https://www.flightairmap.com/
GNU Affero General Public License v3.0
526 stars 159 forks source link

can't fetch the source after install #235

Closed dextercai closed 5 years ago

dextercai commented 8 years ago

today l try to deploy the map on my website. but the source doesnt work. l use a whazzup.txt

$globalSources = array(array('host' => 'http://api.XX.xxx/wzp.txt'));

and the

$globalURL = '/AirMap';

l cant get any planes on the map. how to solve the problem?

dextercai commented 8 years ago

also here is my settings.php

<?php //INSTALLED OR NOT ? $globalInstalled = TRUE;

//GLOBAL SITE NAME $globalName = 'FSCenter Flightradar-24*7';

// GLOBAL URL $globalURL = '/AirMap';

// Logo URL $logoURL = '/images/logo3.png';

// Activate debug $globalDebug = TRUE;

// LANGUAGE $globalLanguage = 'CN'; // Used only for wikipedia links for now

// MAP PROVIDER $globalMapProvider = 'Google-Hybrid'; // Can be Mapbox, OpenStreetMap, MapQuest-OSM or MapQuest-Aerial $globalMapboxId = ''; // Mapbox id $globalMapboxToken = ''; // Mapbox token $globalGoogleAPIKey = 'xx'; $globalBingMapKey = 'xx'; $globalHereappID = ''; $globalHereappCode = ''; $globalMapQuestKey = '';

// MAP 3D $globalMap3D = FALSE; // User can choose 3D map $globalMap3Ddefault = FALSE; // Display 3D map by default $globalMapSatellites = FALSE; // Display satellites on 3D map

//COVERAGE AREA (its based on a box model. i.e. top-left | top-right | bottom-right | bottom-left) $globalLatitudeMax = '53'; //the maximum latitude (north) $globalLatitudeMin = '3.5'; //the minimum latitude (south) $globalLongitudeMax = '135.1'; //the maximum longitude (west) $globalLongitudeMin = '73.5'; //the minimum longitude (east)

$globalCenterLatitude = '31'; //the latitude center of your coverage area $globalCenterLongitude = '121';//the longitude center of your coverage area

$globalLiveZoom = '5'; //default zoom on Live Map $globalAirportZoom = '7'; //default zoom to begin to display airports icons

// FLIGHTS MUST BE INSIDE THIS CIRCLE $globalDistanceIgnore = array(); // ^^ example for 100km : array('latitude' => '46.38','longitide' => '5.29','distance' => '100');

// DATABASE CONNECTION LOGIN $globalDBdriver = 'xx'; // PDO driver used. Tested with mysql, maybe pgsql or others work... $globalDBhost = 'xx'; //database connection url $globalDBuser = 'xx'; //database username $globalDBpass = 'xx'; //database password $globalDBname = 'xx'; //database name $globalDBport = 'xx'; //database port $globalTransaction = TRUE; //Activate database transaction support

//FLIGHTAWARE API INFO $globalFlightAware = FALSE; //set to TRUE to use FlightAware as data import $globalFlightAwareUsername = ''; //FlightAware Username $globalFlightAwarePassword = ''; //FlightAware Password/API key

// TIMEZONE $globalTimezone = 'Asia/Shanghai';

// DAEMON $globalDaemon = TRUE; // Run cron-sbs.php as daemon (don't work well if source is a real SBS1 device) $globalCronEnd = '0'; //the script run for xx seconds if $globalDaemon is disable in SBS mode

// FORK $globalFork = FALSE; // Allow cron-sbs.php to fork to fetch schedule, no more schedules fetch if set to FALSE

// MINIMUM TIME BETWEEN UPDATES FOR HTTP SOURCES (in seconds) $globalMinFetch = '50';

// DISPLAY FLIGHT INTERVAL ON MAP (in seconds) $globalLiveInterval = '200';

// MINIMAL CHANGE TO PUT IN DB $globalCoordMinChange = '0.02'; // minimal change since last message for latitude/longitude (limit write to DB)

// LIVE MAP REFRESH (in seconds) $globalMapRefresh = '30';

// IDLE TIMEOUT (in minutes) $globalMapIdleTimeout = '30';

// DISPLAY INFO OF FLIGHTS IN A POPUP $globalMapPopup = FALSE; // DISPLAY INFO OF AIRPORTS IN A POPUP $globalAirportPopup = FALSE;

// DISPLAY ROUTE OF FLIGHT $globalMapRoute = TRUE;

// DISPLAY FLIGHTS PATH HISTORY $globalMapHistory = FALSE;

// FLIGHT ESTIMATION BETWEEN UPDATES $globalMapEstimation = TRUE;

// WRAP MAP OR REPEAT $globalMapWrap = TRUE;

// ALLOW SITE TRANSLATION $globalTranslate = TRUE;

// UNITS $globalUnitDistance = 'nm'; // km, nm or mi $globalUnitAltitude = 'feet'; // m or feet $globalUnitSpeed = 'knots'; // kmh, knots or mph

// * Virtual flights * //IVAO $globalIVAO = FALSE;

//VATSIM $globalVATSIM = FALSE;

//phpVMS $globalphpVMS = FALSE;

//User can choose between IVAO, VATSIM or phpVMS $globalMapVAchoose = FALSE; // ****

//ADS-B, SBS1 FORMAT $globalSBS1 = FALSE; //set to FALSE to not use SBS1 as data import $globalSourcesTimeOut = '15'; $globalSourcesupdate = '10'; //Put data in DB after xx seconds/flight //DATA SOURCES $globalSources = array(array('host' => 'http://api.xx.xx/wzp.txt')); // ^^ in the form array(array(host => 'host1', 'port' => 'port1','name' => 'first source','format' => 'sbs'),array('host' => 'host2', 'port' => 'port2','name' => 'Other source', 'format' => 'aprs'),array('host' => 'http://xxxxx/whazzup.txt')); Use only sources you have the rights for.

//ACARS Listen in UDP $globalACARS = FALSE; $globalACARSHost = '0.0.0.0'; // Local IP to listen $globalACARSPort = '9999'; $globalACARSArchive = array('10','80','81','82','3F'); // labels of messages to archive $globalACARSArchiveKeepMonths = '0';

//APRS configuration (for glidernet) $globalAPRS = FALSE; $globalAPRSversion = $globalName.' using FlightAirMap'; $globalAPRSssid = 'FAM'; $globalAPRSfilter = 'r/'.$globalCenterLatitude.'/'.$globalCenterLongitude.'/250.0'; $globalAPRSarchive = FALSE; // archive track of APRS flights

//User can choose between APRS & SBS1 //$globalMapchoose = FALSE;

//Minimal distance to tell if a flight is arrived to airport (in km) $globalClosestMinDist = '50';

// To display Squawk usage we need Squawk country for now $globalSquawkCountry = 'US';

//BIT.LY API INFO (used in the search page for a shorter URL) $globalBitlyAccessToken = ''; //the access token from the bit.ly API

//British Airways API info $globalBritishAirwaysKey = '';

// Lufhansa API info $globalLufthansaKey = array('key' => '','secret' => '');

// Transavia API info $globalTransaviaKey = '';

// Default aircraft icon color for 2D map $globalAircraftIconColor = '1a3151';

// Display altitude in color $globalMapAltitudeColor = TRUE;

// Size of icon on 2D map ('' for default => 30px if zoom > 7 else 15px) $globalAircraftSize = '';

//ignore the flights during imports that have the following airports ICAO (departure/arrival) associated with them $globalAirportIgnore = array(); //accept the flights during imports that have the following airports ICAO (departure/arrival) associated with them $globalAirportAccept = array();

//ignore the flights that have the following airline ICAO $globalAirlineIgnore = array(); //accept the flights that have the following airline ICAO $globalAirlineAccept = array();

//accept the flights that have the following pilot id (only for VA) $globalPilotIdAccept = array();

// * Archive * //Archive all data $globalArchive = TRUE;

//Archive data olders than xx months (if globalArchive enabled, else delete) (0 to disable) $globalArchiveMonths = '1';

//Archive previous year (if globalArchive enabled, else delete) $globalArchiveYear = FALSE;

//Keep Archive track of flight for xx months (0 to disable) $globalArchiveKeepTrackMonths = '1';

//Keep Archive of flight for xx months (0 to disable) $globalArchiveKeepMonths = '1'; // ****

//NOTAM $globalNOTAM = FALSE; $globalNOTAMSource = ''; //URL of your feed from notaminfo.com

//METAR $globalMETAR = TRUE; $globalMETARcycle = FALSE; // If update_db.php in cron job, all METAR are downloaded from NOAA // else put an url as METAR source, can be vatsim. $globalMETARurl = 'http://metar.vatsim.net/{icao}'; // Use {icao} to indicate where airport icao must be put in url

//Retrieve private Owner $globalOwner = FALSE;

// * Aircraft pics * //Retrieve Image from externals sources $globalAircraftImageFetch = TRUE; //Sources for Aircraft image $globalAircraftImageSources = array('ivaomtl','wikimedia','airportdata','deviantart','flickr','bing','jetphotos','planepictures','planespotters','customsources'); // Custom source configuration {registration} will be replaced by aircraft registration (exif get copyright from exif data for each pic) // example of config : $globalAircraftImageCustomSources = array('thumbnail' => 'http://pics.myurl.com/thumbnail/{registration}.jpg','original' => 'http://myurl/original/{registration}.jpg','source_website' => 'https://www.myurl.com', 'source' => 'customsite', 'exif' => true); // ****

//Retrieve schedules from externals sources (set to FALSE for IVAO or if $globalFork = FALSE) $globalSchedulesFetch = FALSE; //Sources for airline schedule if not official airline site $globalSchedulesSources = array('flightmapper','costtotravel','flightradar24','flightaware');

//Retrieve translation from external sources (set to FALSE for IVAO) $globalTranslationFetch = FALSE; //Sources for translation, to find name of flight from callsign $globalTranslationSources = array();

$globalVAM = FALSE;

$globalUseRealAirlines = FALSE;

$globalWaypoints = true; ?>

Ysurac commented 8 years ago

Your source can't be detected, you have to set the format:

$globalSources = array(array('host' => 'http://api.XX.xxx/wzp.txt','format' => 'whazzup'));

You also should set $globalVATSIM to TRUE

dextercai commented 8 years ago

after set the $globalVATSIM and $globalSources but the AIRCRAFTS DETECTED still cant show the number also have no plane

Ysurac commented 8 years ago

Are you running scripts/spotter-daemon.php ? What is the output ?

dextercai commented 8 years ago

run the scripts/spotter-daemon.php but nothing output.

dextercai commented 8 years ago

it just keeps executing but no any output

dextercai commented 8 years ago

PHP Fatal error: Maximum execution time of 150 seconds exceeded in D:\WEB\www\wwwroot\AirMap\scripts\daemon-spotter.php on line 329

Ysurac commented 8 years ago

No output ? should not be possible... You run it in a console ?

dextercai commented 8 years ago

console?

dextercai commented 8 years ago

l use the map at a iis server.

Ysurac commented 8 years ago

Never tested on iis, should not work. Console => not from a web browser, as a script.

dextercai commented 8 years ago

well, l run the script again. the plane isnt there, but it display the tower.

Ysurac commented 8 years ago

Script can't be run from a web browser. It should be run as a daemon or a cron job.

dextercai commented 8 years ago

can l use the cmd to run it?

Ysurac commented 8 years ago

I think.

php daemon-spotter.php
dextercai commented 8 years ago

PHP Parse error: syntax error, unexpected T_FUNCTION in D:\WEB\www\wwwroot\AirMap\scripts\daemon-spotter.php on line 69

X-Powered-By: PHP/5.2.17 Content-type: text/html


Parse error: syntax error, unexpected T_FUNCTION in D:\WEB\www\wwwroot\AirMap\scripts\daemon-spotter.php on line 69

Ysurac commented 8 years ago

Maybe it's because PHP 5.2 is too old. At least PHP 5.4 is needed.

dextercai commented 8 years ago

PS C:\Users\Administrator> php D:\WEB\www\wwwroot\AirMap\scripts\daemon-spotter.php

ALSO NO OUTPUT.

Ysurac commented 8 years ago

PS ? Do you update to PHP 5.4 or more ?

dextercai commented 8 years ago

sure l had tried on php5.5 and 5.4 .both no output

PS is the windows sever shell

dextercai commented 8 years ago

I think we can change cyclic code of daemon into the other type. and it can be run in the browser, so we can just access the update page every 5 minutes or longer. that will be friendly to the iis

Ysurac commented 8 years ago

daemon-spotter.php should always have an output. Using it by a web browser is not a good idea. A service under windows can be used for example.

dextercai commented 8 years ago

a service? that may be means it will be write in C. is there any other possible to make the map work well with the iis ?

Ysurac commented 8 years ago

There is many program to run a php script as a service like alwaysup, runasservice,... It may be possible to run the map with IIS but you will have to translate the .htaccess to a web.config for IIS. I can't try anything under Windows, I don't have it.

dextercai commented 8 years ago

only the problem of the htaccess? if it is, l think l can solve quickly and deal with the php scirpt. also l will post the web.config

dextercai commented 8 years ago

ok,l think here is a way. I found my own script to record flight time. Then l ask it to run every 5 minutes. it works well. If l make it code in a order. But it is not circular. maybe it will work. Perhaps this reduces the reliable and timeliness of the whole system. But the map will work relatively well with iis

Ysurac commented 8 years ago

The htaccess is used to rewrite path to php files. If the in require/settings.php, $globalDaemon is set to FALSE, the file can be run like a cronjob, so every xx minutes.

dextercai commented 8 years ago

ok, thank you told me so much. I'll try later. And post the web.config for the IIS7.

dextercai commented 8 years ago

the cron works well, but why it cant display anything on the map? and the source have data.

dextercai commented 8 years ago

Also the number on the right-top just keep going on circle.

Ysurac commented 8 years ago

The circle mean no flights are detected. So spotter-deamon.php don't work well. Run it as php daemon-spotter.php on command line and check the output.

dextercai commented 8 years ago

after run in a command line. it says "no airport near last coord" still have no display on the map.

Ysurac commented 8 years ago

This can't be the only output. Are you sure that your source file is in wazzup format and have data ?

dextercai commented 8 years ago

yep. not the only. but the error info. other message is just like

Connect to whazzup source (http://xx.xx/wzp.txt)... Connected! SCAN MODE *** New aircraft hex : 303031 ***

and so on.. after each the flight there is a error info no airport near last coord

lm sure that my whazzup source is in whazzup format and have data.

Ysurac commented 8 years ago

no airport near last coord is not an error. At least it find aircraft. You run it as a cronjob ? Do you have flights in Latest activity page ? In require/settings.php, $globalLiveInterval must be higher than the interval of the cronjob.

dextercai commented 8 years ago

sorry but l cant understand the $globalLiveInterval higher than the interval of the cronjob.

Ysurac commented 8 years ago

If you set cron job to run the script every 1 minutes, $globalLiveInterval must be set the a value higher than 60 (try 800 for example)

dextercai commented 8 years ago

it was all correct, no plane but the atc here is a part of my wzp data

FDX0708:0000:ZGGG_TWR:PILOT::23.402010:113.322480:0:0:MD11:470:ZGGG:36100:ZPPP:XXXX1:1:0:0:40:0:I:0:0:9:0:0:0:ZPPP:English Crew:B330 GYA A599 LBN A599 LXI:::::::20161116114751

Ysurac commented 8 years ago

Should work, only the name of the pilot, ZGGG_TWR, is quite strange for a pilot. This shouldn't change anything but $globalVATSIM should be set to FALSE and $globalIVAO set to TRUE. Sorry. Do you have something in Latest activity page ?

dextercai commented 8 years ago

still nothing :(

dextercai commented 8 years ago

there is also no data in the database but the atc. so the atc circle is displayed

Ysurac commented 8 years ago

Without the source I can't do anything. I tested with the official ivao whazzup.txt file with latest commit and all is working fine.

dextercai commented 8 years ago

any possible because the airport is not exist in the database? l test the ivao file, too. works well. :question:

Ysurac commented 8 years ago

No, it's not a problem.

Ysurac commented 8 years ago

Using your line in a txt file, I can see it in the Latest activity page. So no bugs here.

dextercai commented 8 years ago

Perhaps this is not supported to iis, Anyway, thank you so much.

dextercai commented 8 years ago

Perhaps this is not supported to iis, Anyway, thank you so much.

dextercai commented 8 years ago

is the map read the flight data from the database or the source directly.

Ysurac commented 8 years ago

From the database. spotter-daemon.php is used to populate the DB from the source.