Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

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 Oct 14, 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 » Fri Nov 08, 2013 11:57 pm

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: 721
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

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

Post by ConligWX » Sun Aug 20, 2017 12:56 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2 Plus - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS Templates

User avatar
mcrossley
Posts: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley » Mon Aug 21, 2017 5:20 pm

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: 721
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

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

Post by ConligWX » Mon Aug 21, 2017 7:31 pm

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
https://twitter.com/conligwx
Davis Vantage Pro2 Plus - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS Templates

powerr
Posts: 7
Joined: Thu Jun 23, 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 » Tue Sep 11, 2018 8:04 pm

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: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley » Tue Sep 11, 2018 10:35 pm

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 Jun 23, 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 » Wed Sep 12, 2018 5:37 pm

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: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley » Wed Sep 12, 2018 6:19 pm

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