Page 1 of 1

ImportCumulusFile.php 4.0

Posted: Mon 04 May 2020 10:22 pm
by richard_newberry
I have the following error message when I access this file the following message appears
http://desford-weather.co.uk/ImportCumulusFile.php

Running from web server
Error: You must supply a 'file' parameter/value

Don't it load like that? have to put a parameter in there?

http://desford-weather.co.uk/ImportCumu ... ayfile.txt

Running from web server
Script start: 04/05/20 - 23:30:17
Importing file: /data/dayfile.txt, To table: Dayfile ...
Error: Failed to open file: '/data/dayfile.txt'
Script complete: 04/05/20 - 23:30:17
Execution time: 0 secs

Re: ImportCumulusFile.php 4.0

Posted: Mon 04 May 2020 11:09 pm
by water01
The dayfile.txt file must in the same place as your ImportCumulusFile.php i.e. uploaded on the webserver, not pointed at your CumulusMX Data Directory.

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 4:42 pm
by richard_newberry
Done that i got following error message

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 4:49 pm
by laulau
I have the same error !
Perhaps it's because older entry have less data ?
SQL guru help needed :oops:

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 5:59 pm
by richard_newberry
laulau wrote: Thu 07 May 2020 4:49 pm I have the same error !
Perhaps it's because older entry have less data ?
SQL guru help needed :oops:
What version you on laulau?

I am on 4.0 latest is 4.1

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 6:18 pm
by water01
There was an error in 4.0 for some people (I was one of them and I helped Mark test 4.1) who had existing tables that is why 4.1 was released, I suggest you try that version.

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 6:32 pm
by richard_newberry
Thank you.

Which file is the monthly log thats used on the table called monthly?

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 6:43 pm
by sfws
richard_newberry wrote: Thu 07 May 2020 6:32 pm Which file is the monthly log thats used on the table called monthly?
Sometimes you can answer your questions by looking at the wiki in this case the rather obvious page is https://cumuluswiki.org/a/Monthly_log_files



I think Steve Loft's naming scheme was rather illogical, his daily log has 1 line per day, but only one file.

His monthly log has lots of lines, but a separate file for each month.
(In early versions of ImportCumulusFile, if I recall correctly, there was one monthly table for each month). The monthly table in MX is made up of rows from lines in all monthly log files.

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 8:12 pm
by richard_newberry
Updated to 4.1 and following message appears:-

Running from web server
Script version 4.1
Script start: 07/05/20 - 21:08:53
Importing file: dayfile.txt, To table: Dayfile ...
Connected to database OK.
Set MySQL TZ OK.
Processing dayfile...
Insert = INSERT IGNORE INTO Dayfile (LogDate,HighWindGust,HWindGBear,THWindG,MinTemp,TMinTemp,MaxTemp,TMaxTemp,MinPress,TMinPress,MaxPress,TMaxPress,MaxRainRate,TMaxRR,TotRainFall,AvgTemp,TotWindRun,HighAvgWSpeed,THAvgWSpeed,LowHum,TLowHum,HighHum,THighHum,TotalEvap,HoursSun,HighHeatInd,THighHeatInd,HighAppTemp,THighAppTemp,LowAppTemp,TLowAppTemp,HighHourRain,THighHourRain,LowWindChill,TLowWindChill,HighDewPoint,THighDewPoint,LowDewPoint,TLowDewPoint,DomWindDir,HeatDegDays,CoolDegDays,HighSolarRad,THighSolarRad,HighUV,THighUV,MaxFeelsLike,TMaxFeelsLike,MinFeelsLike,TMinFeelsLike,HWindGBearSym,DomWindDirSym) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
Target table already exists.
ERROR - Failed to prepare the insert statement: Dayfile, error: Unknown column 'MaxFeelsLike' in 'field list'
INSERT IGNORE INTO Dayfile (LogDate,HighWindGust,HWindGBear,THWindG,MinTemp,TMinTemp,MaxTemp,TMaxTemp,MinPress,TMinPress,MaxPress,TMaxPress,MaxRainRate,TMaxRR,TotRainFall,AvgTemp,TotWindRun,HighAvgWSpeed,THAvgWSpeed,LowHum,TLowHum,HighHum,THighHum,TotalEvap,HoursSun,HighHeatInd,THighHeatInd,HighAppTemp,THighAppTemp,LowAppTemp,TLowAppTemp,HighHourRain,THighHourRain,LowWindChill,TLowWindChill,HighDewPoint,THighDewPoint,LowDewPoint,TLowDewPoint,DomWindDir,HeatDegDays,CoolDegDays,HighSolarRad,THighSolarRad,HighUV,THighUV,MaxFeelsLike,TMaxFeelsLike,MinFeelsLike,TMinFeelsLike,HWindGBearSym,DomWindDirSym) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
End.

I had to delete the Table and then reload the URL again and it works. Won't spam it all but at the end should say it's successful.

Re: ImportCumulusFile.php 4.0

Posted: Thu 07 May 2020 8:46 pm
by water01
By the way you could of also have used that little known program ExportMySql.exe that is in the same MX folder as CumulusMX. It works in a command window and has 1 parameter either dayfile or monthly.

In then updates your dayfile or ALL your monthly log files from your PC's data directory to the MySQL database defined in the CumulusMX MySQL area and held in the Cumulus.ini file. Worked well for me.