Using Debian 11 on Intel with an Airspy Mini
Installed piaware, dump1090-fa, airspy_adsp using scripts. Everything works. Thanks @wiedehopf!
Installed mysql and php using apt-get. All is well.
Installed scripts for writing contents of json to mysql. Got them here:–GitHub - TomMuc1/Dump1090-MySQL-Alert-Filter: a simple php script that makes use of Dump1090-mutability aircraft.json and filters/writes to MySQL Thanks @TomMuc1
Created the DB and the table using the provided script. Modified radar.php per my needs and understanding. All almost works. I am seeing data n my json file when I inspect it directly. It works. The radar.php setting is pointing at it. User ID, Password and other DB settings are correct. No errors being thrown when I run the code directly: php radar.php
The script runs, looks like it checks the json once per second, but no data goes to the database. I think I have turned off all filtering. Not interested in alerts. Just want the data saved for later analysis.
Any ideas of what I might be missing? Thanks for thinking about this and any suggestions.
Here is some output from the terminal when I run radar.php using the php command:
upt(us): 0001536 - 0.998073 loops/s avg - since 0 days 00:08:39 - run 518 @ 0,1 msg/s → 000 dataset(s) =>
upt(us): 0001596 - 0.998077 loops/s avg - since 0 days 00:08:40 - run 519 @ 0,1 msg/s → 000 dataset(s) =>
upt(us): 0001776 - 0.998081 loops/s avg - since 0 days 00:08:41 - run 520 @ 0,1 msg/s → 000 dataset(s) =>
upt(us): 0001594 - 0.998084 loops/s avg - since 0 days 00:08:42 - run 521 @ 0,1 msg/s → 000 dataset(s) =>
And here is the relevant part of my radar.php file:
#!/usr/bin/php
<?php #phpinfo(); #var_dump(ini_get_all()); #ini_set('error_reporting', E_ALL); // below a sample create statement for database table // CREATE TABLE aircrafts (id INT NOT NULL AUTO_INCREMENT, message_date VARCHAR(100), now VARCHAR(100), hex VARCHAR(100), flight VARCHAR(100), distance VARCHAR(100), altitude VARCHAR(100), lat VARCHAR(100), lon VARCHAR(100> // set the rectangle and altitude to store aircraft-data in database - if your lon is negative be aware to use the right values for max and min $user_set_array['max_lat'] = 37.384796; $user_set_array['min_lat'] = 37.563922; $user_set_array['max_alt'] = 50000; $user_set_array['max_lon'] = -122.427054; $user_set_array['min_lon'] = -122.481594; // set the rectangle and altitude to send alert message - if your lon is negative be aware to use the right values for max and min $user_set_array['alert_max_lat'] = 37.384796; $user_set_array['alert_min_lat'] = 37.563922;; $user_set_array['alert_max_alt'] = -5000; $user_set_array['alert_max_lon'] = -122.427054; $user_set_array['alert_min_lon'] = -122.481594; // set lookup-interval default is 1 (must be integer between 1 - 900) this is the frequency the script runs and writes to database or looks for alerts $user_set_array['sleep'] = 1; // set your google email-address for alert-messages - if you want to use mailer.php instead gmail set method 'gmail' to 'webmail' or 'pushover' and a key according to mailer.php $user_set_array['alert_method'] = 'gmail'; $user_set_array['email_address'] = 'YOUR_EMAIL@gmail.com'; $user_set_array['secret_email_key'] = 'YOUR_USER_KEY'; // set parameters for database connection $user_set_array['db_name'] = 'adsb'; $user_set_array['db_host'] = '127.0.0.1'; $user_set_array['db_user'] = 'MYDB'; $user_set_array['db_pass'] = 'NotVerySecure'; // set path to aircraft.json file $user_set_array['url_json'] = '/run/dump1090-fa/'; // set path to your mailer.php file $user_set_array['url_mailer'] = '/home/skygizmo/hmbatc/mailer.php'; // set the absolute limit of alert-messages (default is 1000) this script is allowed to send over its whole runtime $user_set_array['mailer_limit'] = 1000; // set aircraft suspend time (default is 900) - change only if needed - time in seconds an aicraft is suspended from alert-messages after sending an alert-message for this aircraft $user_set_array['aircraft_suspend_time'] = 900; // 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; //Tried next three both false and true $user_set_array['filter_mode_database'] = true; $user_set_array['filter_mode_database_limited'] = true; $user_set_array['filter_mode_wildcard'] = true; // set path to your hex_code_array.txt and flight_code_array.txt files $user_set_array['hex_file_path'] = '/home/skygizmo/hmbatc/hex_code_array.txt'; $user_set_array['flight_file_path'] = '/home/skygizmo/hmbatc/flight_code_array.txt'; // set your timezone see http://php.net/manual/en/timezones.php $user_set_array['time_zone'] = 'America/Los_Angeles';