Include old NOAA reports to the archive page

96 views
Skip to first unread message

peter

unread,
Dec 18, 2019, 12:20:12 AM12/18/19
to weewx-user
I have NOAA reports from other software I was using before switching to weewx. Database contains only “fresh” data and not the data from previous software.
Is it possible to include the links to ma old NOAA reports into the “archive.html.tmpl” page automatically? I’m using neowx skin. A workaround is to manually put the links into the template file.
Thanks.

Andrew Milner

unread,
Dec 18, 2019, 1:15:49 AM12/18/19
to weewx-user
have you tried just putting the reports into the NOAA directory and naming them in the same way as the weewx NOAA files??  It should work I would have thought - the drop down is populated by cheetah when the archive.html page is generated I think.

Thomas Keffer

unread,
Dec 18, 2019, 6:11:09 AM12/18/19
to weewx-user
That's correct, except that the WeeWX Cheetah code knows only of the files it has either generated, or might have generated. It has no way of knowing about new files that have been dropped into the directory. You'd have to write some custom Javascript code to do that. 

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/466e010b-77dc-44ab-9f01-80031910a769%40googlegroups.com.

Andrew Milner

unread,
Dec 18, 2019, 7:06:23 AM12/18/19
to weewx-user
if the files are named in the same way as standard NOAA files the surely cheetah will think that it 'might have generated' them and so include them in the drop down??



On Wednesday, 18 December 2019 13:11:09 UTC+2, Thomas Keffer wrote:
That's correct, except that the WeeWX Cheetah code knows only of the files it has either generated, or might have generated. It has no way of knowing about new files that have been dropped into the directory. You'd have to write some custom Javascript code to do that. 

-tk

On Tue, Dec 17, 2019 at 11:15 PM Andrew Milner <andrew....@gmail.com> wrote:
have you tried just putting the reports into the NOAA directory and naming them in the same way as the weewx NOAA files??  It should work I would have thought - the drop down is populated by cheetah when the archive.html page is generated I think.

On Wednesday, 18 December 2019 07:20:12 UTC+2, peter wrote:
I have NOAA reports from other software I was using before switching to weewx. Database contains only “fresh” data and not the data from previous software.
Is it possible to include the links to ma old NOAA reports into the “archive.html.tmpl” page automatically? I’m using neowx skin. A workaround is to manually put the links into the template file.
Thanks.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Thomas Keffer

unread,
Dec 18, 2019, 7:14:55 AM12/18/19
to weewx-user
It doesn't work that way, at least, not now. The problem is that if you drop the files into the HTML directory, WeeWX has no way of knowing they exist, and, due to security reasons, browsers are not allowed to, well, browse webserver directories. There are ways around that using PHP or Javascript code running on the webserver, but you'd have to write that.

The only other option I can think of is to create a special subdirectory in the skins subdirectory that holds old files that are to be copied over to the HTML directory by the CopyGenerator. Then WeeWX could detect them.

As always, PRs are welcome. :-)

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/8e5bd1ec-1a38-4a45-ae62-66ece80674ab%40googlegroups.com.

Andrew Milner

unread,
Dec 18, 2019, 7:39:07 AM12/18/19
to weewx-user
the OP said he already had the reports, and implied he just wanted to be able to view them.

I was thinking along the lines of naming the files ...txt just as they are now in the NOAA dorectory.  Unless weewx has changed the way to view these NOAA reports was via a selector control on the html page and the selector control was populated by cheetah.  I assumed it was using a directory listing to generate the linkages in the control to the actual .txt files and o just adding more .txt files cheetah would be none the wiser as to who had created the .txt files in that the naming convention would match those created by weewx.  No need to browse the directory - just use the selection control to view the selected file.

have we got our wires crossed perhaps??

Andrew


On Wednesday, 18 December 2019 14:14:55 UTC+2, Thomas Keffer wrote:
It doesn't work that way, at least, not now. The problem is that if you drop the files into the HTML directory, WeeWX has no way of knowing they exist, and, due to security reasons, browsers are not allowed to, well, browse webserver directories. There are ways around that using PHP or Javascript code running on the webserver, but you'd have to write that.

The only other option I can think of is to create a special subdirectory in the skins subdirectory that holds old files that are to be copied over to the HTML directory by the CopyGenerator. Then WeeWX could detect them.

As always, PRs are welcome. :-)

-tk

On Wed, Dec 18, 2019 at 5:06 AM Andrew Milner <andrew....@gmail.com> wrote:
if the files are named in the same way as standard NOAA files the surely cheetah will think that it 'might have generated' them and so include them in the drop down??



