'Dummies' guide for nicksengines and SteelSeries gauges - help please

2,710 views
Skip to first unread message

Devonian

unread,
Jan 29, 2014, 3:37:58 PM1/29/14
to weewx...@googlegroups.com
I like the look of these websites:
and a nice implementation of steelseries gauges

I'm more of a hardware person than a software one and would appreciate some help in getting from the 'vanilla' weewx web pages to something like the above sites.

Can anyone help with a step by step install & configuration?

Nigel.

Jeff DeWolfe

unread,
Jan 29, 2014, 11:53:18 PM1/29/14
to weewx...@googlegroups.com
Include me in this. I really like the look of the second link!

vds

unread,
Jan 30, 2014, 2:03:58 AM1/30/14
to weewx...@googlegroups.com
On Wednesday, January 29, 2014 12:37:58 PM UTC-8, Devonian wrote:
I like the look of these websites:
and a nice implementation of steelseries gauges

I'm more of a hardware person than a software one and would appreciate some help in getting from the 'vanilla' weewx web pages to something like the above sites.

I got it running in about 15 minutes.

Try looking at the 'About' link at http://www.dajda.net/about.html which has most of the info you need:
  • grab the bootstrap.tar.gz and extract it at the top of /home/weewx
  • grab the nicksengines.py and generator.py scripts and put them in /home/weewx/bin/user
  • enable the skin by adding a stanza to /home/weewx/weewx.conf, ensure the HTML_ROOT match wherever your weewx HTML_ROOT is located.
[[Bootstrap]]

skin = Bootstrap

HTML_ROOT = public_html

  • stop and start weewx
  • as always, do "tail -f /var/log/messages" to ensure it doesn't go boom for some reason.  You'll see a Bootstrap set of files created (a little slowly the first time, as it'll be generating the NOAA files"

Some notes:
  • on my Seagate Dockstar, weewx blew up the first time due to lack of some fonts.  I did 'apt-get install ttf-freefont' and the gauges worked immediately
  • their skin and configs use metric units.  I didn't see a good way to make them use US units without some pretty invasive edits
  • their content is certainly localized to their unique site, so you'll be doing a lot of editing, but it did work for me and generate a good web'o'pages that all worked




Devonian

unread,
Jan 30, 2014, 3:29:54 AM1/30/14
to weewx...@googlegroups.com
Thanks for that vds

I have done pretty much all of that, although my weewx install is in /usr/share/weewwx... and /etc/weewx/.... (I am using a command line only Debian Squeeze setup on a re-purposed thin client and not on a R-Pi). 
I also got the ttf error and installed them via apt-get
I read all the info I could find and interpreted that the best I could to my install, but didn't get it running  (it was late last night and I was tired too).
I'll try again in the next day or two.

I guess you got the 'stock' layout as per the dajda site?

Have you tried to get the gauges working as per the bogeraassen site?

I have emailed the owner of the bogeraasen site and wait for a response.  I'll post any useful info I get.


Nigel.

vds

unread,
Jan 30, 2014, 3:39:16 AM1/30/14
to weewx...@googlegroups.com
On Thursday, January 30, 2014 12:29:54 AM UTC-8, Devonian wrote:
I guess you got the 'stock' layout as per the dajda site?



My quickie version is online at  http://weather.skahan.net/weewx/Bootstrap - it was indeed pretty invasive trying to get things to US units and I even had to edit some of the python code to have the tables not convert to metric units.  Pretty ugly.  The colors are all messed up currently but the data is at least the correct values.  Interesting code example for sure, there's a lot of cool stuff in there if you look deep enough.

Regardless, just follow the instructions and get 'anything' to come out, then start hacking and slashing to de-metric-system it.  Then localize your links etc.  Really not too bad once the engine works ok.  A tree of stuff to drop into place.  A couple files into bin/user.  A handful of lines into weewx.conf and you're up.

No, I didn't do the Steel gauges yet.  They're a little slow in my opinion.

 

Ole Bredesen-Vestby

unread,
Jan 30, 2014, 4:45:16 AM1/30/14
to weewx...@googlegroups.com
As for the bogeraasen site, there are some months since I did the implementation there, so this is taken from the top of my head:
 
1) I only grabbed the bootstrap-skin from dajda.net, for the layout. This is all on the webserver, not on the Pi.
 
2) For the steelgauges: the only file I put on the Pi is the template I made (realtimegauges.txt.tmpl). Then added this to the Reports-generator block in the skins.conf file. All other files from the steelgauges-package is on the webserver. The generated realtimegauges.txt file is then ftp'ed to the webserver-root-folder.
 
3) For the Stats-pages, I've used scripts from the site of Wildwood weather as templates on the webserver, and feed them with the generated NOAA-reports from weewx. I used them on Cumulus before I switched to Weewx, and had to make some slight modifications to make them work with the weewx generated noaa-reports. In that process the templates is hardcoded into metric units, and are therefore not in the best condition to share as "public templates".
 
 
I'll see if I can do a better description tonight (or tomorrow).
 
 
. Ole

Devonian

unread,
Jan 30, 2014, 7:19:36 AM1/30/14
to weewx...@googlegroups.com
Hi Ole,

Thanks for the short overview.
I emailed you yesterday from the link on your site - you can disregard the email now.

Look forward to a fuller description if you can get some time.

@ vds,
Thanks for the additional info.

Regards,

Nigel.

Message has been deleted

Devonian

unread,
Jan 30, 2014, 5:06:09 PM1/30/14
to weewx...@googlegroups.com
OK, getting somewhere now.
Basically followed vds's guide above and had to edit the skin.conf and  weewx.conf to suit my install (directories/paths).

log looks good...

Jan 30 21:40:16 t5325 weewx[2163]: Archive: added archive record 2014-01-30 21:40:00 GMT (1391118000)
Jan 30 21:40:17 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.45 seconds
Jan 30 21:40:18 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 1.30 seconds
Jan 30 21:40:19 t5325 weewx[2163]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 1.53 seconds
Jan 30 21:40:22 t5325 weewx[2163]: genimages: Generated 12 images for StandardReport in 2.23 seconds
Jan 30 21:40:22 t5325 weewx[2163]: GaugeGenerator: Gauge WindDirection has value of type None
Jan 30 21:40:22 t5325 weewx[2163]: GaugeGenerator: Created 5 gauges in 0.30 seconds.
Jan 30 21:40:23 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByMonth' files for Bootstrap in 0.47 seconds
Jan 30 21:40:25 t5325 weewx[2163]: cheetahgenerator: generated 2 'SummaryByYear' files for Bootstrap in 2.63 seconds
Jan 30 21:40:26 t5325 weewx[2163]: cheetahgenerator: generated 8 'ToDate' files for Bootstrap in 0.48 seconds
Jan 30 21:40:27 t5325 weewx[2163]: genimages: Generated 6 images for Bootstrap in 1.38 seconds
Jan 30 21:45:16 t5325 weewx[2163]: Archive: added archive record 2014-01-30 21:45:00 GMT (1391118300)
Jan 30 21:45:17 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.59 seconds
Jan 30 21:45:19 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 2.68 seconds
Jan 30 21:45:23 t5325 weewx[2163]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 3.18 seconds
Jan 30 21:45:27 t5325 weewx[2163]: genimages: Generated 12 images for StandardReport in 4.62 seconds
Jan 30 21:45:28 t5325 weewx[2163]: GaugeGenerator: Gauge WindDirection has value of type None
Jan 30 21:45:28 t5325 weewx[2163]: GaugeGenerator: Created 5 gauges in 0.30 seconds.
Jan 30 21:45:28 t5325 weewx[2163]: cheetahgenerator: generated 1 'SummaryByMonth' files for Bootstrap in 0.47 seconds
Jan 30 21:45:32 t5325 weewx[2163]: cheetahgenerator: generated 2 'SummaryByYear' files for Bootstrap in 3.35 seconds
Jan 30 21:45:32 t5325 weewx[2163]: cheetahgenerator: generated 8 'ToDate' files for Bootstrap in 0.47 seconds
Jan 30 21:45:34 t5325 weewx[2163]: genimages: Generated 6 images for Bootstrap in 1.38 seconds


