Trying to Store Log to Database
Posted: Wed Feb 19, 2020 10:05 am
Hello, I'm new here and this is my first post. I've been digging into the code for pi-star quite a bit and have made some progress, but would like to reach out for some potential support or ideas.
What I'm looking to do is store what is displayed in the dashboard for contacts to a MySql database table. I've managed to do this by inserting code in the lh.php script (lastHeard). However, this is, by default, called once a second, I believe it is, in the dashboard. So, I get duplicate entries every time the script is called for the same transmission entry. I mainly am interested in time, callsign, and duration of transmission. From my digging through the code, it seems the dashboard display is derived from the existing log file that is created.
My question here is can anyone point me in the right direction as to where to insert my database entry code or easily access the information displayed on the dashboard? I know it is all stored in the lastheard array. I'm just struggling to find the best place to have this constantly run, ideally in the background without even having to have the dashboard open.
What I'm looking to do is store what is displayed in the dashboard for contacts to a MySql database table. I've managed to do this by inserting code in the lh.php script (lastHeard). However, this is, by default, called once a second, I believe it is, in the dashboard. So, I get duplicate entries every time the script is called for the same transmission entry. I mainly am interested in time, callsign, and duration of transmission. From my digging through the code, it seems the dashboard display is derived from the existing log file that is created.
My question here is can anyone point me in the right direction as to where to insert my database entry code or easily access the information displayed on the dashboard? I know it is all stored in the lastheard array. I'm just struggling to find the best place to have this constantly run, ideally in the background without even having to have the dashboard open.