Using Belchertown skin, Want to drop some database fields

128 views
Skip to first unread message

ed100

unread,
Feb 13, 2020, 5:54:46 PM2/13/20
to weewx-user
I have the Belchertown skin with MQTT running nicely after some serious help from folks here.
There are a bunch of fields in the weewx mariadb database that I will never use.  I did some searching to how to do this but didn't find out how. 
I don't want to damage things, just clean up unnecessary fields. (old habits...)
I did grab the extraTemp1 and use it to show the cpu temp on the weewx raspberry.

Thanks

vince

unread,
Feb 13, 2020, 6:57:42 PM2/13/20
to weewx-user
Consider the low cost of disk versus the high cost of your time+effort.

They don't take too much space, and you'll forever after have to run off a non-standard database schema, making upgrades likely harder to do.

You can certainly alter the schema weewx uses, and use wee_database to alter your archive table before doing --rebuild-daily to rebuild the summary tables, but that's a whole lot of work for not much gain in terms of space.  Disk is so cheap now, it's probably an over-optimization to work that hard.

ed100

unread,
Feb 13, 2020, 7:27:08 PM2/13/20
to weewx-user
What would happen if I edit the wview_extended.schema, drop the current weewx databast and just open up a fresh database using new schema with the fields I want to use, of course including the required ones?

In part I am trying to understand how things work.

Thomas Keffer

unread,
Feb 13, 2020, 7:52:57 PM2/13/20
to weewx-user
Dropping a column is easy enough. Consult your Mariadb documentation, but it should be something like (NOT TESTED)

ALTER TABLE archive DROP COLUMN leafWet2;
DROP TABLE archive_day_leaf;

WeeWX only stores data that appear as columns in the database, so this won't cause a problem as far as it is concerned.

However, I think you'll be disappointed in how little space it saves. Much of the space is taken up by indexes.

-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/b97b1926-70f7-46d9-8d84-5db354556066%40googlegroups.com.

ed100

unread,
Feb 13, 2020, 8:03:33 PM2/13/20
to weewx-user
I tested dropping a couple of columns like that and started getting errors:

such as:

Traceback (most recent call last):
  File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
    obj.start()
  File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
    self.run()
  File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
    self.genImages(self.gen_ts)
  File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
    aggregate_interval=aggregate_interval)
  File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_series
    raise weewx.UnknownType(obs_type)
weewx.UnknownType: radiation


radiation was a field I knew I would never use.  Before I dropped anything I dumped the database so was easy to put the columns back in including most of the data.

So I was convinced there was more to this that simply dropping columns from the database.

This was where I knew I was in deep over my head.

On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

vince

unread,
Feb 13, 2020, 8:51:31 PM2/13/20
to weewx-user
On Thursday, February 13, 2020 at 5:03:33 PM UTC-8, ed100 wrote:
This was where I knew I was in deep over my head.


Ok - I have to admit laughing.  We've all been there.

Disk is sooooo cheap now and you'll save so little in real life, it really is generally wise to just go with the defaults.

I forget the exact numbers, but my recollection is I converted my 10+ years of sqlite3 db to the extended schema and it was maybe 30% bigger or so.   Not worth my effort to try to strip out the extra elements I don't need 'now' that I might need 'someday'.   

ed100

unread,
Feb 13, 2020, 9:12:18 PM2/13/20
to weewx-user
Perhaps a bit of background, I started coding Fortran on state of the art IBM1620, I whole total 16k of memory.  It filled a large room.  That teaches you to conserve assets. I am retired so time is not something I worry about.
I wrote my first shopping cart in mid-90's and had a bunch of emails from Widenius and  Lerdorf about mysql and php,I was able  break them pretty regularly for couple of years.

When I looked at archive table in phpmyadmin it shows index is small.  When I look at the actually db files on server --right now each day archive used almost 100k, so removing say 25 columns is a bunch and also makes everything run faster.   

Anyway still don't understand why I would get errors if weewx truely just looks at the column list.

