Author Topic: Myblitzortung data import error  (Read 2237 times)

0 Members and 1 Guest are viewing this topic.

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Myblitzortung data import error
« on: November 23, 2016, 09:48:32 AM »
Hi to all,
i've a problem with blitzortung import data.
If i execute a cronjob like this: http://newsite.meteocarmignano.it/mybo/blitzortung.php?update&secret=xxxxxxxxxxxx i've this answer for server:

Code: [Select]
2016-11-23 14:45:52 +    0ms | 
2016-11-23 14:45:52 +    0ms | ***** Getting lightning data from blitzortung.org *****
2016-11-23 14:45:52 +    0ms | 
2016-11-23 14:45:52 +    4ms | Information: PHP Execution timeout is 30s  --> Fine :) *** Setting MyBlitzortung timeout to: 55s
2016-11-23 14:45:52 +    4ms | Waiting 4 seconds, to avoid too high load on Blitzortung servers ...
2016-11-23 14:45:52 + 4007ms | 
2016-11-23 14:45:52 + 4007ms | === Strikes ===
2016-11-23 14:45:52 + 4026ms | Last strike: 2016-11-23 14:26:51 *** Loading 3 files from 2016-11-23 14:20:00 to 2016-11-23 14:40:00 *** This is update #4142
2016-11-23 14:45:52 + 4197ms |   Downloading file /2016/11/23/14/20.log: OK
2016-11-23 14:45:52 + 4199ms | Found latest strike from last import
2016-11-23 14:45:52 + 4434ms |   Downloading file /2016/11/23/14/30.log: OK
2016-11-23 14:45:52 + 4726ms |   Downloading file /2016/11/23/14/40.log: OK
2016-11-23 14:45:52 + 4817ms | Lines: 707 *** Size: 367kB *** New Strikes: 525
2016-11-23 14:45:52 + 4849ms | 
2016-11-23 14:45:52 + 4849ms | === Stations ===
2016-11-23 14:45:52 + 4849ms | No update. Last update 818 seconds ago. This is normal and no error message!
2016-11-23 14:45:52 + 4849ms | 
2016-11-23 14:45:52 + 4849ms | === Raw-Data ===
2016-11-23 14:45:52 + 4849ms | Not implemented!
2016-11-23 14:45:52 + 4851ms | 
2016-11-23 14:45:52 + 4851ms | === Strike alerts ===
2016-11-23 14:45:52 + 4855ms | No alerts sent.
2016-11-23 14:45:52 + 4860ms | 
2016-11-23 14:45:52 + 4860ms | Import finished. Exiting...
2016-11-23 14:45:52 + 4860ms | 

and this php error:

Code: [Select]
PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 67
How to fix this issue?
Regards,


Alessandro

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Myblitzortung data import error
« Reply #1 on: November 23, 2016, 12:59:23 PM »
I don't have the source for FilesDownload.class.php, but if you'd post it (particularly line 67) there is a fairly easy fix that can be made.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #2 on: November 23, 2016, 04:46:10 PM »
I don't have the source for FilesDownload.class.php, but if you'd post it (particularly line 67) there is a fairly easy fix that can be made.

Here it is Ken ;)

Code: [Select]
$this->Files[$time] = preg_replace('/%([A-Z])/ie', 'gmdate("\1", $time)', $time_format);
...and entire file attached.
Thanks in advance,


Alessandro

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Myblitzortung data import error
« Reply #3 on: November 23, 2016, 05:16:49 PM »
I can't test it here, but try replacing the part
Code: [Select]
for ($time=$this->TimeStart; $time<=$this->TimeEnd; $time+=60*$min_step)
{
$this->Files[$time] = preg_replace('/%([A-Z])/ie', 'gmdate("\1", $time)', $time_format);
}
with
Code: [Select]
for ($time=$this->TimeStart; $time<=$this->TimeEnd; $time+=60*$min_step)
{
// old         $this->Files[$time] = preg_replace('/%([A-Z])/ie', 'gmdate("\1", $time)', $time_format);
$this->Files[$time] = preg_replace_callback('/%([A-Z])/i',
  function ($m,$time) {
return ( gmdate($m[1], $time) );
  },
  $time_format);
}
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #4 on: November 23, 2016, 05:23:24 PM »
These errors now:

Code: [Select]
Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69
[23-Nov-2016 22:22:07 UTC] PHP Warning:  Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69
[23-Nov-2016 22:22:07 UTC] PHP Warning:  Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69
[23-Nov-2016 22:22:07 UTC] PHP Warning:  Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69
[23-Nov-2016 22:22:07 UTC] PHP Warning:  Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69
[23-Nov-2016 22:22:07 UTC] PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 75


Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #5 on: November 23, 2016, 05:37:19 PM »
So sorry Ken,
my mistake!

This is actual php error:

