Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

a PHP import script for DayFile and Monthly log files

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
User avatar
nikokara
Posts: 11
Joined: Fri 14 Oct 2011 3:13 pm
Weather Station: OlympData Offset
Operating System: Winxp
Location: Greece

Re: a PHP import script for DayFile and Monthly log files

Post by nikokara »

mcrossley wrote:Ah, I see the problem. The script is missing a LF after the error message. So it should read...

Error: Failed to open file: ./data/Jan11log.txt
07/11/13 - 18:17:53

It can't find your file.
Thank You for your time

Yes you are right. It can't find my file (the file was here, bud with other localication ( Ιαν11log.txt))

A corection maybe for the next version of the script (v. 2.5)

About line 338 instead of
echo "Error: Failed to open file: $param_file"; This ===> Echo "Error: Failed to open file: $param_file " . $lf;
User avatar
ConligWX
Posts: 1570
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by ConligWX »

HI

I found a script here:

http://wiki.sandaysoft.com/files/Import ... e_v3-0.txt

v3.0 but it is not listed or mentioned on the wiki page here: http://wiki.sandaysoft.com/a/ImportCumulusFile

is this a beta version?
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by mcrossley »

I probably just got distracted and forgot to update the Wiki page!

Let me know if it works - I don't use that script any longer since switching to MX.
User avatar
ConligWX
Posts: 1570
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by ConligWX »

mcrossley wrote:I probably just got distracted and forgot to update the Wiki page!

Let me know if it works - I don't use that script any longer since switching to MX.
yep needed it on saturday after a hard disk failure.

my hdd image was about a month old but my mysql dump hadnt been working since around that time! so used the script to import the dayfile/monthly data back into the db.. it worked!

Script I used though was v2.8 and not the 3.0 i had found. was unsure it was official yet.
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
powerr
Posts: 7
Joined: Thu 23 Jun 2011 4:59 pm
Weather Station: Alecto WS-4000 (FO WH1080)
Operating System: Ubuntu 18.04
Location: Netherlands, Gasselternijveenschemond
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by powerr »

I used the script (version 3.0) to import my Cumulus data for use with Cumulus MX. I noticed a problem with WindbearingSym and CurrWindBearingSym (and a small problem with the variable $tablename, which needs to be $tableName). I attached a new version of the script.

The problem was in this line: $bindParams[] = $compassp[((((int)$buf_arr[$windBearField[$i]] + 11) / 22.5) % 16)];. I changed it to $bindParams[] = $compassp[((((int)$buf_arr[$windBearField[$i] + 1] + 11) / 22.5) % 16)];.
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by mcrossley »

Thanks for the update. The table name typo was fixed in version 3.1 back in March.

Thanks for the heads up on the issue with the wind symbol. I've updated the wiki to version 3.2 to incorporate your change, though I have implemented it in a different way. Your fix would work for the monthly log file, but break the daily log file import.
powerr
Posts: 7
Joined: Thu 23 Jun 2011 4:59 pm
Weather Station: Alecto WS-4000 (FO WH1080)
Operating System: Ubuntu 18.04
Location: Netherlands, Gasselternijveenschemond
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by powerr »

I used the link in the Installation section in the wiki, which was version 3.0, so I was missing the table name typo fix.

Thank you for updating the wiki and the script. I only needed to import the monthly log files and didn't check for possible issues elsewhere, caused by my change.
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: a PHP import script for DayFile and Monthly log files

Post by mcrossley »

powerr wrote:I used the link in the Installation section in the wiki, which was version 3.0, so I was missing the table name typo fix.
Yeah, sorry the wiki had an out of date link near the top, the link in the version list was ok.
Post Reply