This is a lot better than sitting in  front of a tv eating chips.

On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Thomas Keffer

unread,
Feb 13, 2020, 9:31:42 PM2/13/20
to weewx-user
You're getting the error because you're still asking for a plot of radiation. Remove the reference in skin.conf and the error should go away.

I started on an IBM 1130 with 8k of memory, 50+ years ago.  But, I've learned to be enjoy that cheap memory and not sweat it. 



--
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.

Andrew Milner

unread,
Feb 13, 2020, 10:24:25 PM2/13/20
to weewx-user
I cant resist chipping in here - I started with PDP-8 50 yrs ago with 4K memory and although I love cheap disk space I still cannot stand the (IMHO) profligate use of memory and the grossly inefficient use of processor power in modern systems.

To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

ed100

unread,
Feb 14, 2020, 7:48:31 AM2/14/20
to weewx-user
Nope, the word radiation is not in skin.conf and not in graph.conf.  Was first thing I did was search for the radiation in Belchertown directory. I just put radiation back in database cause I didn't want to mess with any error trapping right now. I knew how I caused it.

Thomas: I told you I had state of the art not some garage sale special IBM 1130 :)

Andrew:  We sure agree. I really like weewx so don't want to knock it but most any book on sql/databases says not every field in database needs be the same type. It may be that it is just easier to write code and not spend too much time optimising it.  Saying that there is so much good stuff out there I  just amazed.

Sorry for getting off topic but us old guys just do that.
 
What about my idea of mod  wview_extended.schema?

On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Thomas Keffer

unread,
Feb 14, 2020, 8:25:30 AM2/14/20
to weewx-user
"radiation" has to be in there somewhere. It's not hardwired into WeeWX.

--
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/f4bef1ca-033e-4818-a3bc-246d14d0fc9e%40googlegroups.com.

ed100

unread,
Feb 14, 2020, 8:37:50 AM2/14/20
to weewx-user
It is in Belchertown/jason/weewx_data.json.tmpl


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

gjr80

unread,
Feb 14, 2020, 8:40:35 AM2/14/20
to weewx-user
The log snippet you posted gave no context, a skin is trying to plot radiation but we can't tell which. You might be using Belcehertown but are you also still generating Standard or Seasons? The answer will be in the log, just needed to see a bit more :)

Gary

ed100

unread,
Feb 14, 2020, 9:09:16 AM2/14/20
to weewx-user
From syslog (right after this it just has usual MQTT publish, etc):
Feb 13 15:50:34 localhost weewx[2940] INFO weewx.manager: Added record 2020-02-13 15:50:00 CST (1581630600) to database 'weewx'
Feb 13 15:50:34 localhost weewx[2940] INFO weewx.manager: Added record 2020-02-13 15:50:00 CST (1581630600) to daily summary in 'weewx'
Feb 13 15:50:34 localhost weewx[2940] INFO weewx.restx: MQTT: Published record 2020-02-13 15:50:00 CST (1581630600)
Feb 13 15:50:37 localhost weewx[2940] INFO weewx.cheetahgenerator: Generated 9 files for report StandardReport in 2.76 seconds
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****  radiation
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****      obj.start()
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****      self.run()
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_series
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****      raise weewx.UnknownType(obs_type)
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****  weewx.UnknownType: radiation
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine:         ****  Generator terminated
Feb 13 15:50:44 localhost weewx[2940] INFO weewx.reportengine: Copied 34 files to /var/www/html/weewx
Feb 13 15:50:44 localhost weewx[2940] INFO user.belchertown: version 1.1b8


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Pat

unread,
Feb 14, 2020, 10:03:51 AM2/14/20
to weewx-user
Doesn't appear to be Belchertown related based on this line. Looks like something with the Standard skin you have loaded (which is saving output to /var/www/html/weewx)

Generated 9 files for report StandardReport in 2.76 seconds
Feb 13 15:50:44 localhost weewx[2940] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'


ed100

