Author Topic: FM Monitoring Script v3 (pira)  (Read 6168 times)

Jan

  • Hero Member
  • *****
  • Posts: 1150
FM Monitoring Script v3 (pira)
« on: September 14, 2024, 10:05:22 pm »
Main features:
  • Automated monitoring of stations from bandscan
  • Web publishing of all results
  • Supports P275, P275R and P275E, fw version 2.2c r2 or later
  • Supports up to 4 antennas

Example of application:
https://pira.cz/monitor/

Tip for antenna switch (optional):
https://pira.cz/forum/index.php?topic=957.0


@ https://pira.cz/monitor/monitor_v3.zip (0.7 MB)

You may edit all files freely.

Lucas G.

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #1 on: October 08, 2024, 12:41:21 pm »
Hi Jan,

Thank you for sharing this new script with us.
Unfortunately, despite a fresh start on my FTP server and after following of your instructions clearly, I am unable to run the script properly.

Without any modification to the index.php file, I get the following error:
Parse error: syntax error, unexpected T_STRING, expecting ')' in [...] on line 189

which leads to the following code:
function old_json validate (string $string): bool {
json_decode ($string);
return json_last_error() === JSON_ERROR_NONE;


By removing this part of the code, I am able to see the interface on my server page, but the measurements don't appear even after an hour, while they are being sent to the FTP server in the "history" folder.

Do you have an idea on the source of this issue?
I was able to run the previous script version without any problem in the past.

Thanks in advance for your reply,
Lucas

Jan

  • Hero Member
  • *****
  • Posts: 1150
Re: FM Monitoring Script v3 (pira)
« Reply #2 on: October 08, 2024, 08:30:08 pm »
Could you determine what version your PHP is?

Lucas G.

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #3 on: October 08, 2024, 10:44:57 pm »
Thanks for your reply, Jan.
The issue has to come from the PHP version, in fact. I use a free hosting service in order to host my measurements (exclusively), and the service still runs the PHP 5.6.34 version. They are planning to upgrade to PHP 8 but it wasn't done yet...

I guess I have no other choice than to keep using the former index.php until a potential upgrade on their side!

Jan

  • Hero Member
  • *****
  • Posts: 1150
Re: FM Monitoring Script v3 (pira)
« Reply #4 on: October 09, 2024, 08:04:19 pm »
The PHP version 5.6 is about 10 years old. Especially some JSON parsing functions may not be available in version 5.6. I'm sure the issue can be fixed anyway but I won't be able to do that anytime soon. Lowest PHP version I was able to test was 7.x.

Lucas G.

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #5 on: October 11, 2024, 03:00:19 pm »
All fine, Jan. Thanks for your efforts!

Rene

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #6 on: October 11, 2024, 10:49:43 pm »
Hallo Jan,

there is a little bug in your script in the Part "AntennaLoop:". If i use only one antenna in the config, the monitoring runs in a infinite loop. If a comment the part out:

;inc(CurrentAntenna)
;if (%CurrentAntenna<=%HowManyAntennas)
;  goto (AntennaLoop)
;  endif

the script runs fine.
Thank you for your perfect work and your products.

Jan

  • Hero Member
  • *****
  • Posts: 1150
Re: FM Monitoring Script v3 (pira)
« Reply #7 on: October 11, 2024, 11:41:57 pm »
Thank you. You can change the number of antennas at line 25:

Code: [Select]
set (HowManyAntennas,1) ;default is 1 (single antenna)
Please verify that this line has not been inadvertently changed.

Your solution will also work of course  :)

Rene

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #8 on: October 12, 2024, 10:23:17 pm »
I use the default setting in your script
set (HowManyAntennas,1)

but with this config the monitoring runs in a infinite loop. Sorry.. :) I can´t find the error in your script.

My workaround is comment the part out:

;inc(CurrentAntenna)
;if (%CurrentAntenna<=%HowManyAntennas)
;  goto (AntennaLoop)
;  endif

Then the script runs one time.

Jan

  • Hero Member
  • *****
  • Posts: 1150
Re: FM Monitoring Script v3 (pira)
« Reply #9 on: October 13, 2024, 09:15:15 am »
If I set (HowManyAntennas,1), the script runs only once, as expected. It seems to me that no fix is needed to the original script.

Rene

  • Guest
Re: FM Monitoring Script v3 (pira)
« Reply #10 on: November 16, 2024, 10:48:17 pm »
i want to use your script to store my mobile measurements in a structure on the webserver monitor/stationxyz.
After maybe a month a measure again on this place (station) an store the files on the webserver. When i travel i can measure mobile on seperate cities and store this files on the webserver. In this usecase in can compare different radio stations in different regions.
I would like to save this data for 3 years.
For this reason i must deactivate the clenaup of the directory data and history.
i change the $threshold = strtotime('-1095 day') in index.php and history.php
and i uncommend the index.php form line 255 //remove duplicite station from another antenna to line 363.
Is there another way or can you make the clenaup configurable?

Jan

  • Hero Member
  • *****
  • Posts: 1150
Re: FM Monitoring Script v3 (pira)
« Reply #11 on: November 16, 2024, 10:53:52 pm »
It is configurable exactly using the way you're mentioning. Only make sure there's enough storage space for 3 years history.