However, I don't get any graphical gauges? (should be 6).

Have a look at my server, here:
Also, when clicking on the graphs, they don't 'go large'

So, where am I going wrong?

Ignore the wind direction & speed as the VP2 is indoors for testing as it's waiting to be put up out doors!

weewx is running fine

Nigel.
 

Andrew Milner

unread,
Jan 30, 2014, 11:41:36 PM1/30/14
to weewx...@googlegroups.com
Have you by any chance put the large image stuff in the wrong skin or wrong directory?  It looks as though standard report generates twice as many images as bootstrap but moving my cursor on the two sites it is the bootstrap that seems to have a link to large images.

Just a thought

Devonian

unread,
Jan 31, 2014, 2:58:28 AM1/31/14
to weewx...@googlegroups.com
I don't think I have defined any 'Big Images' anywhere so perhaps that is why they don't appear?

I did finally get the gauges to appear after burning some midnight oil.
I had to absolutely define where to create the images in the Bootstrap skin.conf as the setting of GAUGE ROOT = public_html/ just didn't work in my case.
The only gauge that doesn't show now is the 'Wind Direction' but that may be because it hasn't moved as the VP2 is in my workshop for testing at present.

It's been a steep learning curve, but interesting none the less.

Nigel.

Andrew Milner

unread,
Feb 1, 2014, 4:34:10 AM2/1/14
to weewx...@googlegroups.com
I am having a hard job getting it to work!!  I just wanted the coloured summary pages, so have (I think) commented out everything to do with gauges and so on, and am just trying to generate the history page with the newly available table tags.  I keep getting cheetah errors though, not enough arguments.  Does it work only with sqlite db - or also with mysql database (that's what I'm using).
The last attempt gave the log attached

Anyone able to tell me where or what my error is likely to be??
weewx.log.txt

Devonian

unread,
Feb 1, 2014, 7:34:15 AM2/1/14
to weewx...@googlegroups.com
I *think* it only works with sqlite.
From your log, it seems the arguments for getting the data from MySQL are not correct (but correct for sqlite)? 

I'm way out of my depth in that area!

We'll get there...

Nigel.

Andrew Milner

unread,
Feb 1, 2014, 1:58:12 PM2/1/14
to weewx...@googlegroups.com
Still having the problem with trying to implement nick's table generator ... anyone got any ideas as to why I am getting this error - which indeed looks as though the Select statement is faulty - yet it works for other users so what have I done wrong?

Devonian

unread,
Feb 1, 2014, 2:46:17 PM2/1/14
to weewx...@googlegroups.com
I guess mine works as I'm running a 'vanilla' weewx deb install with sqlite.

Sorry I can't be much help.

Nigel.

Ole Bredesen-Vestby

unread,
Feb 2, 2014, 5:19:14 AM2/2/14
to weewx...@googlegroups.com
Here is a followup on the SteelGauges:

I have not been able to get the gauges running offline (on my pc). It seems they only run on my webserver/isp. So if you have been testing offline as well you should try running it online instead.

To get the basic to work, copy the css-folder, the scripts-folder, and the file "gauges-ss-basic.htm" to your web-root. Then copy the "realtimegauges.txt.tmpl" file to your skins-folder on the Pi, and modify the skins.conf like this:

[FileGenerator]
  [[ToDate]]
        [[[RealtimeGauges]]]
            encoding = strict_ascii
            template = realtimegauges.txt.tmpl        


Then after Weewx has generated the realtimegauges.txt file and uploaded that as well to your online-site, it should work.

Andrew Milner

unread,
Feb 2, 2014, 11:25:46 AM2/2/14
to weewx...@googlegroups.com
I may, finally, be getting close to something in my quest to find why I cannot get nick's generator to work ....

After digging and delving in /bin/weedb there appear to be differences between MySQL and sqlite when it comes to executing cursors.  Can anyone tell me if:

        sqlquery = "SELECT strftime('%Y', datetime(dateTime, 'unixepoch', 'localtime')) as Year, strftime('%m', datetime(dateTime, 'unixepoch', 'localtime')) as Month, MIN(min) FROM outTemp GROUP BY Year, Month"

is a statement that is executed using:
...........
        try:
            for row in cursor.execute(sqlQuery):
                record = (int(row[0]), int(row[1]), row[2])
                recordListRaw.append(record)
        finally:
            cursor.close()

would work with sqlite3 but not with MySQL, and if that is the case then how should the select be written to suit MySQL??  

I ask the question as I discovered in weedb/Mysql.py the following:
class Cursor(object):
    """A wrapper around the MySQLdb cursor object"""
    
    def __init__(self, connection):
        """Initialize a Cursor from a connection.
        
        connection: An instance of db.mysql.Connection"""
        
        # Get the MySQLdb cursor and store it internally:
        self.cursor = connection.connection.cursor()
    
    def execute(self, sql_string, sql_tuple=() ):
        """Execute a SQL statement on the MySQL server.
        
        sql_string: A SQL statement to be executed. It should use ? as a placeholder.
        
        sql_tuple: A tuple with the values to be used in the placeholders."""
        
        # MySQL uses '%s' as placeholders, so replace the ?'s with %s
        mysql_string = sql_string.replace('?','%s')
            
        try:
            # Convert sql_tuple to a plain old tuple, just in case it actually
            # derives from tuple, but overrides the string conversion (as is the
            # case with a TimeSpan object):
            self.cursor.execute(mysql_string, tuple(sql_tuple))
        except (_mysql_exceptions.OperationalError, _mysql_exceptions.ProgrammingError), e:
            raise weedb.OperationalError(e)
        return self

I do not understand the comment about using ? as placeholder in the sql string, and the string I am trying to have executed has got placeholders embedded in it as part of the select.

My python knowledge is zilch and my sql knowledge is not much better!!

Help sought .... please .... even though I know this probably is not a weewx issue.
A log was attached to an earlier posting

Andrew

Devonian

unread,
Feb 2, 2014, 2:26:21 PM2/2/14
to weewx...@googlegroups.com
Andrew/all

I setup Bootstrap on another Linux box reading from a WS2300 and placing data in a MySQL database.

Initially, on weewx only, everything works fine so it's not a basic configuration issue (weewx is still running fine and producing updates for it's web pages).

I then setup bootstrap and now get much the same errors as you!