unread,
Feb 14, 2020, 10:14:49 AM2/14/20
to weewx-user
Wonder how radiation got into Belchertown/jason/weewx_data.json.tmpl ?


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Pat

unread,
Feb 14, 2020, 10:28:13 AM2/14/20
to weewx-user
It's in there as part of the code, but it should only be processed if there's data. As defined by these lines here

The error you're having is with ImageGenerator, which Belchertown does not use. 

John Kline

unread,
Feb 14, 2020, 10:33:38 AM2/14/20
to weewx...@googlegroups.com
Question for ed100–not necessarily the cause of the issue–
did you drop the archive_day_radiation table when you removed radiation from the schema?

On Feb 14, 2020, at 7:28 AM, Pat <p...@obrienphoto.net> wrote:


--
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.

vince

unread,
Feb 14, 2020, 10:36:48 AM2/14/20
to weewx-user
On Friday, February 14, 2020 at 7:33:38 AM UTC-8, John Kline wrote:
Question for ed100–not necessarily the cause of the issue–
did you drop the archive_day_radiation table when you removed radiation from the schema?



Agree.   Most of the skins I've seen plot things conditionally if there is data in some record in the database for that element. 

ed100

unread,
Feb 14, 2020, 10:51:20 AM2/14/20
to weewx-user
Pat:  got it.  I sent cpu temp as extraTemp1, when I added extraTemp1 to station_observations it did not get added till I commented out the if statement so for some reason weewx didn't think there was data but there was.  When commented out displays next to radar just fine and graphs at bottom of page fine, one thing is there is printed (a link) homepage in a <div> that is empty next to wind rose. 

John:  yes I did drop  archive_day_radiation table


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Pat

unread,
Feb 14, 2020, 11:15:55 AM2/14/20
to weewx-user
You've lost me slightly. Is your site public that I could take a peek at? If you disable the Standard skin in weewx.conf by setting enabled=false under [[StandardReport]], then restart weewx, does the error in syslog clear?

ed100

unread,
Feb 14, 2020, 11:20:42 AM2/14/20
to weewx-user
Not public.  After I got the error, I put radiation/day radiation back into database so can't go back and look at logs or test.  I could drop the column and test it.  Do I also need to drop the archive_day as well?


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Pat

unread,
Feb 14, 2020, 11:30:41 AM2/14/20
to weewx-user
Sure, make sure you have database backups just in case. Try removing the radiation column from the archive table, and drop the entire archive_day_radiation table. Then disable the StandardReport skin as mentioned above in weewx.conf, then restart weewx and see what errors you get. 

ed100

unread,
Feb 14, 2020, 11:34:00 AM2/14/20
to weewx-user
I can do it.


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

ed100

unread,
Feb 14, 2020, 11:48:41 AM2/14/20
to weewx-user
got related error--from syslog:

Feb 14 10:45:33 localhost weewx[22817] INFO weewx.restx: MQTT: Published record 2020-02-14 10:45:00 CST (1581698700)
Feb 14 10:45:33 localhost weewx[22817] INFO user.belchertown: version 1.1b8
Feb 14 10:45:34 localhost weewx[22817] INFO user.belchertown: New forecast file downloaded to /var/www/html/weewx/belchertown/json/darksky_forecast.json
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Belchertown/json/weewx_data.json.tmpl
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'max' while searching for 'day.radiation.max'
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Belchertown_json_weewx_data_json_tmpl.py", line 565, in respond
Feb 14 10:45:35 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'max' while searching for 'day.radiation.max'
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'SyntaxError'>'
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Belchertown/graphs/index.html.tmpl
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: **** Reason: invalid syntax (_home_weewx_skins_Belchertown_graphs_index_html_tmpl.py, line 192)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 828, in compile
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      source, file, generatedModuleCode, exception=e)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 2044, in genParserErrorFromPythonException
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      reader = SourceReader(source, filename=filename)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/SourceReader.py", line 19, in __init__
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      self._srcLen = len(src)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  TypeError: object of type 'NoneType' has no len()
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  During handling of the above exception, another exception occurred:
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 320, in generate
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      filtersLib=weewx.cheetahgenerator)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1336, in __init__
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      self._compile(source, file, compilerSettings=compilerSettings)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1637, in _compile
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      keepRefToGeneratedCode=True)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 832, in compile
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      raise e
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 823, in compile
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      co = compile(generatedModuleCode, __file__, 'exec')
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Belchertown_graphs_index_html_tmpl.py", line 192
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****      self._handleCheetahInclude("page-header.inc" -->, trans=trans, includeFrom="file", raw=False)
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****                                                     ^
Feb 14 10:45:36 localhost weewx[22817] ERROR weewx.cheetahgenerator: ****  SyntaxError: invalid syntax
Feb 14 10:45:37 localhost weewx[22817] INFO weewx.cheetahgenerator: Generated 9 files for report Belchertown in 3.92 seconds
Feb 14 10:45:37 localhost weewx[22817] INFO weewx.reportengine: Copied 31 files to /var/www/html/weewx/belchertown
Feb 14 10:45:42 localhost weewx[22817] INFO weeutil.rsyncupload: rsync'd 47 files (770,134 bytes) in 0.45 seconds
Feb 14 10:45:43 localhost weewx[22817] INFO weewx.restx: MQTT: Published record 2020-02-14 10:45:33 CST (1581698733)
Feb 14 10:45:53 localhost weewx[22817] INFO weewx.restx: MQTT: Published record 2020-02-14 10:45:43 CST (1581698743)


On Thursday, February 13, 2020 at 4:54:46 PM UTC-6, ed100 wrote:

Pat

unread,
Feb 14, 2020, 1:04:31 PM2/14/20
to weewx-user
Ah, yes this error a Belchertown error. I see why, I don't have the conditional wrapped around it. Oops. I just pushed a commit to fix it

You're using the beta version of the skin, replace your weewx_data.json.tmpl with this one from the commit and see how it goes?

ed100

unread,
Feb 14, 2020, 1:53:49 PM2/14/20
to weewx-user
I downloaded weewx_data.json.tmpl and I am using the beta.

Restarted weewx with the new .tmpl and got following error:

Feb 14 12:50:30 localhost weewx[24717] INFO weewx.restx: MQTT: Published record 2020-02-14 12:50:00 CST (1581706200)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'SyntaxError'>'
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Belchertown/graphs/index.html.tmpl
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: **** Reason: invalid syntax (_home_weewx_skins_Belchertown_graphs_index_html_tmpl.py, line 192)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 828, in compile
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      source, file, generatedModuleCode, exception=e)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 2044, in genParserErrorFromPythonException
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      reader = SourceReader(source, filename=filename)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/SourceReader.py", line 19, in __init__
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      self._srcLen = len(src)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  TypeError: object of type 'NoneType' has no len()
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  During handling of the above exception, another exception occurred:
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 320, in generate
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      filtersLib=weewx.cheetahgenerator)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1336, in __init__
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      self._compile(source, file, compilerSettings=compilerSettings)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1637, in _compile
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      keepRefToGeneratedCode=True)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 832, in compile
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      raise e
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 823, in compile
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      co = compile(generatedModuleCode, __file__, 'exec')
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Belchertown_graphs_index_html_tmpl.py", line 192
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****      self._handleCheetahInclude("page-header.inc" -->, trans=trans, includeFrom="file", raw=False)
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****                                                     ^
Feb 14 12:50:31 localhost weewx[24717] ERROR weewx.cheetahgenerator: ****  SyntaxError: invalid syntax
Feb 14 12:50:32 localhost weewx[24717] INFO weewx.cheetahgenerator: Generated 10 files for report Belchertown in 1.87 seconds
Feb 14 12:50:32 localhost weewx[24717] INFO weewx.reportengine: Copied 2 files to /var/www/html/weewx/belchertown
Feb 14 12:50:36 localhost weewx[24717] INFO weeutil.rsyncupload: rsync'd 18 files (617,503 bytes) in 0.34 seconds
Feb 14 12:50:40 localhost weewx[24717] INFO weewx.restx: MQTT: Published record 2020-02-14 12:50:30 CST (1581706230)

