FlightAware Discussions

Dump1090 MySQL Database Script with Alert and Filter

Next try

After i updated the script with the isset part provided by @wiedehopf the script is running, i am getting datasets into the DB

But the script itself throws out an error right after i added the three lines:

PHP Notice: Undefined index: alert_max_alt in /home/pi/dumpsql/radar.php on line 192

It can be supressed by piping to /dev/nul, but i think the problem should be resolved.

You should resolve the problem by giving that variable a value.
It’s in line 16.

If you only want the database and no email alert set it to -5000.

Ah, that was my fault. I simply commented out the mailer/alert settings because i do not need them.

Thanks for the eye opener

Running out of SD card space… how do I archive the contents of the database? I have all the daily files.

Bumping this… Can someone help me dump the contents and clear the database? Running out of space on the SD card

check this pacge: https://www.mysqldumper.de/
German page but a great tool

To drop the tables you no longer want use drop table:

You can use mysqlworkbench if you want a graphical interface that will let you select multiple tables:

I still want the table. Just need to clear it. I’m thinking, based off of what I read to truncate it?

truncate the table

mysql -u root -p
USE adsb;
truncate table aircrafts;

1 Like

Revisiting this as I really want to:

Write all flights from aircraft.json to my database AND send me an email on specific flights and/or HEX codes.

So for the above what must these settings be (I’ve figure all the others in the radar.php file):

set this to true if you want alerts and/or database writes from those aircrafts matching your hex_code_array.txt or flight_code_array.txt files within limited area or whole site-range, with or without wildcards
$user_set_array['filter_mode_alert'] = false;    $user_set_array['filter_mode_alert_limited'] = false;
$user_set_array['filter_mode_database'] = false;     $user_set_array['filter_mode_database_limited'] = false;
$user_set_array['filter_mode_wildcard'] = false;

It seems from my testing that I can’t have both options, all flights and emails on specific flights/HEX, is that true?