Feb  2 19:12:19 ubuntu weewx[2824]: archive: added to table 'archive' of database 'weewx' a record with timestamp 2014-02-02 19:12:00 GMT (1391368320)
Feb  2 19:12:20 ubuntu weewx[2824]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.24 seconds
Feb  2 19:12:21 ubuntu weewx[2824]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 1.34 seconds
Feb  2 19:12:22 ubuntu weewx[2824]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 0.86 seconds
Feb  2 19:12:23 ubuntu weewx[2824]: genimages: Generated 12 images for StandardReport in 0.72 seconds
Feb  2 19:12:23 ubuntu weewx[2824]: GaugeGenerator: Created 6 gauges in 0.16 seconds.
Feb  2 19:12:23 ubuntu weewx[2824]: reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator
Feb  2 19:12:23 ubuntu weewx[2824]:         ****  not enough arguments for format string
Feb  2 19:12:23 ubuntu weewx[2824]:         ****  Traceback (most recent call last):
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 133, in run
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      obj.start()
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 298, in start
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      self.run()
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 129, in run
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      self.generate(time_period, self.gen_ts)
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 257, in generate
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      archivedb, statsdb)
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 294, in _getSearchList
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      + self.getToDateSearchList(archivedb, statsdb, timespan)
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/generator.py", line 117, in get_extension
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      search_list_extension[table + '_table'] = self.statsHTMLTable(table, self.table_dict[table]['sqlquery'], self.table_dict[table]['units'], statsdb)
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weewx/generator.py", line 151, in statsHTMLTable
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      for row in cursor.execute(sqlQuery):
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/share/weewx/weedb/mysql.py", line 185, in execute
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      self.cursor.execute(mysql_string, tuple(sql_tuple))
Feb  2 19:12:23 ubuntu weewx[2824]:         ****    File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 159, in execute
Feb  2 19:12:23 ubuntu weewx[2824]:         ****      query = query % db.literal(args)
Feb  2 19:12:23 ubuntu weewx[2824]:         ****  TypeError: not enough arguments for format string
Feb  2 19:12:23 ubuntu weewx[2824]:         ****  Generator terminated...
Feb  2 19:12:24 ubuntu weewx[2824]: genimages: Generated 6 images for Bootstrap in 0.56 seconds

So, it seems to be confirmed that it works fine in SQLite but not in MySQL as I have my VP2 running on weewx and Bootstrap and SQLite just fine.

When I browse to the new webserver running Bootstrap, most files are generated, but no html files are created.

Any MySQL guru out there willing to help us?

Nigel.

Andrew Milner

unread,
Feb 2, 2014, 2:40:41 PM2/2/14
to weewx...@googlegroups.com
Hi Devonian .... well that looks pretty conclusive to me - the error is identical!!  So there is an issue either with MySQL or the weewx interface to mysql or the format/structure of the select statement itself.

Hopefully Tom will be able to shed some light - fingers crossed here!

Andrew

Devonian

unread,
Feb 2, 2014, 4:43:11 PM2/2/14
to weewx...@googlegroups.com
Andrew.

Comment everything out in Bootstrap/skin.conf in the section [TableGenerator] except for the line [TableGenerator]

I now get all pages except the 'History' tab/page.

Can it be an error in the sql SELECT statement(s) in [TableGenerator] for MySQL

sqlquery = "SELECT strftime('%Y', datetime(dateTime, 'unixepoch', 'localtime')) as Year, strftime('%m', datetime(dateTime, 'unixepoch', 'localtime')) as Month, MIN(min) FROM outTemp GROUP BY Year, Month"

etc...

Log file now:

Feb  2 21:41:14 ubuntu weewx[3531]: archive: added to table 'archive' of database 'weewx' a record with timestamp 2014-02-02 21:41:00 GMT (1391377260)
Feb  2 21:41:15 ubuntu weewx[3531]: cheetahgenerator: generated 1 'SummaryByMonth' files for StandardReport in 0.23 seconds
Feb  2 21:41:16 ubuntu weewx[3531]: cheetahgenerator: generated 1 'SummaryByYear' files for StandardReport in 1.36 seconds
Feb  2 21:41:17 ubuntu weewx[3531]: cheetahgenerator: generated 12 'ToDate' files for StandardReport in 0.83 seconds
Feb  2 21:41:18 ubuntu weewx[3531]: genimages: Generated 12 images for StandardReport in 0.82 seconds
Feb  2 21:41:18 ubuntu weewx[3531]: GaugeGenerator: Created 6 gauges in 0.17 seconds.
Feb  2 21:41:18 ubuntu weewx[3531]: cheetahgenerator: generated 1 'SummaryByMonth' files for Bootstrap in 0.13 seconds
Feb  2 21:41:20 ubuntu weewx[3531]: cheetahgenerator: generated 2 'SummaryByYear' files for Bootstrap in 1.39 seconds
Feb  2 21:41:20 ubuntu weewx[3531]: cheetahgenerator: generate failed with exception '<class 'NameMapper.NotFound'>'
Feb  2 21:41:20 ubuntu weewx[3531]: cheetahgenerator: **** ignoring template /etc/weewx/skins/Bootstrap/history.html.tmpl
Feb  2 21:41:20 ubuntu weewx[3531]: cheetahgenerator: **** reason: cannot find 'min_temp_table'
Feb  2 21:41:20 ubuntu weewx[3531]: ****  Traceback (most recent call last):
Feb  2 21:41:20 ubuntu weewx[3531]: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 265, in generate
Feb  2 21:41:20 ubuntu weewx[3531]: ****      print >> _file, text
Feb  2 21:41:20 ubuntu weewx[3531]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Feb  2 21:41:20 ubuntu weewx[3531]: ****      rc = getattr(self, mainMethName)()
Feb  2 21:41:20 ubuntu weewx[3531]: ****    File "_etc_weewx_skins_Bootstrap_history_html_tmpl.py", line 258, in respond
Feb  2 21:41:20 ubuntu weewx[3531]: ****  NotFound: cannot find 'min_temp_table'
Feb  2 21:41:20 ubuntu weewx[3531]: cheetahgenerator: generated 7 'ToDate' files for Bootstrap in 0.14 seconds
Feb  2 21:41:20 ubuntu weewx[3531]: genimages: Generated 6 images for Bootstrap in 0.64 seconds

Nigel.



  

Andrew Milner

unread,
Feb 3, 2014, 1:27:04 PM2/3/14
to weewx...@googlegroups.com
Devonian, and any others ...

SOLVED - finally ......

Yes, it was indeed the SQL statements when using a MySQL database

If using nick's generator.py with a mySQL database, change the entries in the appropriate skin to these:

# Settings for Nick's HTML month/year summary table summary generator
#
[TableGenerator]

    [[min_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MIN(min) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[max_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MAX(max) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[avg_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(max) / COUNT(max) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[rain]]
        minvalues = 0, 5, 25, 50, 75, 100, 150
        maxvalues = 4, 24, 49, 74, 99, 149, 1000
        colours =   "#FFFFFF", "#E0F8E0", "#A9F5A9", "#58FA58", "#2EFE2E", "#01DF01", "#01DF01"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(sum) FROM rain GROUP BY Year, Month"
        units = rain

################################################################

I also slightly modified the colour ranges for the cells to be more suitable for my higher range of temps here in the Mediterranean

Thanks for keeping me going Devonian ... and at least I finally cracked it....

Nigel Head

unread,
Feb 3, 2014, 2:36:02 PM2/3/14
to weewx...@googlegroups.com
Well done Andrew.
Copied/pasted your sql select... and it works fine on my MySQL setup.
I'm also testing it with weewx 2.6 alpha and everything seems OK.

So, next step for me is to get Ole's SteelSeries gauges working...(linked above).

Nigel.


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/Om7ruJwGhYw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andrew Milner

unread,
Feb 3, 2014, 5:02:09 PM2/3/14
to weewx...@googlegroups.com
Glad it worked.  Check that all your colours in all the tables have got quotes around them.  I spent a good half of today chasing why my colours were not working, forcing integers in the code, changing range values and so on before discovering there were missing quotes in I think 3 of the 4 tables!!!!  I'm almost certain I had not deleted them - but I may have done.  Just check anyway!!!  That's one reason why all my ranges are different from the original as supplied ....

MAYBE I will get to trying the gauges, but for the moment I am just massaging all the pages to make them fit in with what I want before I introduce the gauges - so they are all commented out for now, and am not calling the gauge generator either just yet.

Andrew

Devonian

unread,
Feb 3, 2014, 6:24:27 PM2/3/14
to weewx...@googlegroups.com
Hi Ole,

I tried as you suggested, but get an error...

Feb  3 23:18:20 ubuntu weewx[3531]: reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator
Feb  3 23:18:20 ubuntu weewx[3531]:         ****  'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****  Traceback (most recent call last):
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 133, in run
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      obj.start()
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 298, in start
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      self.run()
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 129, in run
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      self.generate(time_period, self.gen_ts)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 261, in generate
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      filtersLib=weewx.cheetahgenerator)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1259, in __init__
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      self._compile(source, file, compilerSettings=compilerSettings)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1553, in _compile
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      keepRefToGeneratedCode=True)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 740, in compile
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      settings=(compilerSettings or {}))
Feb  3 23:18:20 ubuntu weewx[3531]:         ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Compiler.py", line 1579, in __init__
Feb  3 23:18:20 ubuntu weewx[3531]:         ****      source = unicode(source)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
Feb  3 23:18:20 ubuntu weewx[3531]:         ****  Generator terminated...

Any ideas?

I also tried encoding = utf8 but same error (my python is 2.7 and UTF8)

Nigel.

Andrew Milner

unread,
Feb 5, 2014, 1:47:00 PM2/5/14
to weewx...@googlegroups.com
Finally ... got gauges and bootstrap working with mysql database, in metric with knots for wind.

Well - this is enough for today anyway ....  just wish I understood Python more as it seems so complex to my poor brain!!  

http://asrm.dyndns-pics.com/weewxweather/bootstrap    I just love the colour coded history page that makes it so much easier to see trends and history.

Now to try and integrate these 'new' pages into my old site ....

Nick Dajda

unread,
Feb 5, 2014, 3:33:41 PM2/5/14
to weewx...@googlegroups.com
Hi Nigel, 

Cheetahgenerator can throw this error when it's been asked to open a generator file that isn't there. e.g. if the generator.py file used to create the colourful monthly history table is not in the weewx/bin/user directory.

I've started drafting  some much overdue installation notes which may be helpful:

Nick

Devonian

unread,
Feb 5, 2014, 5:36:56 PM2/5/14
to weewx...@googlegroups.com
Hi Nick, Andrew.

Thanks for the info. 

I've made some progress to and managed to get the SteelGauges working (after a fashion)

I now need to get them formatted into a Bootstrap page, Iade a start. but can't get them to line up (span setting I think).
Like I said, I'm more of a hardware person than a software one and find this quite challenging!

The Cheetahgenerator error was being thrown by the first (and last) character in the realtimegauges.txt.tmpl file I got from Ole's download.
I deleted it and added it back??!! It was the braces symbol at the beginning and end of the file ( { and } ) - don't ask me, it just worked after I deleted them and added them back!

I'll try to update things once I get it properly formalised as it's been very much chop and change and observer the result(s)!!

Nigel.


gonk smith

unread,
Feb 7, 2014, 4:48:12 AM2/7/14
to weewx...@googlegroups.com
Thanks for the info... I have got my private page working using the http://www.dajda.net/index.html style.  Just need to work out how to add the rain gauge to it rather than the graphs.
Message has been deleted

gonk smith

unread,
Feb 8, 2014, 3:47:22 AM2/8/14
to weewx...@googlegroups.com

Does anyone know where I should start looking to find this error ?           The temperature is correct, it just adds that "A" in there some how.

Nick Dajda

unread,
Feb 8, 2014, 9:28:52 AM2/8/14
to weewx...@googlegroups.com
Hi there,

The latest version fixes this and includes a couple more improvements:
   - It finally deals with metric and imperial units... whatever you specify in skin.conf
   - It is no longer limited to a handful of fields... you can now specify any field in your shema.

Latest generator file can be found here: https://github.com/brewster76/fuzzy-archer/tree/master/bin/user 

(now renamed to gaugeengine.py, not nicksengine.py)

Nick

Mike Revitt

unread,
Feb 8, 2014, 3:16:20 PM2/8/14
to weewx...@googlegroups.com
Slightly off topic, but I have been playing with some gauges for my own web site and steel gauges was something I was looking at, and I have now got some gauges on my home page that I am quite happy with, see here . I also accidentally discovered that you can show max and min on the gauges so I may play with that later.

All I need now is a decent compass if anyone knows where I can find one.

This is written in Java Script with a few changes to index.html.tmpl, weewx.css and skin.conf.

If anyone wants the code just let me know, I will write it up when I get some more time.

I got inspiration from here and the code from here.

Steve

unread,
Feb 9, 2014, 9:23:49 AM2/9/14
to weewx...@googlegroups.com
Looks good, there was a full stop . at the end of the link that stopped it from showing though ;)

Message has been deleted

gonk smith

unread,
Feb 10, 2014, 4:03:58 PM2/10/14
to weewx...@googlegroups.com
Thanks Nick

Only problem is I had to rename the gauge labels in the copy of bootstrap/skin.conf from the git site

eg. [[Temperature]] had to be changed to [[outTemp]]
[[Pressure]] had to be changed to [[barometer]]

and so forth.

windDir has a problem somewhere as the Web page lists it as WindDirgauge.png and the py file looks for a windDir, so not gauge for that one... late at night...so I will look later...

Message has been deleted

gonk smith

unread,
Feb 11, 2014, 7:23:57 AM2/11/14
to weewx...@googlegroups.com
found the typo in the in the *.*tmpl files in the  Bootstrap folder, eg index.html.tmpl   I had to change WindDirGauge.png to windDirGauge.png

Pete Geenhuizen

unread,
Feb 11, 2014, 8:41:05 AM2/11/14
to weewx...@googlegroups.com

On 02/11/2014 07:23 AM, gonk smith wrote:
found the typo in the in the *.*tmpl files in the  Bootstrap folder, eg index.html.tmpl   I had to change WindDirGauge.png to windDirGauge.png

On Tuesday, 11 February 2014 07:03:58 UTC+10, gonk smith wrote:
--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Thanks for posting your fixes, they all worked for me as well.

Pete
-- 
Unencumbered by the thought process.  
 -- Click and Clack the Tappet brothers 

Joachim Rummler

unread,
Feb 11, 2014, 12:30:09 PM2/11/14
to weewx...@googlegroups.com
Hi Mike,

great work! Congratulations. Can you sent the code per PM or publish it here?

Thanks

Joachim

gonk smith

unread,
Feb 11, 2014, 5:57:06 PM2/11/14
to weewx...@googlegroups.com, pe...@geenhuizen.net
one more....

The graphics for the graphs when they pop out did not work.  eg the loading.gif and close.png.   In the file in Bootstrap/assets/js/lightbox.js, I had to      
 this.fileLoadingImage = '../assets/img/loading.gif';
 this.fileCloseImage = '../assets/img/close.png'; 
to   
 this.fileLoadingImage = './assets/img/loading.gif';
 this.fileCloseImage = './assets/img/close.png';   

only one full stop preceding the address.

Andrew Milner

unread,
Feb 11, 2014, 10:13:49 PM2/11/14
to weewx...@googlegroups.com
Worked fine for me without any such edit - I guess it really depends on exactly how you have installed bootstrap though!!



--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/Om7ruJwGhYw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Nick Dajda

unread,
Feb 13, 2014, 3:52:10 PM2/13/14
to weewx...@googlegroups.com
Sorry - I missed these.

I've updated the skin.conf and the .tmpl files on git.

Thanks for flagging these,
Nick

Mike Revitt

unread,
Feb 15, 2014, 6:45:39 AM2/15/14
to weewx...@googlegroups.com
The code is relatively straight forward,

In index.html.tmpl I added 

      <div id="content">

        <div id="about">

          <div class="header">

            Current Weather:

          </div>

          <div id="plots">

              <canvas id="CurrTemp"></canvas>

              <canvas id="WindChill"></canvas>

              <canvas id="Humidity"></canvas>

              <canvas id="Barometer"></canvas>

              <canvas id="WindGusts"></canvas>

          </div> <!-- End id "plots" -->

          <script type="text/javascript">

            var CurrTemp = new Gauge

            ({

             renderTo   : 'CurrTemp',

             width      : 200,

             height     : 200,

             minValue   : -10,

             maxValue   :  40,

             majorTicks : ['-10','0','10','20','30','40'],

             glow       : true,

             units      : '°C',

             valueFormat : { int : 2, dec : 1 },

             title      : 'Current Temperature',

             highlights :

             [

              {from  : -10,

              to    :  10,

              color : 'LightBlue'},

              {from  :  10,

              to    :  30,

              color : 'PaleGreen'},

              {from  :  30,

              to    :  40,

              color : 'LightSalmon'}

              ],

             glow       : true

             });

             

             CurrTemp.onready = function()

             {

                 CurrTemp.setValue( $current.outTemp.formatted );

             };

        CurrTemp.draw();


        </script>


        </div> <!-- End id "about" -->

        

In the main body, with a configuration with the script for each gauge.

In weewx.css I messed around with the formatting to create the shadows

#plots {
    width: 90%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
    
#plots img {
    box-shadow: 0px 0px 15px 5px rgba(119, 119, 119, 0.8);
    border-style:ridge;
    margin: 3%;
    padding: 3px;
}

And in skin.conf I just added gauge.js to the [CopyGenerator] section

The other change I have recently made is for the picture of the moon to change with the phases, the code for that is in index.html.tmpl and shown below

           #if $almanac.hasExtras

            ## Extended almanac information is available. Do the full set of tables.

              <table>

                <tr>

                  <th colspan="2">Sun</th>

                  <th colspan="2">Moon</th>

                </tr>

                <tr>

                  <th colspan="2"><img src="backgrounds/Sun.jpg" alt="Sun" width="112" height="110"></th>

                  <script>

                      document.write('<th colspan="2"><img src="backgrounds/' + '$almanac.moon_phase' + '.jpg" alt="Moon" width="110" height="110"></th>');

                  </script>

                <tr>

Erwin Fiten

unread,
Feb 22, 2014, 4:47:20 PM2/22/14
to weewx...@googlegroups.com
I have a problem setting up the system on a Raspberry Pi (I don't know if this is relevant)
I installed everything using Nicks manual, and it starts up, but fails to generate the gauges : 

Caught unrecoverable exception in generator user.gaugeengine.GaugeGenerator
float() argument must be a string or a number

This is fhe full log : 

Feb 22 22:45:01 raspberrypi weewx[7143]: genimages: Generated 6 images for SmallImages in 4.09 seconds
Feb 22 22:45:07 raspberrypi weewx[7143]: genimages: Generated 6 images for BigImages in 6.36 seconds
Feb 22 22:45:08 raspberrypi weewx[7143]: reportengine: Caught unrecoverable exception in generator user.gaugeengine.GaugeGenerator
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****  float() argument must be a string or a number
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****  Traceback (most recent call last):
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 133, in run
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****      obj.start()
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 298, in start
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****      self.run()
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****    File "/home/weewx/bin/user/gaugeengine.py", line 191, in run
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****      self.drawGauge(gauge, valueTuple, unitType)
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****    File "/home/weewx/bin/user/gaugeengine.py", line 493, in drawGauge
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****      buckets = self.histogram(gaugeName, gaugeName, unitType, numBins)
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****    File "/home/weewx/bin/user/gaugeengine.py", line 424, in histogram
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****      histValue = float(valueTuple[0])
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****  TypeError: float() argument must be a string or a number
Feb 22 22:45:08 raspberrypi weewx[7143]:         ****  Generator terminated...
Feb 22 22:45:09 raspberrypi weewx[7143]: cheetahgenerator: generated 1 'SummaryByMonth' files for HTMLPages in 0.78 seconds
Feb 22 22:45:15 raspberrypi weewx[7143]: cheetahgenerator: generated 2 'SummaryByYear' files for HTMLPages in 6.34 seconds
Feb 22 22:45:16 raspberrypi weewx[7143]: cheetahgenerator: generated 8 'ToDate' files for HTMLPages in 0.99 seconds


I can't figure out what 's going wrong.

Greetings
Erwin



Andrew Milner

unread,
Feb 22, 2014, 7:07:41 PM2/22/14
to weewx...@googlegroups.com

If you specify a history period for a gauge you also need to give a number of buckets to collect the history data into for the shading.

Erwin Fiten

unread,
Feb 22, 2014, 7:11:26 PM2/22/14
to weewx...@googlegroups.com
OK, 

Already thanks for the effort.

Havent't found that in any manual, wher do I need to fill in this history period? 

Erwin

Andrew Milner

unread,
Feb 22, 2014, 10:44:52 PM2/22/14
to weewx...@googlegroups.com
Can you post a copy of the gaugegenerator section of the skin you are using and I will see if I can help further.

Erwin Fiten

unread,
Feb 23, 2014, 5:00:51 AM2/23/14
to weewx...@googlegroups.com
Sure, but I didn't cahnge anything to that.
If there is another skin with those steel gauges, it's also good for me.

The gaugegenerator section : 
[GaugeGenerator]
    image_width = 180
    image_height = 180
    GAUGE_ROOT = public_html/

    # Colors...
    #
    # Format is 0xBBGGRR, so a pinky-purple color (r=FF, g=00, B=99) which would have
    # an HTML tag of #FF0099 is expressed as 0x9900FF
    fill_color = 0x4242b4
    background_color = 0xffffff
    label_color = 0x000000
    dial_color = 0x707070
    needle_color = 0xb48242
    text_color = 0xb48242

    [[outTemp]]
    minvalue = -20
    maxvalue = 40
    majorstep = 10
    minorstep = 1
    labelfontsize = 15        
    history = 24
    bins = 120

    [[barometer]]
    minvalue = 970
    maxvalue = 1050
    majorstep = 20
    minorstep = 10
    labelfontsize = 12      

    [[outHumidity]]
    minvalue = 0
    maxvalue = 100
    majorstep = 20
    minorstep = 10
    labelfontsize = 13

    [[windSpeed]]
    minvalue = 0
    maxvalue = 40
    majorstep = 10
    minorstep = 2
    labelfontsize = 15
    [[windGust]]
    minvalue = 0
    maxvalue = 40
    majorstep = 10
    minorstep = 2
    labelfontsize = 15

    [[windDir]]
    labelfontsize = 12

    # By default, needle points towards direction of wind source. Use invert to
    # point towards wind destination. Can be True or False.
    invert = False

    # Number of groups that wind direction history is split into.
    bins = 32

    # hours of data to use for windgauge background shading.
    history = 12




Op zondag 23 februari 2014 04:44:52 UTC+1 schreef Andrew Milner:

Devonian

unread,
Feb 23, 2014, 5:58:56 AM2/23/14
to weewx...@googlegroups.com
@ Erwin,

Are you using a 'live' weather station (recording actual data) ?
I had similar errors when I was testing my station indoors (before mounting outside) and found that values of zero (no recorded value) will throw these kind of errors.
By manually making all of the sensors record some data, the error would go away (blow on the wind cups, rock the rain collector etc).

The 'steel gauges' are not a part of Nick's standard skin and need to be added separately.

Mine is working here...

As a matter of interest, what weather station are you using?

Nigel.
 

Andrew Milner

unread,
Feb 23, 2014, 7:01:56 AM2/23/14
to weewx...@googlegroups.com
Sorry Erwin, I was off on the wrong track because I had already seen, and fixed, this problem caused by None readings and then gone off to make further enhancements and thought you had been caught by a bug I had not fixed for Nick!!.  See this thread and a copy of the generator that copes with missing readings much better (unless Nick has updated his release to incorporate the changes already):


Read the whole thread as there is more than one version embedded in there!!

Erwin Fiten

unread,
Feb 23, 2014, 8:00:43 AM2/23/14
to weewx...@googlegroups.com
Hi Nigel,

Your layout is exactly what I'm trying to achieve, but i'm only into WeeWX for a few days, so I realy need to find out how the generation of those pages works.
I'm using a live weather station, with some sensors failing at some times, that's correct. Ans sometimes the values are zero, especially on the rainfall.

I use a WMR200 with WeeWX 2.6 on a Raspberry Pi.

Until now i wasn't been able to generate a single gauge, so that's the first thing I have to figure out.


Erwin



Op zondag 23 februari 2014 11:58:56 UTC+1 schreef Devonian:

Andrew Milner

unread,
Feb 23, 2014, 9:04:37 AM2/23/14
to weewx...@googlegroups.com
I would suggest getting nicks generator and gauges (as shown on Nigel's statistics and history pages) working first - then work on changing nicks stuff to add the steel gauges which are completely separate entities.  If you have failing sensors etc then you definitely will need nick's latest (or my version from the thread I gave you the link to) of gaugeengine.py as previous version(s) did throw errors (as you found out) when sensor values are missing.

Andrew

Erwin Fiten

unread,
Feb 23, 2014, 4:03:33 PM2/23/14
to weewx...@googlegroups.com
Hi Nigel,

Can you provide me with some info about the info of the steel gauges you use? and the layout?
Meanwhile I managed to get the 'default' gauges working, so now i just have to get the steel gauges to work.
You can check my test setup (direct from the Raspberry Pi) here : http://84.194.25.52:8080/
So I really would be great to have a layout like yours.

Erwin



Op zondag 23 februari 2014 11:58:56 UTC+1 schreef Devonian:
@ Erwin,

Devonian

unread,
Feb 24, 2014, 2:46:28 PM2/24/14
to weewx...@googlegroups.com
I don't think there is a 'default' way to add steel gauges in weewx, partly because things have changed since I made my install (generators have name changes etc).
It does depend on how you installed weewx - by deb or tar - because the files end up in different places.

In my Bootstrap skin directory, I have made gauges.html.tmpl and realtimegauges.txt.tmpl files (attached for download in this message) which create the files in the web folder (where your bootstrap files are).
You will have to watch out for the engine name changes as mine are nicksengine.py and now it is gaugegenerator.py and the differences in file/directories between my install and yours.

Also, in your web folder, you will need some files from the steel gauges install (I copied them by hand).
They include the css and script folders.
Get them from here (and read all the info ;-) )

 You should be able to figure most of it out from some of the previous posts in this thread as I don't actually remember 'exactly' what I did to make them work !!

You will learn the most by trying/observing/trying/observing.... for yourself.

If you get stuck on something, post on here and we will see if we can help you out.

Nigel.
gauges.html.tmpl
realtimegauges.txt.tmpl

Erwin Fiten

unread,
Feb 26, 2014, 2:52:53 PM2/26/14
to weewx...@googlegroups.com
Meanwhile, I got the system up and running.
Tnx Nigel for your help.

this is it at the moment : http://84.194.25.52:8080/gauges.html

The gauges seem to act strange.
The first time I open them, the of the temperature is correct, only the scaling is from 0-100
When i swithc to °F and back to °C the scaling is OK, and the values also.
the next refresh the scaling stays OK, but the degrees are given in °F  (it still needs to give me °C according to the buttons below)

Also the scaling of the pressure gauge doesn't seem to alter, and auto scaling isn't working.

Maybe one of you have an Idea? I guess if you guys access the page, you will see the same problem.

Erwin


Op maandag 24 februari 2014 20:46:28 UTC+1 schreef Devonian:

Devonian

unread,
Feb 26, 2014, 3:39:51 PM2/26/14
to weewx...@googlegroups.com
 Hi Erwin,

Good work and you are learning all the time (the same as me).
I get the first page load on you site, but then it indicates 'Downloading' after 60 seconds and it stops right there.
I don't know why it is doing this but it seems as if it is waiting for the next update in the realtimegauges.txt file in your web folder? - can anyone else help out here?

I don't know the WMR200, but on my WS2300, I get updates every 8 seconds from the console.
I set this to match in my weewx.conf, in the section for my WS2300
polling_interval = 8
Maybe you can set something similar in the section for your WMR200?
http://www.weewx.com/docs/usersguide.htm
I also had to set the console by using the command
wee_config_ws23xx --set-interval=1
I also had to match this in weewx.conf under section [StdArchive]
archive_interval = 60
I actually want to set it to 8 (seconds) but it doesn't seem the driver supports that at the moment??

Anyway, with these setting, I now get updates every 60 seconds.

You will have to adjust settings for your own station.
You may also set the default unit(s) in realtimegauges.txt.tmpl to suit yourself.
As with all things, make a backup of files before you start changing things, so if (when!) it goes wrong, you can copy things back.

Hope this helps a little.

Nigel.

John Harvey

unread,
Feb 26, 2014, 4:19:37 PM2/26/14
to weewx...@googlegroups.com

I’m not convinced its related to the scaling problem but there are some errors in the html code if you turn on the console.

It’s complaining about the lines

<input id="rad_temp1" type="radio" name="rad_temp" value="out" checked onclick="gauges.doTemp(this);">Outside</label>

 

Not having a valid end tag. The </label> should be </input>

Generally getting rid of any warnings in the javascript console seems to help things but I cant see any there that would stop the autoscaling.

So I suspect that this is some sort of problem with the events into the steelseries javascript since it isn’t doing its initialization properly.

 

I wonder if this is some interaction with bootstrap since IE also complains

 

HTML1514: Extra "<body>" tag found. Only one "<body>" tag should exist per document.

File: gauges.html, Line: 74, Column: 1

 

So I wonder if an ondraw event or something similar isn’t happening.

It’s a while since I went through that sort of grief with my webpages and the gauges but if you need it I am now reasonably familiar with the steelseries code so could probably look into where to add some debugging.

 

One day when I finish my site I should write up what I did as well.

The latest versions I have are

http://jpharvey1.no-ip.biz/tsctest/

 

which is intended for use in our sailing clubhouse so the wind information updates every 2 seconds (designed to fit on a wide screen so the pages just fit with no scrolling)

 

and

 

http://jpharvey1.no-ip.biz/tscweb/index.html

 

which is designed to fit on the club website so updates slower (and is running off a different weather station which has a broken wind sensor at the moment).

I’ve also tried to reduce the size of the uploaded data for this system so lots of the pages are fixed and the graphs & data are pulled into a template to keep the bandwidth down since we will be using a 3g dongle for internet connection.

 

John

--

You received this message because you are subscribed to the Google Groups "Weewx user's group" group.

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

Shaggy

unread,
Mar 1, 2014, 3:23:09 AM3/1/14
to weewx...@googlegroups.com
Hello,

I've been experimenting with the using different skins in Weewx on my Rpi (using OS WMR88 weatherstation) and have not yet succeeded in getting the Bootstrap skin to work, despite lots of helpful posts in this forum.

I am using Weewx 2.6.1 with a MySql database, which happens to be running on my NAS (having made the above changes to the SQL statements).  At the moment I am trying to replicate the dials from dadja.net.  However, I get the following error and do not understand how to interpret it:


Mar  1 08:00:28 raspberrypi weewx[9955]:         ****  Traceback (most recent call last):

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 133, in run

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      obj.start()

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 298, in start

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      self.run()

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 129, in run

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      self.generate(time_period, self.gen_ts)

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 266, in generate

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      archivedb, statsdb)

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 303, in _getSearchList

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      + self.getToDateSearchList(archivedb, statsdb, timespan)

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/user/historygenerator.py", line 117, in get_extension

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      search_list_extension[table + '_table'] = self.statsHTMLTable(table, self.table_dict[table]['sqlquery'], self.table_dict[table]['units'], statsdb)

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/user/historygenerator.py", line 151, in statsHTMLTable

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      for row in cursor.execute(sqlQuery):

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****    File "/home/weewx/bin/weedb/mysql.py", line 181, in execute

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****      mysql_string = sql_string.replace('?','%s')

Mar  1 08:00:28 raspberrypi weewx[9955]:         ****  AttributeError: 'list' object has no attribute 'replace'

I have commented out the [[SmallImages]] and [[BigImages]] sections from weewx.conf, this error only occurs when I call [[Bootstrap]].  I have commented out almost all of the content of the Bootstrap skin.conf file, leaving only the definitions of units, labels etc. at the start, the [CopyGenerator] and the [Generators] sections in the main body, and still the error shows.  I've looked in all the file locations listed, but can't see an obvious (to my inexperienced eye) cause for this error.  Can anyone help please?

Andrew Milner

unread,
Mar 1, 2014, 5:21:44 AM3/1/14
to weewx...@googlegroups.com
If you are running with MySQL instead of sqlite you need to change the select statement in the history part of the skin

See earlier in this thread .....
Devonian, and any others ...

SOLVED - finally ......

Yes, it was indeed the SQL statements when using a MySQL database

If using nick's generator.py with a mySQL database, change the entries in the appropriate skin to these:

# Settings for Nick's HTML month/year summary table summary generator
#
[TableGenerator]

    [[min_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MIN(min) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[max_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MAX(max) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[avg_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(max) / COUNT(max) FROM outTemp GROUP BY Year, Month"
        units = temperature

    [[rain]]
        minvalues = 0, 5, 25, 50, 75, 100, 150
        maxvalues = 4, 24, 49, 74, 99, 149, 1000
        colours =   "#FFFFFF", "#E0F8E0", "#A9F5A9", "#58FA58", "#2EFE2E", "#01DF01", "#01DF01"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(sum) FROM rain GROUP BY Year, Month"
        units = rain

################################################################

I also slightly modified the colour ranges for the cells to be more suitable for my higher range of temps here in the Mediterranean

Thanks for keeping me going Devonian ... and at least I finally cracked it....



--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/Om7ruJwGhYw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Shaggy

unread,
Mar 1, 2014, 3:21:38 PM3/1/14
to weewx...@googlegroups.com
Hi Andrew,

I have made those changes to the SQL (hence the comment in my previous post), however at the moment, that part of skin.conf is commented out - indeed, most of skin.conf is commented out.  Therefore I assume that those SELECT statements can't be the cause of this error, but I'm guessing it's something else database related.  As this is my first Rpi project (and indeed first Linux experience), apart from having looked in the locations listed in /var/log/messages (where I can't see an obvious cause of the problem), I don't know how to interpret the debug messages.

The part I don't get is what else is called by the Bootstrap skin.conf file, when all the main sections (cheetahgenerator, gaugegenerator, all the html sections etc.) are all commented out?  The error doesn't happen if I don't reference the Bootstrap skin.conf from weewx.conf, but does even if I reference the attached heavily commented out version (in which you can also see the SQL changes made for MySql).

Thanks in advance for any advice.
skin.conf

Andrew Milner

unread,
Mar 1, 2014, 4:24:00 PM3/1/14
to weewx...@googlegroups.com
The engines, including the gauge engine are still being called as they are not commented out from the end of your skin - so they will still try and run.  Part of their running is to search the skin for the information they need in order to be able to execute correctly.  With so much commented out they will not find even the basic information they need - so will throw all sorts of obscure errors I would expect.  Your original error came from historygenerator - which I know has a problem his original select query and the way that weewx processes the query before passing it off to mysql.  In fact nick's code for gauges does work ok as far as i know with mysql - but the history generator most certainly does not work - for the reasons I gave.
To be hionest I have never tried to run weewx with most of it disabled - so I don't have a clue as to what to expect.  I always run and test by restarting weewx most of the time and waiting for next archive interval (because I forget how to run things manually!!)



--

Shaggy

unread,
Mar 2, 2014, 3:25:33 AM3/2/14
to weewx...@googlegroups.com
Thanks for your advice.  My commenting out almost everything was an attempt to isolate the source of the error, but tbh none of the comments made any difference to the outcome.  Not really sure how to proceed with this one, so I might have to leave it for now and come back to for a fresh attempt when I have a few more weeks' experience!

Andrew Milner

unread,
Mar 2, 2014, 3:29:57 AM3/2/14
to weewx...@googlegroups.com
can you attach a copy of the current log and the skin you are using that creates the error message you are using please ... as I suspect you may have changed the skin after posting the original log.

Devonian

unread,
Mar 2, 2014, 4:26:57 AM3/2/14
to weewx...@googlegroups.com
@ shaggy

Have you had the basic weewx install up and running OK before you added/modified for Bootstrap?

I would make sure the basic weewx is running OK and then add/modify that (using SQLite to start with on the R-Pi).

Once you are sure the basics are running, it's easier to add something and observe the changes.

My setup uses the SQL database locally (not remotely on a NAS box).
I think you will have to include any credentials in the SELECT statements to allow for remote access to the NAS db?

Nigel.

Shaggy

unread,
Mar 3, 2014, 4:23:50 AM3/3/14
to weewx...@googlegroups.com
Hi,

I'll post the current log and skins when I'm back this evening (no remote access from work).  The system normally runs with the Standard skin (as it is now) with no problem at all, using the same remote MySql database, and has been for the last month.  I'm reluctant to change databases, because I've migrated a year's worth of data from Wfrog, which Weewx now shows correctly as historical data.

In the first week or so of using Weewx and the Rpi, I'm pretty sure I had Bootstrap working for a short while (because I have some of the gauges it generated using nicksengine.py, but that was with version 2.5.0).  However I did a fresh install with 2.6.1 when it was released, and this is the version I've not been able to get Bootstrap working with.  My guess is it's related to the fact that I'm using a MySql database, and quite possibly down to something stupid I've done, but I'll check everything again this evening and post the latest logs and skin file.

Andrew Milner

unread,
Mar 3, 2014, 8:26:19 AM3/3/14
to weewx...@googlegroups.com
Well I have got 2.6.2 running fine with nick's gauges, bootstrap css, mesowx and mysql - all hosted on my Rpi, with the only definite change needed being the sql select statement in the skin for use by nick's history tables - although I will confess to having modified mesowx, nick's gauge generator and the bootstrap css to make them all more suitable for my site ... weather.andrewmilner.co.uk 



--

Shaggy

unread,
Mar 3, 2014, 4:29:58 PM3/3/14
to weewx...@googlegroups.com
Gents, thanks for your suggestions.  Attached is the current skin.conf I am using.  Before uncommenting everything, I commented out the generators one at a time and restarted Weewx, but was still getting exactly the same error message.

Below is the output from /var/log/messages, created using the attached skin.conf file:

Mar  3 20:54:16 raspberrypi weewx[17815]: wxengine: Using stats database: stats_mysql

Mar  3 20:54:16 raspberrypi weewx[17815]: wxengine: Starting up weewx version 2.6.1

Mar  3 20:54:16 raspberrypi weewx[17815]: wxengine: Starting main packet loop.

Mar  3 20:55:30 raspberrypi weewx[17815]: archive: added record 2014-03-03 20:55:00 UTC (1393880100) to database 'weewx'; table 'archive'

Mar  3 20:55:31 raspberrypi weewx[17815]: restx: Wunderground-PWS: Published record 2014-03-03 20:55:00 UTC (1393880100)

Mar  3 20:55:49 raspberrypi weewx[17815]: genimages: Generated 9 images for SmallImages in 18.29 seconds

Mar  3 20:58:34 raspberrypi weewx[17815]: genimages: Generated 24 images for BigImages in 165.20 seconds

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****  Traceback (most recent call last):

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 133, in run

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      obj.start()

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 298, in start

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      self.run()

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 129, in run

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      self.generate(time_period, self.gen_ts)

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 266, in generate

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      archivedb, statsdb)

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 303, in _getSearchList

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      + self.getToDateSearchList(archivedb, statsdb, timespan)

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/user/historygenerator.py", line 117, in get_extension

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      search_list_extension[table + '_table'] = self.statsHTMLTable(table, self.table_dict[table]['sqlquery'], self.table_dict[table]['units'], statsdb)

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/user/historygenerator.py", line 151, in statsHTMLTable

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      for row in cursor.execute(sqlQuery):

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****    File "/home/weewx/bin/weedb/mysql.py", line 181, in execute

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****      mysql_string = sql_string.replace('?','%s')

Mar  3 20:58:36 raspberrypi weewx[17815]:         ****  AttributeError: 'list' object has no attribute 'replace'

Mar  3 20:58:54 raspberrypi weewx[17815]: reportengine: ftp'd 33 files in 18.50 seconds


If I need to add credentials to the select statements for the MySql database, what would the syntax be, and where would I need to add it?  I've confirmed that everything seems to be running OK with the Standard skin, it only occurs when I use the Bootstrap skin.

skin.conf

Andrew Milner

unread,
Mar 3, 2014, 8:29:41 PM3/3/14
to weewx...@googlegroups.com

Try and add the missing trailing quote on the fifth colour in the three temperature history tables section. See if this makes any difference. Also try and remove the. Search extension and/or remove the history part of the gauge definitions to try and help isolate the problem if needed. I assume weewx.conf provides the MySQL database credentials. The issue from the log is something to do with history though.

--

Shaggy

unread,
Mar 6, 2014, 3:29:36 AM3/6/14
to weewx...@googlegroups.com
Quick update: after spending quite some time testing over the last couple of days, I found that this error occurred even if I completely emptied the contents of the Bootstrap directory!  So I reverted to the installation version of weewx.conf and built it up from there using the same skin.conf file, and got almost everything working.  The only parts of Bootstrap I couldn't get to work were showing the history of the temperature gauge, and one of the wind gauges throws an error.  My brain hurts now, so I'll come back to it in a few days when I have some more time, and will then move on to the next challenge on this learning curve.

Thanks for all your help so far.

Andrew Milner

unread,
Mar 6, 2014, 4:19:43 AM3/6/14
to weewx...@googlegroups.com
You can put the history onto any of the gauges - not just temperature and wind - add history period and number of bins.  Depends which version of gaugeengine you are using though!!  Which wind gauge throws an error, and what error - both wind speed and gust speed are handled the same way.  Have you corrected the colours for the history statistics page - Nick had an error in the example (a missing quotes symbol).

Marco Bakker

unread,
Dec 30, 2014, 1:09:39 PM12/30/14
to weewx...@googlegroups.com
For Weewx 3.01 + MySQL : table outTemp changed in archive_day_outTemp, and so on:
skin.conf has to be changed to : 

###########################################################################################
#
# Settings for Nick's HTML month/year summary table summary generator
#
[TableGenerator]

    # minvalues, maxvalues and colours should contain the same number of elements.
    # e.g. in the [min_temp] example below, if the minimum temperature measured in
    #      a month is between -50 and -10 (degC) then the cell will be shaded
    #      in html colour code #0029E5.
    #
    # sqlquery text below works for sqlite but may not work for other databases.

    # Default is temperature scale
    minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35
    maxvalues =  -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 60
    colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2, "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"

    # The Raspberry Pi typically takes 15+ seconds to calculate all the summaries with a few years of weather date.
    # refresh_interval is how often in minutes the tables are calculated.
    refresh_interval = 60

    [[min_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MIN(min) FROM archive_day_outTemp GROUP BY Year, Month"
        units = temperature

    [[max_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, MAX(max) FROM archive_day_outTemp GROUP BY Year, Month"
        units = temperature

    [[avg_temp]]
        minvalues = -50, -10, -5, 0, 5, 10, 15, 20, 25, 34, 40
        maxvalues = -11, -6, -1, 4, 9, 14, 19, 24, 33, 39, 60
        colours =   "#0029E5", "#0186E7", "#02E3EA", "#04EC97", "#05EF3D2", "#2BF207", "#8AF408", "#E9F70A", "#F9A90B", "#FC4D0D", "#FF0F2D"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(max) / COUNT(max) FROM archive_day_outTemp GROUP BY Year, Month"
        units = temperature

    [[rain]]
        minvalues = 0, 5, 25, 50, 75, 100, 150
        maxvalues = 4, 24, 49, 74, 99, 149, 1000
        colours =   "#FFFFFF", "#E0F8E0", "#A9F5A9", "#58FA58", "#2EFE2E", "#01DF01", "#01DF01"
        sqlquery = "SELECT FROM_UNIXTIME(dateTime, '%%Y') as Year, FROM_UNIXTIME(dateTime, '%%m') as Month, SUM(sum) FROM archive_day_rain GROUP BY Year, Month"
        units = rain

After this change it seems ok again !

Greetings



Op zaterdag 1 maart 2014 11:21:44 UTC+1 schreef Andrew Milner:
Reply all
Reply to author
Forward
0 new messages