FlightAware Discussions

Dump1090 MySQL Database Script with Alert and Filter


#62

team - - does anybody have an idea, if/how it is possible to recalculate from hex_ICAO out of dump1090 (e.g. hex [3c6570] -->) to the aircraft type A333 … :: see: List of ICAO

cap0

.
would love to see the aircraft-type in my generated list - e.g. :


b.t.w.
! you have to think from “top-right” to “bottom-left”- what makes sense! this was my missinterpretation of the skript! thanks for advise once more –


#63

#64

thanks TomMuc … was not able to find a basestation-DB, where i have been able to import.
e.g. https://data.flightairmap.com/

… loocks to be one of the biggest secrets in the plane-spotter scene :tired_face:
…as also direct DB/json exchange is not wanted/possible : only a manual synch over https://www.planespotters.net/ or http://www.airframes.org/

or do you have any other hint in hands?


#65

hey zms - how to install etc. i have no time at the moment to guide you. but you can send me a pm with your email and i’ll send you the latest basestation.sqb.

cheers
tom


#66

Anyone who have a new radar.php for the new aircraft.json as used by dump1090-fa?

Variables in:
https://github.com/flightaware/dump1090/blob/master/net_io.c

After I updated dump to version ver 1.15~dev nothing is written to the database.

I would also like that the records will send to the database without looking at the coordinates only the altitude of the aircraft.


#67

dump1090-fa is not dump1090-mutability.
If you need the changes just scroll up and read my conversation with ZMS it should help you.
(this is the changes to radar php you need, really you didn’t find them? Dump1090 MySQL Database Script with Alert and Filter)

Anyway just use a wider net regarding the coordinates.
Use these settings to catch all airplanes

$user_set_array['max_lat'] = 90.000000;    $user_set_array['min_lat'] = 0.000000;    $user_set_array['max_alt'] = 80000;               
$user_set_array['max_lon'] = 180.000000;    $user_set_array['min_lon'] = -180.000000;

Make sure max is always bigger than min. Otherwise it won’t work.
Good luck.


#69

If you need the changes just scroll up and read my conversation with ZMS it should help you.

                isset($row['gs']) ? $ac_speed = $row['gs'] : false;
                isset($row['baro_rate']) ? $ac_vert_rate = $row['baro_rate'] : false;
                isset($row['alt_baro']) ? $ac_altitude = $row['alt_baro'] : false; 

Hmmm tried it, but it won’t work…

After that I tried:

foreach ($json_data_array['aircraft'] as $row) {
		isset($row['hex']) ? $ac_hex = $row['hex'] : $ac_hex = '';
		isset($row['flight']) ? $ac_flight = trim($row['flight']) : $ac_flight = '';
		isset($row['alt_baro']) ? $ac_altitude = $row['alt_baro'] : $ac_altitude = '';
		isset($row['lat']) ? $ac_lat = $row['lat'] : $ac_lat = '';
		isset($row['lon']) ? $ac_lon = $row['lon'] : $ac_lon = '';
		isset($row['track']) ? $ac_track = $row['track'] : $ac_track = '';
		isset($row['speed']) ? $ac_speed = $row['speed'] : $ac_speed = '';
		isset($row['vert_rate']) ? $ac_vert_rate = $row['vert_rate'] : $ac_vert_rate = '';
		isset($row['seen_pos']) ? $ac_seen_pos = $row['seen_pos'] : $ac_seen_pos = '';
		isset($row['seen']) ? $ac_seen = $row['seen'] : $ac_seen = '';
		isset($row['rssi']) ? $ac_rssi = $row['rssi'] : $ac_rssi = '';
		isset($row['messages']) ? $ac_messages = $row['messages'] : $ac_messages = '';
		isset($row['category']) ? $ac_category = $row['category'] : $ac_category = '';
		isset($row['squawk']) ? $ac_squawk = $row['squawk'] : $ac_squawk = '';
		isset($row['nucp']) ? $ac_nucp = $row['nucp'] : $ac_nucp = '';
		isset($row['mlat']) ? $ac_mlat = implode(' ', $row['mlat']) : $ac_mlat = '';
		isset($row['tisb']) ? $ac_tisb = implode(' ', $row['tisb']) : $ac_tisb = '';
		isset($row['gs']) ? $ac_speed = $row['gs'] : false;
        isset($row['baro_rate']) ? $ac_vert_rate = $row['baro_rate'] : false;

Worked when I run an echo $hex; but also no input in the database…

grrrr, can I send you my radar.php so you can check it?

script is running well but no data uploaded to the database…

pi@raspberrypi:~ $ sudo systemctl status radar.service                          ● radar.service - radar.php
   Loaded: loaded (/etc/systemd/system/radar.service; enabled)
   Active: active (running) since Fri 2018-11-16 12:10:18 CET; 4s ago
 Main PID: 5609 (radar.php)
   CGroup: /system.slice/radar.service
           └─5609 /usr/bin/php /home/pi/radar.php

Nov 16 12:10:18 raspberrypi systemd[1]: Started radar.php.

#70

probably you have lat and lon set wrong.
can you paste that section in here?

Also paste some output from the script when you run it.
One screen is enough.


#71

I think I’ve a problem. I installed MariaDB so MYSQL is not running anymore. Could it be that?


#72

Are you really asking if the database does not work if it’s not running?


#73

Nice program @TomMuc
I have gone up a very steep learning curve to get to the point where “SELECT * FROM aircrafts;” gives me a table with actual data. :slight_smile:
The next questions is based on moving from a small scale environment to collecting on going data in an ever expanding data-set

  1. how do I run the program on the Raspi 3b so it runs at startup, and automatically thereafter.

    Sorry if these are noobie questions,


#74

you can autostart with cron or systemservice. all needed info you’ll find here in the forum in the several threads about the scripts.


#75

Read the first post, the section titled

is what automatically starts the script.