FlightAirMap icon indicating copy to clipboard operation
FlightAirMap copied to clipboard

daemon_acars.php error

Open ocascante opened this issue 6 years ago • 37 comments

Hello, Just installed FlightAirMap and running the script daemon_acars.php got this error:

#!/usr/bin/php Can't calculate geoid, check that you downloaded it via update_db.php (Exception: /var/www/html/FlightAirMap/require/../data/egm96-15.pgm doesn't exist in /var/www/html/FlightAirMap/require/class.GeoidHeight.php:46 Stack trace: #0 /var/www/html/FlightAirMap/require/class.SpotterImport.php(60): GeoidHeight->__construct() #1 /var/www/html/FlightAirMap/require/class.ACARS.php(30): SpotterImport->__construct(Object(PDO)) #2 /var/www/html/FlightAirMap/scripts/daemon-acars.php(20): ACARS->__construct(NULL, true) #3 {main})

S.O: Ubuntu Desktop 16.04 Any idea? Thanks

ocascante avatar Dec 12 '17 21:12 ocascante

It's what the warning say: you have Geoid support enabled but you didn't run the script update_db.php and the file data/egm96-15.pgm doesn't exist. So, you should run update_db.php script to download the file.

Ysurac avatar Dec 12 '17 21:12 Ysurac

I forgot to mention that I had already executed the script update_db.php and even then I have that error.

El 12 dic. 2017 3:29 p. m., "Ycarus" [email protected] escribió:

It's what the warning say: you have Geoid support enabled but you didn't run the script update_db.php and the file data/egm96-15.pgm doesn't exist. So, you should run update_db.php script to download the file.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Ysurac/FlightAirMap/issues/379#issuecomment-351200392, or mute the thread https://github.com/notifications/unsubscribe-auth/AOYM8xRNPDjSdHB7eFQSf-j3GOXtJxmAks5s_vAcgaJpZM4Q_o-M .

ocascante avatar Dec 13 '17 00:12 ocascante

It's only a warning, not an error. The script will function even without geoid. How do you run update_db.php (in a shell ? a cronjob ?) and what was the output ? I see the #!/usr/bin/php at the beginning of your paste, it's strange, you don't run this script via a web browser ? because no script will run correctly from web browser.

Ysurac avatar Dec 13 '17 06:12 Ysurac

Hello, I run the script first from a linux terminal, then from the web, in both cases I got the same error. I am the webmaster of www.ti0rhu.org, the official website of TI0RHU a radio amateurs club in Costa Rica and we are publishing a series of articles about the functions of the sdr ( software defined radios ) on linux. I am interested in making an article presenting FlightAirMap, a software that I find very interesting but I must try it before. I will perform a clean installation process from the beginning to verify each step of it. Thanks.

ocascante avatar Dec 13 '17 20:12 ocascante

Nice website

If you follow https://github.com/Ysurac/FlightAirMap/wiki/Installation all should work.

The daemon-acars.php is for ACARS data only, to use it you can follow this page: https://github.com/Ysurac/FlightAirMap/wiki/ACARS

The geoid warning is only a warning, the script will work without any problem.

Ysurac avatar Dec 13 '17 21:12 Ysurac

Hello, This is the result of the installation: Environment: Ubuntu Desktop 16.04 64 Bits Mysql Server Ver 14.14 Distrib 5.7.20, for Linux (x86_64) Php PHP 7.0.25-0ubuntu0.16.04.1 Apache 2.0+

First, with all the php and host options correctly defined i got this error: captura de pantalla_2017-12-13_14-55-44

Then go to install/index.php with this output: captura de pantalla_2017-12-13_15-12-14

Then run ./update_db.php and populate databases ok.

On google chrome or firefox flightairmap on localhost run ok. captura de pantalla_2017-12-13_15-26-58

Finally run acars: ./acarsdec -N 127.0.0.1:9999 -r 0 131.525 131.550 131.725 ok and run ./daemon_acars.php script:

captura de pantalla_2017-12-14_14-43-59

No data aircraft detected by the acars are displayed on the screen.

Menu options have the same error: captura de pantalla_2017-12-13_15-36-52

ocascante avatar Dec 14 '17 21:12 ocascante

What is the install script say is right, it's why you can't access the aircraft page. You have an error in your Apache configuration or the .htaccess is not available. You can't see anything on map because of the above error (and you will not see many flights if you use ACARS source because many don't have coordinate in them).

For the install/index.php hang, I think you checked the box to create the DB but this don't work with MySQL >= 5.7. Strange that update_db.php can work with that...

Ysurac avatar Dec 14 '17 21:12 Ysurac

It seems that there are some errors in the installation in ubuntu 16.04, I am trying to verify what they can be, the acars already works fine: captura de pantalla_2017-12-14_16-09-41

, but there is some error in the $ globalInstalled parameter, and it does not allow the setup again. After cleaning the browser cache it keeps giving the same error: captura de pantalla_2017-12-14_16-16-01

and

captura de pantalla_2017-12-14_16-18-20

I will continue reviewing and keeping you informed

ocascante avatar Dec 14 '17 22:12 ocascante

Maybe you use a wrong commit, I updated install script a lot by adding a password identification. You can also check that you don't have $globalInstalled twice in require/settings.php

I never tried install under ubuntu, if it's like under Debian, maybe you have to use: a2enmod rewrite

Your $globalURL is strange but ok if you use an URL like: http://127.0.0.1/fam.com/

Ysurac avatar Dec 14 '17 22:12 Ysurac

I checked the settings.php file and there is only one line with the $ globalInstalled option correctly initialized in FALSE, also use the command to set the mod_rewrite: image

the reason of the $ globalURL parameter is because I configure a virtual host for testing ( I'm an LInux and open software engineer )

I will continue testing all

ocascante avatar Dec 15 '17 14:12 ocascante

With latest commit, $globalInstalled really work without problem, I tested under a new docker. If a password is defined, it can be used to access install script.

For the rewrite, I really think it's an Apache configuration error: https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration

Ysurac avatar Dec 15 '17 16:12 Ysurac

The apache configuration is as indicated in the link https://github.com/Ysurac/FlightAirMap/wiki/Apache-configuration meanwhile, as a comment the first time you run /install/index.php you get: captura de pantalla_2017-12-13_15-12-14 if you run again: captura de pantalla_2017-12-13_15-23-36

ocascante avatar Dec 16 '17 00:12 ocascante

Strange, rewrite should work... Do you have something about that in apache log ?

You shouldn't have the Create database part if the create database checkbox is not checked. I will make some tests. The install script is able to recover from error, it's why you can run it again when there is a failure.

Ysurac avatar Dec 16 '17 06:12 Ysurac

As I have several virtual hosts on my test computer, I will install a clean lamp server to perform the installation of the flightairmap again, in a really clean environment.

ocascante avatar Dec 16 '17 14:12 ocascante

The following is the flightairmap software installation process performed on my server, and the results obtained. It is assumed that the Lamp server is already installed using taskel and properly configured for current on localhost. Also have installed the php options according to the wiki howto, curl, pdo, etc. and Mod Rewrite On. (sudo a2enmod rewrite)

Work environment: Ubuntu 16.04 Apache 2.4.18 Php PHP 7.0.25 Mysql 5.7.20

1- Step Create Directory sudo mkdir -p /var/www/flightairmap.com/public_html

2- Step Grant Permissions sudo chown -R www-data:www-data /var/www/flightairmap.com/public_html

3- Step Mofify permissions on /var/www sudo chmod -R 755 /var/www

4- Step Download Flightairmap software and unzip all files into /var/www/flightairmap.com/public_html

5- Step Create new virtual host Create a new conf file and .htaccess: sudo nano /etc/apache2/sites-available/flightairmap.com.conf content:

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName flightairmap.com ServerAlias www.flightairmap.com DocumentRoot "/var/www/flightairmap.com/public_html" <Directory /var/www/flightairmap/public_html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost>

and download .htaccess from here: https://github.com/Ysurac/FlightAirMap/raw/master/.htaccess

and copy to /var/www/flightairmap.com/public_html/.

6- Step Enable Virtual Host sudo a2ensite flightairmap.com.conf

7- Step Reload apache2 sudo service apache2 reload

8- Step Setup Local Host File sudo nano /etc/hosts add the line: 127.0.0.1 flightairmap.com

10- Step run flightairmap.com/install/index.php

( I did with create database option checked )

Output of .../install/index.php image

11-Step run script update_db.php on terminal Output: image

Modify permissions on flightairmap files and check again

The update_db.php script was executed without errors once the permissions were modified. However it was observed that most of the aircraft images are not found: captura de pantalla_2017-12-20_12-03-06

The software runs correctly but there are still problems with some options: captura de pantalla_2017-12-20_12-26-25

http://flightairmap.com/airline/BLN http://flightairmap.com/marine/currently and some more.

captura de pantalla_2017-12-20_12-22-22

ocascante avatar Dec 20 '17 17:12 ocascante

I don't understand step 3 and the creation of a .htaccess in step 5. With this htaccess FlightAirMap will not work.

Strange that the install work with "create database option checked". In MySQL >= 5.7 the creation of DB the way I use is not not allowed, maybe Ubuntu use a patched version ? I will check.

Permissions of install/tmp need to be fixed, but I will add a check in update_db script for that. Else you can run update_db.php as the www-data user.

Ysurac avatar Dec 20 '17 18:12 Ysurac

Without the instructions of the .htaccess: image with .htaccess: image

ocascante avatar Dec 20 '17 18:12 ocascante

You need an .htaccess, but the one I provide: https://github.com/Ysurac/FlightAirMap/raw/master/.htaccess

Ysurac avatar Dec 20 '17 18:12 Ysurac

With the .htaccess that you indicated the software now runs apparently without problems. I will proceed to test every menu options, acars and ads-b to finalize and put the article on our website. If you have any special instructions on how to run dump1090 please advise me. Thanks

ocascante avatar Dec 20 '17 18:12 ocascante

The .htaccess should be in the zip file. What link did you use ?

To get only aircrafts, you need to check only the Aircrafts source type. For pics, not every aircrafts have a pic, and what you see is when update_db.php try to get pics of latest crashed/incident aircrafts (and new pics can be difficult to take after a crash sometimes).

For Dump1090: https://github.com/Ysurac/FlightAirMap/wiki/ADS-B

Ysurac avatar Dec 20 '17 19:12 Ysurac

I use the .htaccess link that you wrote before: https://github.com/Ysurac/FlightAirMap/raw/master/.htaccess saved as a file.

I just check several aircraf types with the same message:

Sorry, the aircraft type does not exist in this database. :(

On airlines options this error:

Invalid query : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY spotter_output.date DESC LIMIT 25 OFFSET 0' at line 1 Whole query: SELECT spotter_output.spotter_id,spotter_output.flightaware_id,spotter_output.ident,spotter_output.registration,spotter_output.airline_name,spotter_output.airline_icao,spotter_output.airline_country,spotter_output.airline_type,spotter_output.aircraft_icao,spotter_output.aircraft_name,spotter_output.aircraft_manufacturer,spotter_output.departure_airport_icao,spotter_output.departure_airport_name,spotter_output.departure_airport_city,spotter_output.departure_airport_country,spotter_output.departure_airport_time,spotter_output.arrival_airport_icao,spotter_output.arrival_airport_name,spotter_output.arrival_airport_city,spotter_output.arrival_airport_country,spotter_output.arrival_airport_time,spotter_output.route_stop,spotter_output.date,spotter_output.latitude,spotter_output.longitude,spotter_output.waypoints,spotter_output.altitude,spotter_output.real_altitude,spotter_output.heading,spotter_output.ground_speed,spotter_output.highlight,spotter_output.squawk,spotter_output.ModeS,spotter_output.pilot_id,spotter_output.pilot_name,spotter_output.owner_name,spotter_output.verticalrate,spotter_output.format_source,spotter_output.source_name,spotter_output.ground,spotter_output.last_ground,spotter_output.last_seen,spotter_output.last_latitude,spotter_output.last_longitude,spotter_output.last_altitude,spotter_output.last_ground_speed,spotter_output.real_arrival_airport_icao,spotter_output.real_arrival_airport_time,spotter_output.real_departure_airport_icao,spotter_output.real_departure_airport_time FROM spotter_output INNER JOIN (SELECT icao FROM airlines WHERE alliance = 'Oneworld') sal ON sal.icao = spotter_output.airline_icao WHERE ORDER BY spotter_output.date DESC LIMIT 25 OFFSET 0

I saw the same here: From ADS-B, real flights: https://real.flightairmap.com/

ocascante avatar Dec 20 '17 19:12 ocascante

For aircrafts type, page is available when there is aircrafts of this type detected. Else I have nothing to display.

For airlines, it's fixed in latest git commit.

Ysurac avatar Dec 20 '17 19:12 Ysurac

"For aircrafts type, page is available when there is aircrafts of this type detected"

You mean this page?

image

ocascante avatar Dec 20 '17 19:12 ocascante

When no stats are generated and no flights detected yet, this page display all aircraft types. But when you click on any aircraft type you get the "Sorry, the aircraft type does not exist in this database. :(" message, else you have flights using aircraft of this type.

I will change asap to display all informations I have on the aircraft type, this would be better.

Ysurac avatar Dec 20 '17 19:12 Ysurac

When i click on any (ANY MANUFACTURER) options i have the same message: Sorry, the aircraft type does not exist in this database. :(

ads-b is working ok: captura de pantalla_2017-12-20_13-58-29

ocascante avatar Dec 20 '17 19:12 ocascante

Yes. You have no flights in DB yet. And this ANY MANUFACTURER are generic ICAO code.

While daemon-spotter.php (or daemon-acars.php) is not run you will see nothing for any aircrafts type.

Ysurac avatar Dec 20 '17 20:12 Ysurac

Ok, i am testing acars daemon now

ocascante avatar Dec 20 '17 20:12 ocascante

Acars tested and working ok:

image

ocascante avatar Dec 20 '17 20:12 ocascante

I love ACARS, but I don't have many messages here, maybe too far from an airport :(

Ysurac avatar Dec 20 '17 20:12 Ysurac

I also love the acars system and I have an antenna 15 km from the national airport so there is a lot of communication of this type. I know it's a big job but I think it would be important that the database of airplanes and airports be available in the initial configuration, as a comment since I find this software very good.

ocascante avatar Dec 20 '17 20:12 ocascante