weewx beta version 4.0.0b18

382 views
Skip to first unread message

Phil Owers

unread,
Apr 4, 2020, 5:40:41 AM4/4/20
to weewx-user
Hi Guys

First of all I hope everybody is staying safe and well

Before I go into to many details  should weewx v4.0.0b18 work on its own.

Followed the Installation using setup.py, loaded all the prerequisites for Debian 10(Buster)
Installed using python3 ./setup.py build  , sudo python3 ./setup.py install

Entered the name, vantage (6), serial , metric, ttyusb0  etc.

Then started weewx using sudo ./bin/weewx
It downloaded all the data from my test console (This works fine plug into another rasp pi v 3.9.2) then failed continuously overnight with no graphs being generated.
The weewx.sdb was generated.

Apr  4 10:22:20 raspberrypi weewx[1030] INFO weewx.manager: Starting backfill of daily summaries
Apr  4 10:22:22 raspberrypi weewx[1030] INFO weewx.engine: Starting main packet loop.
Apr  4 10:22:26 raspberrypi weewx[1030] INFO weewx.engine: Main loop exiting. Shutting engine down.
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__: Caught OSError: [Errno 5] Input/output error
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****  Traceback (most recent call last):
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****    File "./bin/weewxd", line 154, in main
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****      engine.run()
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 191, in run
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 224, in dispatchEvent
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****      callback(event)
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 740, in new_loop_packet
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****      to_sorted_string(event.packet))
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****  OSError: [Errno 5] Input/output error
Apr  4 10:22:26 raspberrypi weewx[1030] CRITICAL __main__:     ****  Waiting 10 seconds then retrying...
Apr  4 10:22:28 raspberrypi kernel: [38075.324656] usb 1-1.3: new high-speed USB device number 6 using xhci_hcd

No extensions have been added . Apologies if Ive jumped the gun and this doesn't work yet as a standalone
Phil

gjr80

unread,
Apr 4, 2020, 6:08:34 AM4/4/20
to weewx-user
Hi,

4.0.0b18 (or for that matter the current master branch on github) runs just fine. You ran WeeWX directly by using sudo ./bin/weewxd, did you leave the terminal session you ran that command in open overnight or did you close it? It would have needed to have been left open.

Gary

Phil Owers

unread,
Apr 5, 2020, 8:11:33 AM4/5/20
to weewx-user
Thanks Gary 
Changed it run automatically from start up and it worked fine overnight
So decided the next step was to load steelguages 2.7.4 via wee_extension.   It loaded ok but the next download I got the following errors 

Apr  5 13:00:19 raspberrypi weewx[604] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html
Apr  5 13:00:19 raspberrypi weewx[604] INFO weewx.reportengine: Copied 6 files to /home/weewx/public_html/ss
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'TypeError'>'
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_ss_gauge_data_txt_tmpl.py", line 339, in respond
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'
Apr  5 13:00:19 raspberrypi weewx[604] INFO weewx.cheetahgenerator: Generated 1 files for report SteelSeries in 0.32 seconds
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  rainrate
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 197, in run
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      obj.start()
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 280, in start
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      self.run()
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_series
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      raise weewx.UnknownType(obs_type)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  weewx.UnknownType: rainrate
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  Generator terminated

Phil 

gjr80

unread,
Apr 5, 2020, 8:24:52 AM4/5/20
to weewx-user
Phil,

You wouldn’t happen to have less than 24 hours of data in your database would you? Looking at the gauge-data.txt.tmpl template I suspect the problem is that the template cannot handle the case where there is less than 24 hours of data in the database. The template needs to be fixed but I suspect it will come good within a day.

Of course if you do have more than 24 hours of data in your database then that theory is shot.

Gary

Phil Owers

unread,
Apr 5, 2020, 9:17:16 AM4/5/20
to weewx-user
Gary
It downloaded all the records from the console which was about 3 weeks records but the last 24 hrs did have some gaps so I downloaded my full working copy of weewx.sdb 
but im afraid the result was the same with the same errors
Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Phil Owers