On Wednesday, 18 December 2019 13:11:09 UTC+2, Thomas Keffer wrote:
That's correct, except that the WeeWX Cheetah code knows only of the files it has either generated, or might have generated. It has no way of knowing about new files that have been dropped into the directory. You'd have to write some custom Javascript code to do that. 

-tk

On Tue, Dec 17, 2019 at 11:15 PM Andrew Milner <andrew....@gmail.com> wrote:
have you tried just putting the reports into the NOAA directory and naming them in the same way as the weewx NOAA files??  It should work I would have thought - the drop down is populated by cheetah when the archive.html page is generated I think.

On Wednesday, 18 December 2019 07:20:12 UTC+2, peter wrote:
I have NOAA reports from other software I was using before switching to weewx. Database contains only “fresh” data and not the data from previous software.
Is it possible to include the links to ma old NOAA reports into the “archive.html.tmpl” page automatically? I’m using neowx skin. A workaround is to manually put the links into the template file.
Thanks.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/466e010b-77dc-44ab-9f01-80031910a769%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Thomas Keffer

unread,
Dec 18, 2019, 7:54:52 AM12/18/19
to weewx-user
Scanning the HTML directory is something I considered a long time ago, but, as I recall, rejected it because it would require special knowledge of which files should be included in which dropdown list. The scanner would have to recognize patterns like YYYY-MM and YYYY. It started to get too complicated for the small, incremental benefit, so I dropped the idea.

In the case of the Seasons skin, one simple solution is to change titlebar.inc so that instead of populating the drop down list with just the contents of $monthYear, it augments it with the extra files. But, that would have to be done on a case-by-case basis. Other skins would have similar solutions.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d4d23608-c9e6-4b33-955e-1105d7564342%40googlegroups.com.

peter

unread,
Dec 18, 2019, 8:34:01 AM12/18/19
to weewx-user
Thank you both. I copied the files into the html/NOAA directory but they didn't show up in the table (neowx skin).
No worries, I edited the html template and manually added the links.
I had to do some bash exercise to rename the reports from WD to weewx format :-)

A little off-topic: in my another setup, the archive template links to NOAA reports from 1970 on (they don't exist, of course). What would be the reason for this?

Thanks,
Peter

Dne sreda, 18. december 2019 13.54.52 UTC+1 je oseba Thomas Keffer napisala:
Scanning the HTML directory is something I considered a long time ago, but, as I recall, rejected it because it would require special knowledge of which files should be included in which dropdown list. The scanner would have to recognize patterns like YYYY-MM and YYYY. It started to get too complicated for the small, incremental benefit, so I dropped the idea.

In the case of the Seasons skin, one simple solution is to change titlebar.inc so that instead of populating the drop down list with just the contents of $monthYear, it augments it with the extra files. But, that would have to be done on a case-by-case basis. Other skins would have similar solutions.

-tk

Thomas Keffer

unread,
Dec 18, 2019, 9:04:43 AM12/18/19
to weewx-user
A little off-topic: in my another setup, the archive template links to NOAA reports from 1970 on (they don't exist, of course). What would be the reason for this?

Not off topic at all.

The cheetahgenerator scans the database to determine which NOAA files to generate. Most likely you have some records in the archive with timestamps circa 1970. Easy to happen if you don't have a realtime clock.

-tk

peter

unread,
Dec 18, 2019, 11:49:26 PM12/18/19
to weewx-user
Thanks for clarification. I will search the forum for solution (probably discussed already). I probably need to remove those entries from the database.

Thomas Keffer

unread,
Dec 19, 2019, 7:25:07 AM12/19/19
to weewx-user
The wiki article Cleaning up old 'bad' data is a good place to get started. 

Thinking about it, a very simple way to get rid of all bogus data, is to simply delete anything before, say, 1-Jan-2000. 

You may have to adjust the path to weewx.sdb, and you may have to use sudo:

sqlite3 /var/lib/weewx/weewx.sdb
sqlite> DELETE FROM archive WHERE dateTime < strftime('%s', '2000-01-01');

Then rebuild the daily summaries as per the Wiki article.

Make a backup first.

-tk




On Wed, Dec 18, 2019 at 9:49 PM peter <pete...@gmail.com> wrote:
Thanks for clarification. I will search the forum for solution (probably discussed already). I probably need to remove those entries from the database.

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a8a8d20b-707d-4db2-967b-57ebfbb91095%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages