IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

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

Top 10 Records Page

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

Moderators: daj, TNETWeather

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

Re: Top 10 Records Page

Postby mcrossley » Fri May 11, 2018 2:18 pm

Hmm, did you edit a file with MS Word!

Mrc
Posts: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Fri May 11, 2018 2:48 pm

mcrossley wrote:Hmm, did you edit a file with MS Word!

Yes i did, should i use notepad instead?

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

Re: Top 10 Records Page

Postby mcrossley » Fri May 11, 2018 2:53 pm

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: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Fri May 11, 2018 4:29 pm

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

Re: Top 10 Records Page

Postby mcrossley » Fri May 11, 2018 4:32 pm

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: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Fri May 11, 2018 4:52 pm

2.8 version didn't work either:
Error: You must supply a 'table' parameter/value

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

Re: Top 10 Records Page

Postby mcrossley » Fri May 11, 2018 5:12 pm

What did you enter for the table parameter?

Mrc
Posts: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Fri May 11, 2018 5:18 pm

I only edited password, username etc.. I did everything same way as with version 3-1.

Mrc
Posts: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Sat May 12, 2018 6:47 am

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: 443
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Top 10 Records Page

Postby sfws » Sat May 12, 2018 7:51 am

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: 118
Joined: Sat Aug 27, 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Top 10 Records Page

Postby jlmr731 » Sat May 12, 2018 2:27 pm

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

Re: Top 10 Records Page

Postby mcrossley » Sat May 12, 2018 2:27 pm

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: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Sat May 12, 2018 6:03 pm

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: 443
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Top 10 Records Page

Postby sfws » Sat May 12, 2018 6:41 pm

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: 23
Joined: Mon Apr 11, 2016 12:39 pm
Weather Station: Weatherwise WS-1090
Operating System: Windows 10
Location: Finland

Re: Top 10 Records Page

Postby Mrc » Sat May 12, 2018 6:57 pm

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


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 2 guests