unread,
Apr 5, 2020, 11:34:48 AM4/5/20
to weewx-user
If I take out the rainrate in ss/skin.conf that gets rid of the rainrate error in the log
If I ## all the lines with rain in them in gauge.date.txt file in SS then all the other errors in the log then go and the gauge.data.txt is formed correctly(all be it without the rain info)

Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Gary Roderick

unread,
Apr 5, 2020, 4:02:13 PM4/5/20
to weewx...@googlegroups.com
Ok, thinking some more the error could also occur if the current day has a one hour period (from the top of the hour) where there is no rain data (as distinct from  rain data that is zero). The issue is definitely tied to the current days rain data, that is confirmed by your modifications. Give it a day of continuous operation and return the template to normal and see if the error has gone. Meantime I will try to harden the template today.

Gary

--
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/34f4fc85-6725-4b27-8871-0f1623f7cf37%40googlegroups.com.
--

Gary

Phil Owers

unread,
Apr 6, 2020, 6:09:45 AM4/6/20
to weewx-user
Hi Gary
Returned gauge template to normal and restored rainrate in ss/skin.conf.
Its still failing at the moment
Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

gjr80

unread,
Apr 6, 2020, 9:08:06 AM4/6/20
to weewx-user
Hi Phil,

Now I am confused. I can see the mechanism that is causing the failure. The following code in the template:

#set $hourlyrainTH = 0
#set $ThourlyrainTH = ''
#for $hour in $day.hours
#if $hour.rain.sum.raw > $hourlyrainTH
#set $hourlyrainTH = $hour.rain.sum.raw
#set $ThourlyrainTH = $hour.dateTime.format("%H:%M")
#end if
#end for

determines the maximum hourly rainfall for the day and the hour in which it occurred by iterating over each hour in the current day. But for some reason $hour.rain.sum.raw returns python value None for at least one of the hours. Hence the error message:


Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: **** Reason: '>' not supported between instances of 'NoneType' and 'int'

There are only two > comparisons in the gauge-data.txt.tmpl; the other one is not rain related and is not causing the error. This is confirmed by you commenting out all the rain related lines in the template. As far as I can tell the only way that $hour.rain.sum.raw would return None is if there was no rain data in the archive for that hour or if some other error was involved. Normally field rain is zero if there is no rain recorded so $hour.rain.sum.raw would return 0 if there was no rain. Hence my questions about missing data, but once you have a solid compete day of data you should be fine.

In any case, I have modified the gauge-data.txt.tmpl so that it will skip the comparision if $hour.rain.sum.raw is None. I suspect there is some other underlying issue but at least now the template will generate without error. I will give this some more thought as how to track down what else might be going on. To install the revised gauge-data.txt.tmpl:

1. rename your existing skins/ss/gauge-data.txt.tmpl to gauge-data_orig.txt.tmpl or some other name in case you need to revert
2. download the attached gauge-data.txt.tmpl in place of your current version
3. wait for the next report cycle and confirm in the log that gauge-data.txt was generated without error.

Just out of interest have you had any rain since installing 4.0? If so has it been recorded/displayed correctly by WeeWX on the SteelSeries gauges or other pages?

Oh, and regards the imagegenrator error:

Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  rainrate
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 197, in run
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      obj.start()
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 280, in start
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      self.run()
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_series
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****      raise weewx.UnknownType(obs_type)
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  weewx.UnknownType: rainrate
Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.reportengine:         ****  Generator terminated

that will be due to the use of rainrate somewhere in the [ImageGenerator] stanza in skin.conf, the actual field name that WeeWX uses for rain rate is rainRate - case matters in this case.

Gary
gauge-data.txt.tmpl

Phil Owers

unread,
Apr 6, 2020, 9:24:29 AM4/6/20
to weewx-user
It rained this morning and it registered ok on another page
Cant tell about the gauges as while the log reports this error the gauge-data.txt file does not generate.
Loading your new gauge-data file now
Phil


On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Phil Owers

unread,
Apr 6, 2020, 9:37:22 AM4/6/20
to weewx-user
Gary
That worked and generated a gauge-data.txt file and it showed 0.2mm of hourly rain which is correct.

The log still has UnknownType rainrate when it try's to produce images

Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Phil Owers

unread,
Apr 6, 2020, 9:44:23 AM4/6/20
to weewx-user
Here is the log

Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.imagegenerator.ImageGenerator'
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****  rainrate
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 197, in run
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****      obj.start()
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 280, in start
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****      self.run()
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 41, in run
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****      self.genImages(self.gen_ts)
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 180, in genImages
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****      aggregate_interval=aggregate_interval)
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/xtypes.py", line 91, in get_series
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****      raise weewx.UnknownType(obs_type)
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****  weewx.UnknownType: rainrate
Apr  6 14:40:17 raspberrypi weewx[612] ERROR weewx.reportengine:         ****  Generator terminated

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Thomas Keffer

unread,
Apr 6, 2020, 10:06:46 AM4/6/20
to weewx-user
As Gary noted, it's rainRate, not rainrate. Case matters.

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

Phil Owers

unread,
Apr 6, 2020, 10:12:48 AM4/6/20
to weewx-user
Yep case sure does, log clear.  Apologies for that part no idea where that came from
Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Phil Owers

unread,
Apr 6, 2020, 10:23:35 AM4/6/20
to weewx-user
Gary
Couldn't understand where rainrate came from so Just wee_extension -- install steelseries-2.7.4tar.gz onto a spare pi and rainrate and not rainRate is in the ss/skin.conf file.
Any chance somebody else could try just to make sure.
Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

steeple ian

unread,
Apr 6, 2020, 10:37:09 AM4/6/20
to weewx...@googlegroups.com
Phil,
Your are correct. In the skin.conf and the .tmpl file it is rainrate not rainRate.
Ian

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

Phil Owers

unread,
Apr 6, 2020, 11:12:36 AM4/6/20
to weewx-user
This is interesting
I have a pi running 3.9.2 (Python2) which runs OK with rainrate (Steelgauges 2.7.4) ( yes all lower case)

But on a pi running v4.0.0.b18 (Python3) with Steelgauges 2.7.4 rainrate generates an error in the log which is corrected if its changed to rainRate.

Phil



On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

Thomas Keffer

unread,
Apr 6, 2020, 11:38:51 AM4/6/20
to weewx-user
As far as weewx is concerned, it's always been rainRate.

I don't know how Steelgauges works, but it's possible it's only used in case-insensitive database queries.

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

steeple ian

unread,
Apr 6, 2020, 2:46:44 PM4/6/20
to weewx...@googlegroups.com
Phil,
Could it be that you downloaded your installs from different places? I have just worked out that there are two out there.
Ian

Phil Owers

unread,
Apr 6, 2020, 3:04:06 PM4/6/20
to weewx...@googlegroups.com
I used steelseries-2.7.4.tar.gz
Phil

gjr80

unread,
Apr 6, 2020, 9:27:30 PM4/6/20
to weewx-user
Well looking into the rainrate/rainRate issue has been most interesting. First up rainrate has been used in skin.conf for the rain rate plot as follows since the SteelSeries Weather Gauges first directly supported WeeWX:

   [[images]]
       x_label_format
= %H:%M
       show_daynight
= true
       
[[[daybarometer]]]
           
[[[[barometer]]]]
       
[[[dayrain]]]
           yscale
= None, None, 0.02
           plot_type
= bar
           
[[[[rain]]]]
               aggregate_type
= sum
               aggregate_interval
= 3600
               label
= Rain (hourly total)
       
[[[dayrainrate]]]
           
[[[[rainrate]]]]

But why has this never caused a problem or been noticed before? I think the way in which plot data is obtained and the introduction of xtypes holds the answer. Before WeeWX v4 plot data was obtained via a call to manager.getSqlVectors() which itself is encapsulated in a try...finally statement. The result being that any error (for example a non-existant obs type) was effectively swallowed and no data returned by manager.getSqlVectors(). The image generator would then plot this non-data which resulted in a plot devoid of data. Given that rain rate plots are seldom looked at, quite often show no data, and also as this plot was only used as a mouseover on the SteelSeries rain rate gauge, it is not surprising it's lack of data was never noticed. Now consider the new xtypes regime, plot data now comes from xtypes and if my xtypes understanding is correct, the xtypes are searched until one is found that can return the required data. In this case no xtype can return data for field rainrate which results in a weewx.UnknownType error which is highlighted in the log and painfully obvious to the user.

Of course the fix is simple, replace rainrate with the correct field rainRate. This then got me wondering about the $hour.rain.sum.raw issue. I am still convinced this is tied to an underlying lack of rain data for at least one full hour in the day. My testing yesterday showed the gauge-data.txt template would handle such a lack of rain data without problem, which is counter to Phil's experience. But I was running under WeeWX 3.9.2 which does not use xtypes, I am now thinking there is a subtle difference in the data returned by xtypes in some corner cases. So far my understanding of xtypes has been fairly limited to just what I have needed to bget by in working on WeeWX 4.0 (which has not been much). Clearly I have a bit more reading to do (@tkeffer - warning there will be some xtypes questions inbound) and I will spend some time today seeing if I can replicate the issue.

Gary

John Kline

unread,
Apr 6, 2020, 10:03:35 PM4/6/20
to weewx...@googlegroups.com
For what it’s worth, rainRate has been a problem as I have it fixed in my copy of gauges.  I don’t know when I changed it as it is in my initial check in (Jan. 6) of my private (and modified) github copy.  In particular, I don’t know if I needed to change it for WeeWX 4.

On Apr 6, 2020, at 6:27 PM, gjr80 <gjrod...@gmail.com> 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.

Thomas Keffer

unread,
Apr 7, 2020, 7:39:50 AM4/7/20
to weewx-user
Gary,

Makes sense.

To gather data for a plot, version 3.9 called Manager.getSqlVectors(), which hit the database. Only types that appear in the database schema can be plotted. Because many databases are case-insensitive, rainRate and rainrate are treated the same, so it works.

By contrast, version 4.0 calls weewx.xtypes.get_series(). This function allows new types to be introduced, which are not necessarily in the database. If no extension has been registered that knows how to deal with a type, then xtypes consults the schema. If the type is not in there, an exception weewx.UnknownType is raised. The schema consultation is done in Python in a case-sensitive manner, so rainrate and rainRate are different.

This explains the difference in behavior.

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

Phil Owers

unread,
Apr 7, 2020, 8:55:07 AM4/7/20
to weewx-user
Hi Guys
With Garys help with getting a gauge-data.txt file to generate I decided to try the next step (Logs were all clear) and add 'appTemp' and 'windrun' using Pat O Brien ADDING A NEW OBSERVATION TYPE TO THE WEEWX DATABASE
I did this on 3.9.2 and it worked fine but on 4.0.0b18 and after using wee_databse --rebuild- daily which was successful 
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: Generate failed with exception '<class ' I get the folowing loNameMapper.NotFound'>'
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/NOAA/NOAA-%Y-%m.txt.tmpl
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'count' while searching for 'day.wind.count.raw'
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA__Y__m_txt_tmpl.py", line 431, in respond
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'count' while searching for 'day.wind.count.raw'
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/NOAA/NOAA-%Y.txt.tmpl
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'count' while searching for 'month.wind.count.raw'
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA__Y_txt_tmpl.py", line 862, in respond
Apr  7 13:38:09 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'count' while searching for 'month.wind.count.raw'
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/rss.xml.tmpl
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'max' while searching for 'day.wind.max'
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_rss_xml_tmpl.py", line 268, in respond
Apr  7 13:38:11 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'max' while searching for 'day.wind.max'
Apr  7 13:38:11 raspberrypi wee_reports[974] INFO weewx.cheetahgenerator: Generated 5 files for report SeasonsReport in 2.74 seconds
Apr  7 13:38:15 raspberrypi wee_reports[974] INFO weewx.imagegenerator: Generated 30 images for report SeasonsReport in 3.64 seconds
Apr  7 13:38:15 raspberrypi wee_reports[974] INFO weewx.reportengine: Copied 5 files to /home/weewx/public_html
Apr  7 13:38:16 raspberrypi wee_reports[974] INFO weewx.reportengine: Copied 6 files to /home/weewx/public_html/ss
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/ss/gauge-data.txt.tmpl
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'vecdir' while searching for 'day.wind.vecdir.formatted'
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_ss_gauge_data_txt_tmpl.py", line 586, in respond
Apr  7 13:38:17 raspberrypi wee_reports[974] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'vecdir' while searching for 'day.wind.vecdir.formatted'
Apr  7 13:38:17 raspberrypi wee_reports[974] INFO weewx.cheetahgenerator: Generated 1 files for report SteelSeries in 0.36 seconds
Apr  7 13:38:17 raspberrypi wee_reports[974] INFO weewx.imagegenerator: Generated 11 images for report SteelSeries in 0.46 seconds
Apr  7 13:39:37 raspberrypi kernel: [  174.471871] usb 1-1.3.3: new high-speed USB device number 7 using xhci_hcd
Apr  7 13:39:37 raspberrypi kernel: [  174.603032] usb 1-1.3.3: New USB device found, idVendor=0781, idProduct=5591, bcdDevice= 1.00
Apr  7 13:39:37 raspberrypi kernel: [  174.603046] usb 1-1.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr  7 13:39:37 raspberrypi kernel: [  174.603056] usb 1-1.3.3: Product: Ultra USB 3.0
Apr  7 13:39:37 raspberrypi kernel: [  174.603067] usb 1-1.3.3: Manufacturer: SanDisk
Apr  7 13:39:37 raspberrypi kernel: [  174.603076] usb 1-1.3.3: SerialNumber: 4C530001020621102111
Apr  7 13:39:37 raspberrypi kernel: [  174.614960] usb-storage 1-1.3.3:1.0: USB Mass Storage device detected
Apr  7 13:39:37 raspberrypi kernel: [  174.615444] scsi host0: usb-storage 1-1.3.3:1.0
Apr  7 13:39:37 raspberrypi mtp-probe: checking bus 1, device 7: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3.3"
Apr  7 13:39:37 raspberrypi mtp-probe: bus: 1, device: 7 was not an MTP device
Apr  7 13:39:37 raspberrypi mtp-probe: checking bus 1, device 7: "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3.3"
Apr  7 13:39:37 raspberrypi mtp-probe: bus: 1, device: 7 was not an MTP device
Apr  7 13:39:38 raspberrypi kernel: [  175.693342] scsi 0:0:0:0: Direct-Access     SanDisk  Ultra USB 3.0    1.00 PQ: 0 ANSI: 6
Apr  7 13:39:38 raspberrypi kernel: [  175.702713] sd 0:0:0:0: [sda] 60062500 512-byte logical blocks: (30.8 GB/28.6 GiB)
Apr  7 13:39:38 raspberrypi kernel: [  175.703995] sd 0:0:0:0: [sda] Write Protect is off
Apr  7 13:39:38 raspberrypi kernel: [  175.704013] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Apr  7 13:39:38 raspberrypi kernel: [  175.704789] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Apr  7 13:39:38 raspberrypi kernel: [  175.714995]  sda: sda1
Apr  7 13:39:38 raspberrypi kernel: [  175.718471] sd 0:0:0:0: [sda] Attached SCSI removable disk
Apr  7 13:39:38 raspberrypi kernel: [  175.724708] sd 0:0:0:0: Attached scsi generic sg0 type 0
Apr  7 13:39:39 raspberrypi kernel: [  176.157189] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Apr  7 13:39:39 raspberrypi dbus-daemon[682]: [session uid=1000 pid=682] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service' requested by ':1.7' (uid=1000 pid=745 comm="pcmanfm --desktop --profile LXDE-pi ")
Apr  7 13:39:39 raspberrypi systemd[633]: Starting Virtual filesystem metadata service...
Apr  7 13:39:39 raspberrypi dbus-daemon[682]: [session uid=1000 pid=682] Successfully activated service 'org.gtk.vfs.Metadata'
Apr  7 13:39:39 raspberrypi systemd[633]: Started Virtual filesystem metadata service.
Apr  7 13:39:39 raspberrypi systemd[1]: Created slice system-clean\x2dmount\x2dpoint.slice.
Apr  7 13:39:39 raspberrypi systemd[1]: Started Clean the /media/pi/SD mount point.
Apr  7 13:39:39 raspberrypi udisksd[361]: Mounted /dev/sda1 at /media/pi/SD on behalf of uid 1000
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/NOAA/NOAA-%Y-%m.txt.tmpl
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'count' while searching for 'day.wind.count.raw'
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_NOAA_NOAA__Y__m_txt_tmpl.py", line 431, in respond
Apr  7 13:40:16 raspberrypi weewx[624] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'count' while searching for 'day.wind.count.raw'

I restored the origanal weewx.sdb (without appTemp and windrun and and it works OK
I then tried update the database a second time and got the same results and the above log.
As it worked with the pre change weewx.sdb and not to the new database Im assuming (don't like doing that) the problem may well be the new database
Phil

On Saturday, April 4, 2020 at 10:40:41 AM UTC+1, Phil Owers wrote:

gjr80

unread,
Apr 7, 2020, 9:17:23 AM4/7/20
to weewx-user
Tom, OK, so sort of the right answer but for the wrong reason!

I don't know why it took so long for me to tweak but I now know why the following TypeError was occurring:

Apr  5 13:00:19 raspberrypi weewx[604] ERROR weewx.cheetahgenerator: ****  TypeError: '>' not supported between instances of 'NoneType' and 'int'

It's the change in the use of None in comparisons under python3 (Phil is running under python 3). Unless you are in the hour from 11pm to midnight iterating over the hours of the day will always return as least one hour where $hour.rain.sum.raw is None and the comparison below will return a TypeError under python3 if there is a None involved in the comparison. Nothing to do with missing rain data for the day. The fix is a change to the if statement as I posted earlier. Will submit that change and the rainrate/rainRate change as PRs to the SteelSeries Weather Gauges repo.

Gary

#set $hourlyrainTH = 0
#set $ThourlyrainTH = ''
#for $hour in $day.hours
#if $hour.rain.sum.raw > $hourlyrainTH
#set $hourlyrainTH = $hour.rain.sum.raw
#set $ThourlyrainTH = $hour.dateTime.format("%H:%M")
#end if
#end for

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

gjr80

unread,
Apr 7, 2020, 9:36:06 AM4/7/20
to weewx-user
V4 actually uses the wview_extended schema which is specified in a slightly different format to that used in V3. Pat's instructions are V3 specific. Try using the following as the step 2 code (untested):

import schemas.wview_extended

schema_extended
= {'table': schemas.wview_extended.table + [('appTemp', 'REAL'), ('windrun', 'REAL')],
                   
'day_summaries' : schemas.wview_extended.day_summaries}

Other steps should be fine as is.

Gary

Phil Owers

unread,
Apr 7, 2020, 11:00:43 AM4/7/20
to weewx-user
Sorry Gary it didn't work 
schema_extended = {'table': schemas.wview_extended.table +  [('appTemp', 'REAL'), ('windrun', 'REAL')], 'day_summaries' : schemas.wview_extended.day_summaries}
AttributeError: module 'schemas' has no attribute 'wview_extended'

I think its what you had written ??

Thomas Keffer

unread,
Apr 7, 2020, 11:03:44 AM4/7/20
to weewx-user
Either way of specifying a schema should work with V4. If it's not, that's a bug.

--
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/4092b020-64a6-4a3b-9ba6-7024c42eee5c%40googlegroups.com.

Phil Owers

unread,
Apr 7, 2020, 11:10:29 AM4/7/20
to weewx-user
Just pause on my last post.  Didn't spot you added   _extended on line 1 which I missed

Phil Owers

unread,
Apr 7, 2020, 12:36:12 PM4/7/20
to weewx-user
Added _extension but wee_database --reconfigure fails Duplicate Column name appTemp.
Checked weewx.sdb couldn't see appTemp, tried again still failed duplicate column name 'appTemp'
Deleted all from folder home/weewx/archive so it produced a new weewx.sdb
wee_database  --reconfigure still failed duplicate column 'appTemp'

File "./bin/wee_database", line 966, in <module>
    main()
  File "./bin/wee_database", line 145, in main
    reconfigMainDatabase(config_dict, db_binding)
  File "./bin/wee_database", line 354, in reconfigMainDatabase
    new_schema=manager_dict['schema'])
  File "/home/weewx/bin/weewx/manager.py", line 470, in reconfig
    with Manager.open_with_create(new_db_dict, schema=new_schema) as new_archive:
  File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create
    dbmanager = cls(connection, table_name=table_name, schema=schema)
  File "/home/weewx/bin/weewx/manager.py", line 93, in __init__
    self._initialize_database(schema)
  File "/home/weewx/bin/weewx/manager.py", line 207, in _initialize_database
    cursor.execute("CREATE TABLE %s (%s);" % (self.table_name, sqltypestr))
  File "/home/weewx/bin/weedb/sqlite.py", line 43, in guarded_fn
    raise weedb.OperationalError(e)
weedb.OperationalError: duplicate column name: appTemp
pi@raspberrypi:/home/weewx $ 

locale.setlocale(locale.LC_ALL, '')

import schemas.wview_extended
schema_extended = {'table': schemas.wview_extended.table +  [('appTemp', 'REAL'), ('windrun', 'REAL')], 'day_summaries' : schemas.wview_extended.day_summaries}

 [[wx_binding]]
        # The database must match one of the sections in [Databases].
        # This is likely to be the only option you would want to change.
        database = archive_sqlite
        # The name of the table within the database
        table_name = archive
        # The manager handles aggregation of data for historical summaries
        manager = weewx.manager.DaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
       #######schema = schemas.wview_extended.schema
       schema = user.extensions.schema_extended

Attached is the weewx.sdb   and Help
weewx.sdb

vince

unread,
Apr 7, 2020, 2:02:05 PM4/7/20
to weewx-user
You are using the extended schema for v4, which already has appTemp in it.


Part of the reason for the bigger/extended default schema in v4 is so you don't have to add frequently added things any more :-)

Phil Owers

unread,
Apr 7, 2020, 2:21:56 PM4/7/20
to weewx-user
Ooops sorry I can see that now  Didn't realize that. Thanks Vince
I was trying to upgrade a database that didn't have appTemp in it and that failed.
Will retry Garys change and see what happens

Phil Owers

unread,
Apr 8, 2020, 5:00:54 PM4/8/20
to weewx...@googlegroups.com
Hi Gary.  Couldn't add apptime on my main file using 4.0.0b18 several day errors even after using rebuild daily.  As a work round I added appTime perfectly ok on v3.9.2 waited several cycles without errors then transferred the sdb file to v4.0.018b and thats been working fine. Phil

--
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.
Reply all
Reply to author
Forward
0 new messages