Code: [Select]
23-Nov-2016 22:36:04 UTC] PHP Warning:  Missing argument 2 for FilesDownload::{closure}() in /home/byoryrxn/newsite/mybo/includes/classes/FilesDownload.class.php on line 69

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #6 on: November 23, 2016, 05:51:35 PM »
Code: [Select]
***** Getting lightning data from blitzortung.org *****
2016-11-23 22:50:25 +    0ms | 
2016-11-23 22:50:25 +    4ms | Information: PHP Execution timeout is 30s  --> Fine :) *** Setting MyBlitzortung timeout to: 55s
2016-11-23 22:50:25 +    4ms | Waiting 13 seconds, to avoid too high load on Blitzortung servers ...
2016-11-23 22:50:25 +13006ms | 
2016-11-23 22:50:25 +13006ms | === Strikes ===
2016-11-23 22:50:25 +13026ms | Last strike: 2016-11-23 22:49:56 *** Loading 2 files from 2016-11-23 22:40:00 to 2016-11-23 22:50:00 *** This is update #1398473
2016-11-23 22:50:25 +13170ms |   Downloading file /2016/11/23/22/40.log, last modified 2016-11-23 22:49:02, last position 599974 bytes: OK
2016-11-23 22:50:25 +13171ms | Found latest strike from last import
2016-11-23 22:50:25 +13240ms |   Downloading file /2016/11/23/22/50.log: Error (404 Not Found).
2016-11-23 22:50:25 +13240ms | Lines: 77 *** Size: 47kB *** New Strikes: 0
2016-11-23 22:50:25 +13260ms | 
2016-11-23 22:50:25 +13260ms | === Stations ===
2016-11-23 22:50:25 +13260ms | No update. Last update 841 seconds ago. This is normal and no error message!
2016-11-23 22:50:25 +13260ms | 
2016-11-23 22:50:25 +13260ms | === Raw-Data ===
2016-11-23 22:50:25 +13260ms | Not implemented!
2016-11-23 22:50:25 +13263ms | 
2016-11-23 22:50:25 +13263ms | === Strike alerts ===
2016-11-23 22:50:25 +13265ms | No alerts sent.
2016-11-23 22:50:25 +13269ms | 
2016-11-23 22:50:25 +13269ms | Import finished. Exiting...
2016-11-23 22:50:25 +13269ms | 

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Myblitzortung data import error
« Reply #7 on: November 23, 2016, 07:24:17 PM »
Ah... found how to pass a second variable to the anonymous function...

Try
Code: [Select]
for ($time=$this->TimeStart; $time<=$this->TimeEnd; $time+=60*$min_step)
{
// old $this->Files[$time] = preg_replace('/%([A-Z])/ie', 'gmdate("\1", $time)', $time_format);
$this->Files[$time] = preg_replace_callback('/%([A-Z])/i',
  function ($m) use($time) {
return ( gmdate($m[1], $time) );
  },
  $time_format);
}
instead.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #8 on: November 24, 2016, 01:58:51 AM »
Hi Ken,
seems to be working now but i've an error during update process:

Code: [Select]
***** Getting lightning data from blitzortung.org *****
2016-11-24 06:56:35 +    0ms | 
2016-11-24 06:56:35 +    4ms | Information: PHP Execution timeout is 30s  --> Fine :) *** Setting MyBlitzortung timeout to: 55s
2016-11-24 06:56:35 +    4ms | Waiting 10 seconds, to avoid too high load on Blitzortung servers ...
2016-11-24 06:56:35 +10005ms | 
2016-11-24 06:56:35 +10005ms | === Strikes ===
2016-11-24 06:56:35 +10025ms | Last strike: 2016-11-23 23:45:57 *** Loading 44 files from 2016-11-23 23:40:00 to 2016-11-24 06:50:00 *** This is update #1398955
2016-11-24 06:56:35 +13062ms |   Downloading file /2016/11/24/06/50.log: Error (404 Not Found).
2016-11-24 06:56:35 +13062ms | Lines: 0 *** Size: 0kB *** New Strikes: 0
2016-11-24 06:56:35 +13075ms | 
2016-11-24 06:56:35 +13075ms | === Stations ===
2016-11-24 06:56:35 +13075ms | No update. Last update 135 seconds ago. This is normal and no error message!
2016-11-24 06:56:35 +13075ms | 
2016-11-24 06:56:35 +13075ms | === Raw-Data ===
2016-11-24 06:56:35 +13075ms | Not implemented!
2016-11-24 06:56:35 +13078ms | 
2016-11-24 06:56:35 +13078ms | === Strike alerts ===
2016-11-24 06:56:35 +13083ms | 
2016-11-24 06:56:35 +13083ms | Import finished. Exiting...

I've attached file updated.
Thanks in advance,


Alessandro

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #9 on: November 27, 2016, 05:19:31 AM »
Hi Ken,
it seems to be working now, thanks a lot for your support.

It remained only these redundant errors:

Code: [Select]
16 10:16:08 UTC] PHP Warning:  Illegal string offset 'lat' in /home/byoryrxn/newsite/euroblitz/bo_update.php on line 331
[27-Nov-2016 10:16:08 UTC] PHP Warning:  Illegal string offset 'lon' in /home/byoryrxn/newsite/euroblitz/bo_update.php on line 332

This is the string on line 331 and 332:

Code: [Select]
Line 330: foreach ($value as $keyb => $valueb) {
    Line 331: $lats[]=$valueb[lat];
    Line 332: $lons[]=$valueb[lon];

Thanks in advance for your help.
Regards,


Alessandro
« Last Edit: November 27, 2016, 05:23:51 AM by i_fiorentino »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Myblitzortung data import error
« Reply #10 on: November 27, 2016, 06:27:19 PM »
Sorry Alessandro, I don't know about that one.. it's not a script I've written, so I'm kind-of in the dark here.

My prior assist was just in converting one (deprecated) syntax to a supported syntax for that one small piece.

I suggest you contact the author of the script for their assistance.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline i_fiorentino

  • Forecaster
  • *****
  • Posts: 562
  • Davis Vantage Vue, Boltek Stormtr., Mobotix M22-IT
    • Meteopistoia.it
Re: Myblitzortung data import error
« Reply #11 on: November 28, 2016, 03:51:56 AM »
Sorry Alessandro, I don't know about that one.. it's not a script I've written, so I'm kind-of in the dark here.

My prior assist was just in converting one (deprecated) syntax to a supported syntax for that one small piece.

I suggest you contact the author of the script for their assistance.

Best regards,
Ken


Ok Ken,
thanks you so much.
Unfortunately the developer is "desaparecidos"  :lol: :lol: :lol:
Best regards,


Alessandro