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

Top 10 Records Page

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

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

Re: Top 10 Records Page

Post by mcrossley »

Hmm, did you edit a file with MS Word!
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

mcrossley wrote:Hmm, did you edit a file with MS Word!
Yes i did, should i use notepad instead?
User avatar
mcrossley
Posts: 12686
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Preferably something like Notepad++ that understands text encoding properly. You may be able to use Notepad, but *never* use Word to edit a text file.
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

Well, now it created dayfile table but ran into a new problem:

Prepared SQL statement OK.
Inserting data...
Error: Failed to bind the SQL parameters!

How can i fix that error?
User avatar
mcrossley
Posts: 12686
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

This was raised a couple of days ago, I haven't had time to look at yet. Download version 2.8 of the script and try that for now.
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

2.8 version didn't work either:
Error: You must supply a 'table' parameter/value
User avatar
mcrossley
Posts: 12686
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

What did you enter for the table parameter?
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

I only edited password, username etc.. I did everything same way as with version 3-1.
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

And now i get this error with 2-8 version:
Inserting data...
Error: Failed to insert data:
INSERT IGNORE INTO (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,HWindGBearSym,DomWindDirSym) Values('--30.05.15;9','5;90;17:45;14','2;21:15;18','5;17:30;996','1;21:15;1002','6;12:45;0','0;00:00;0','0;16','8;259','2;4','8;20:15;40;13:15;57;21:15;0','00;0','0;18','5;17:30;15','8;14:15;10','4;20:45;0','0;00:00;13','2;21:15;6','7;16:15;3','0;13:15;90;1','5;0','0;0;00:00;0','0;00:00 ',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'N',NULL)
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Top 10 Records Page

Post by sfws »

An SQL insert will only work if each of the column names within the first brackets is associated with within the second set of brackets either null or one value in quotes. The separator for SQL lists is a comma.

The SQL you quote does not conform to that, in too many ways for me to count!
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Top 10 Records Page

Post by jlmr731 »

What ever this is I dont think its the top 10 script, That script (top10) only reads the data, it does not write to the database. Insert is a write command.

Mrc wrote:And now i get this error with 2-8 version:
Inserting data...
Error: Failed to insert data:
INSERT IGNORE INTO (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,HWindGBearSym,DomWindDirSym) Values('--30.05.15;9','5;90;17:45;14','2;21:15;18','5;17:30;996','1;21:15;1002','6;12:45;0','0;00:00;0','0;16','8;259','2;4','8;20:15;40;13:15;57;21:15;0','00;0','0;18','5;17:30;15','8;14:15;10','4;20:45;0','0;00:00;13','2;21:15;6','7;16:15;3','0;13:15;90;1','5;0','0;0;00:00;0','0;00:00 ',null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,'N',NULL)
User avatar
mcrossley
Posts: 12686
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Mrc wrote:I only edited password, username etc.. I did everything same way as with version 3-1.
Yes, but when you call the script you have to supply a bunch of values so the script knows whether it a monthly file or daily or realtime. What your table name is etc. The format for calling the script is embedded in the comments within the script. It looks like your log file delimiter is a semi-colon. The default in the script is a comma, so you will need to changed that too. As pointed out above the lack of parameters and incorrect delimiter means the SQL being created is gibberish!
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

Sorry to bother again but i think the import cumulus script works:
Processing dayfile: dayfile.txt
Inserting data...
Inserted 1078 rows
done.

But Top10.php still has error:
ERROR - Bad Select Statement (1) - No database selected

I tried to comment out solar hours which i don't have but it didn't help.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Top 10 Records Page

Post by sfws »

jlmr731 wrote:That script (top10) only reads the data, it does not write to the database. Insert is a write command
I understand that, but I was responding to the SQL you quoted.
Mrc wrote:i think the import cumulus script works:
Processing dayfile: dayfile.txt
Inserting data...
Inserted 1078 rows
done.
Good, progress. So you have a database table with plenty of rows.
mcrossley wrote:when you call the script you have to supply a bunch of values so the script knows
Mrc wrote:But Top10.php still has error:
ERROR - Bad Select Statement (1) - No database selected
As the error suggests, the top 10 script has some parameters too. You need to tell the top 10 script where to read the data from.

I have my own scripts for both the database loading and for top ten output, so I can't say exactly what you need for the script you are using, but I am sure Mark will have included comments in his script to explain what is needed. Quite possibly the database name, table name use the same variables in both scripts, so if you found names for loading, you can find them for reading.
Mrc
Posts: 57
Joined: Mon 11 Apr 2016 12:39 pm
Weather Station: Ecowitt hp2551
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Post by Mrc »

Progress again, now there's no error but instead just white blank page :shock:
Post Reply