Pat

unread,
Feb 14, 2020, 1:58:39 PM2/14/20
to weewx-user
Did you make any changes to page-header.inc ?

ed100

unread,
Feb 14, 2020, 2:05:09 PM2/14/20
to weewx-user
Not sure --I will look, where do I find page-header.inc?

Pat

unread,
Feb 14, 2020, 2:06:09 PM2/14/20
to weewx-user
skins/Belchertown/page-header.inc

I'm not sure what that last error is all about but it mentions this file. 

ed100

unread,
Feb 14, 2020, 2:14:31 PM2/14/20
to weewx-user
In this line:
                #include "page-header.inc"  -->
so I made it                 #include "page-header.inc"

and restarted weewx, waiting to see if that fixed it, bet it does.

Now if I can also get rid of the extra Homepage link just before the windrose and cpu temp.

You think that now I can remove more columns w/o harm?

Pat

unread,
Feb 14, 2020, 2:17:20 PM2/14/20
to weewx-user
There was "-->" somewhere in reference to page-header.inc? That's wrong so yes that should be removed. Not sure why that's there. 

Which extra homepage link? Your windrose and CPU temp are specific to your install (e.g. I don't have CPU temp). So I don't know what you're referring to. Can you send a screenshot or something?

yes, sure, keep removing columns as you see fit. Just have backups in case something goes sideways. 

ed100

unread,
Feb 14, 2020, 2:19:22 PM2/14/20
to weewx-user
How do you comment lines in .tmpl? 
Removing the -->  fixed errors:

Feb 14 13:15:32 localhost weewx[25227] INFO weewx.cheetahgenerator: Generated 11 files for report Belchertown in 1.61 seconds

Pat

unread,
Feb 14, 2020, 2:21:43 PM2/14/20
to weewx-user
My guess is the --> was a bad copy/paste from something else. 

To comment a line, use 2 #'s. 

## this is a comment.

John Kline

unread,
Feb 14, 2020, 2:25:11 PM2/14/20
to weewx...@googlegroups.com
A Cheetah user’s guide is here:

On Feb 14, 2020, at 11:21 AM, Pat <p...@obrienphoto.net> wrote:


--
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.

ed100

unread,
Feb 14, 2020, 2:33:44 PM2/14/20
to weewx-user
Thanks, i read on net and saw at least 5 different ideas about how to comment.
I imagine it was a bad copy/paste.

The screenshot shows Homepage kind of by itself. What I expected to happen was windrose where homepage is and cpu temp where windrose is.

The way I get cpu temp is my bcrobotics driver sends weewx the cpu temp as extraTemp1 and I relabel to cpu temp.  Have not figured out how to say it is C instead of F.
Screenshot at 2020-02-14 13-28-03.png

Pat

unread,
Feb 14, 2020, 2:45:29 PM2/14/20
to weewx-user
Your customized graphs.conf has a Homepage section within it somewhere. Remove that and it should go away on next archive interval.

ed100

unread,
Feb 14, 2020, 2:45:37 PM2/14/20
to weewx-user
John:  Holy Cow, That is more than a 3 minute read,  I heard that when a coder says he will have some piece of code done in 10 mins you think, that means 10 hours., Don't thinkI could read and understand it in 3 weeks. I did bookmark it.

ed100

unread,
Feb 14, 2020, 3:05:05 PM2/14/20
to weewx-user
Pat, removed the [homepage] section at about line 35 thru line 42 in graph.conf.  I just copied the .conf from example.

Then got errors:
Feb 14 14:00:28 localhost weewx[25495] INFO weewx.restx: MQTT: Published record 2020-02-14 14:00:00 CST (1581710400)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Parsing failed with several errors.#012First error at line 34.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      obj.start()
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      self.run()
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 150, in run
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      ngen = self.generate(gen_dict[section_name], self.gen_ts)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 220, in generate
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], gen_ts)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 220, in generate
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], gen_ts)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 309, in generate
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      default_binding)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 376, in _getSearchList
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      searchList += obj.get_extension_list(timespan, db_lookup)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/user/belchertown.py", line 204, in get_extension_list
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      chart_dict = configobj.ConfigObj(chart_config_path, file_error=True)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/usr/lib/python3/dist-packages/configobj.py", line 1229, in __init__
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      self._load(infile, configspec)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/usr/lib/python3/dist-packages/configobj.py", line 1318, in _load
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      raise error
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "<string>", line None
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  configobj.ConfigObjError: Parsing failed with several errors.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  First error at line 34.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Generator terminated
Feb 14 14:00:28 localhost weewx[25495] INFO weewx.reportengine: Copied 2 files to /var/www/html/weewx/belchertown
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine: reportengine: Caught unrecoverable exception in generator 'user.belchertown.HighchartsJsonGenerator'
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Parsing failed with several errors.#012First error at line 34.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 202, in run
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      obj.start()
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 285, in start
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      self.run()
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/user/belchertown.py", line 1022, in run
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      self.chart_dict = configobj.ConfigObj(chart_config_path, file_error=True)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/usr/lib/python3/dist-packages/configobj.py", line 1229, in __init__
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      self._load(infile, configspec)
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "/usr/lib/python3/dist-packages/configobj.py", line 1318, in _load
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****      raise error
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****    File "<string>", line None
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  configobj.ConfigObjError: Parsing failed with several errors.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  First error at line 34.
Feb 14 14:00:28 localhost weewx[25495] ERROR weewx.reportengine:         ****  Generator terminated
Feb 14 14:00:29 localhost weewx[25495] INFO weeutil.rsyncupload: rsync'd 2 files (170,838 bytes) in 0.28 seconds
Feb 14 14:00:38 localhost weewx[25495] INFO weewx.restx: MQTT: Published record 2020-02-14 14:00:28 CST (1581710428)

ed100

unread,
Feb 14, 2020, 3:10:25 PM2/14/20
to weewx-user

When I put the [homepage] things back it errors went away.

Pat

unread,
Feb 14, 2020, 3:12:04 PM2/14/20
to weewx-user
Send me your whole graphs.conf. 

ed100

unread,
Feb 14, 2020, 3:20:21 PM2/14/20
to weewx-user
here it is
graphs.conf

Pat

unread,
Feb 14, 2020, 3:37:18 PM2/14/20
to weewx-user
Your windrose isn't defined correctly. Replace it with this instead. Note the number of brackets. 

    [[chart5]]
        title
= Wind Rose
       
[[[windRose]]]

ed100

unread,
Feb 14, 2020, 4:09:43 PM2/14/20
to weewx-user
I have 
    [[chart5]]
        [[roseplt]]
            title = Wind Rose
            [[[windRose]]]

It looks like I have the same brackets.

The diff is         [[roseplt]]
Am I suppose to delete that?

ed100

unread,
Feb 14, 2020, 4:25:28 PM2/14/20
to weewx-user
    When I deleted 
        [[roseplt]]

and put the [homepage] back in, no errors but there are now two wind roses.

ed100

unread,
Feb 14, 2020, 5:03:32 PM2/14/20
to weewx-user
Thanks to everone who commented and esp Pat,  I cleared browser cache, restarted weewx and closes browser page and reopened and now looks great, as I wanted.
This  [[roseplt]]  was on the graph doc page so I copy/pasted it to graph.conf, Don't know why but removing it cured the [homepage] deal.

Thanks so much.  Now back to original thing, I can remove some more columns which was the goal.  Now if I can just get the rain gauge to stop sending spurious rain fall.
Reply all
Reply to author
Forward
0 new messages