RPi and Bootstrap template

999 views
Skip to first unread message

Nick Dajda

unread,
Jun 10, 2013, 4:18:27 PM6/10/13
to weewx...@googlegroups.com
Please feel free to add my site to the sample stations list...

www.dajda.net
Location: Royston, UK

It uses some (very unpolished) python code I wrote to show latest readings as visual gauges. I'll post the source at some point. It also uses Bootstrap for the general layout with everything running on a raspberry pi.

I'm really impressed with Weewx, it made the whole thing very easy indeed!

Nick

Thomas Keffer

unread,
Jun 10, 2013, 8:02:58 PM6/10/13
to weewx-user
Done.

Nice looking site, Nick!

-tk



Nick

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





--
Tom Keffer
kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

Nick Dajda

unread,
Jun 24, 2013, 5:02:53 PM6/24/13
to weewx...@googlegroups.com
Thanks!

Not sure if the gauge generation code is any use to anyone however I've uploaded it anyway. www.dajda.net/nicksengines.py
My python is very rudimentary :)

Nick

William Phelps

unread,
Jun 25, 2013, 12:36:32 PM6/25/13
to weewx...@googlegroups.com
I like those gauges! will have to see if I can steal some of those...

William 

Thomas Keffer

unread,
Jun 25, 2013, 12:46:00 PM6/25/13
to weewx-user
It actually looks pretty good. Really, you should break out the gauge imaging code from the reporting code. Then it could be used in other applications.

-tk

Jan Commandeur

unread,
Jul 21, 2013, 2:52:22 AM7/21/13
to weewx...@googlegroups.com
Is it possible to use the gauge_generation with mysql?


Op maandag 24 juni 2013 23:02:53 UTC+2 schreef Nick Dajda het volgende:

Nick Dajda

unread,
Jul 21, 2013, 3:50:54 PM7/21/13
to weewx...@googlegroups.com
Not currently. It polls the archive.sdb database directly rather than go through the proper weewx helper services.

Nick

Nick Dajda

unread,
Jul 21, 2013, 4:02:25 PM7/21/13
to weewx...@googlegroups.com
Although if anybody can recommend an easy way to read the last x number of readings then I'm happy to add this.

Currently it uses this SQL code to get the data it needs (from archive.sdb).
cur.execute("SELECT * FROM archive ORDER BY dateTime DESC LIMIT %d" % numPoints)


Thomas Keffer

unread,
Jul 21, 2013, 4:16:45 PM7/21/13
to weewx-user
That's exactly what you do, except you do it on an instance of Archive (NOT TESTED):

archive_db = config_dict['StdArchive']['archive_database']
archive = weewx.archive.Archive.open(config_dict['Databases'][archive_db])
for row in archive.genSql("SELECT * FROM archive LIMIT %d" % numPoints):
  print row

-tk

Nick Dajda

unread,
Jul 22, 2013, 5:04:01 PM7/22/13
to weewx...@googlegroups.com
Thanks very much, this worked very nicely.

The new database independent generator script can be found here: http://www.dajda.net/about.html

Nick

Jan Commandeur

unread,
Jul 23, 2013, 1:47:52 PM7/23/13
to weewx...@googlegroups.com
How to put the gauges in an all ready weather-site
http://weerkikker.hollandweather.net

Jan

Op maandag 22 juli 2013 23:04:01 UTC+2 schreef Nick Dajda het volgende:

Petr Opluštil

unread,
Aug 6, 2013, 4:11:19 AM8/6/13
to weewx...@googlegroups.com
Hi Nick
I downloaded and tested your skin and nicksengines.py from your page, but when i started generate html pages i get this error. I thinks, you have some mistatekes there. Can you fix it (give gen to package, ...).

Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Gauge generator code run (yippee!)
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating Temperature gauge, (180 x 180), value = 26.1
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating Pressure gauge, (180 x 180), value = 1009.6
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: outHumidity.. = 54.00
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating Humidity gauge, (180 x 180), value = 54.0
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating WindSpeed gauge, (180 x 180), value = 0.0
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating WindGust gauge, (180 x 180), value = 0.0
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Generating WindDirection gauge, (180 x 180)
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: [45.0]
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: degree_compass
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: group_direction
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Time taken 0.60 seconds
Aug  6 10:08:39 raspberrypi wee_reports[4309]: reportengine: Unable to instantiate generator user.alltimestats.AllTimeFileGenerator.
Aug  6 10:08:39 raspberrypi wee_reports[4309]:         ****  No module named alltimestats
Aug  6 10:08:39 raspberrypi wee_reports[4309]:         ****  Generator ignored...
Aug  6 10:08:54 raspberrypi wee_reports[4309]: reportengine: Caught unrecoverable exception in generator weewx.imagegenerator.ImageGenerator
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****  start time (1364693400) is greater than stop time (1364691600)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****  Traceback (most recent call last):
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 130, in run
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      obj.start()
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 293, in start
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      self.run()
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 38, in run
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      self.genImages(self.gen_ts)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/imagegenerator.py", line 202, in genImages
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      aggregate_interval, aggregate_type)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/archive.py", line 400, in getSqlVectorsExtended
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      return self.getSqlVectors(ext_type, startstamp, stopstamp, aggregate_interval, aggregate_type)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weewx/archive.py", line 324, in getSqlVectors
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      for stamp in weeutil.weeutil.intervalgen(startstamp, stopstamp, aggregate_interval):
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weeutil/weeutil.py", line 286, in intervalgen
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      yield TimeSpan(stamp1, stamp2)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****    File "/home/weewx/bin/weeutil/weeutil.py", line 181, in __new__
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****      raise ValueError, "start time (%d) is greater than stop time (%d)" % (args[0], args[1])
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****  ValueError: start time (1364693400) is greater than stop time (1364691600)
Aug  6 10:08:54 raspberrypi wee_reports[4309]:         ****  Generator terminated...

BTW skin is very interesting.

Dne pondělí, 22. července 2013 23:04:01 UTC+2 Nick Dajda napsal(a):

Nick Dajda

unread,
Aug 6, 2013, 4:37:15 PM8/6/13
to weewx...@googlegroups.com
Hi Petr,

I believe this is fixed in the latest release (2.4.0).

This thread has some more information on this error: https://groups.google.com/forum/#!topic/weewx-user/jPapzLfhazQ

Nick

Petr Opluštil

unread,
Aug 7, 2013, 1:41:25 AM8/7/13
to weewx...@googlegroups.com
Hi Nick,
I discovered that problem is with generation of yeartempchill graph.It seems that can solve my problem. I try it. Thanks for info and quick answer.
P.

Dne úterý, 6. srpna 2013 22:37:15 UTC+2 Nick Dajda napsal(a):

Kenneth Edwall

unread,
Mar 7, 2014, 5:12:30 PM3/7/14
to weewx...@googlegroups.com
Hi Nick,

I am using the fantastic skin you made, good job there! I seem to be having problems getting the gauges to generate the correct data, and the log indicates the input us wrong. Could it be the "Celsius" value after 1.0 that makes it to error out?

Mar  7 23:05:24 raspberrypi weewx[2571]: GaugeGenerator: Generating outTemp gauge, (180 x 180), value = 1.0°C

Mar  7 23:05:24 raspberrypi weewx[2571]: reportengine: Caught unrecoverable exception in generator user.gaugeengine.GaugeGenerator

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****  float() argument must be a string or a number

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****  Traceback (most recent call last):

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 133, in run

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****      obj.start()

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 298, in start

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****      self.run()

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****    File "/usr/share/weewx/user/gaugeengine.py", line 191, in run

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****      self.drawGauge(gauge, valueTuple, unitType)

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****    File "/usr/share/weewx/user/gaugeengine.py", line 493, in drawGauge

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****      buckets = self.histogram(gaugeName, gaugeName, unitType, numBins)

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****    File "/usr/share/weewx/user/gaugeengine.py", line 424, in histogram

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****      histValue = float(valueTuple[0])

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****  TypeError: float() argument must be a string or a number

Mar  7 23:05:24 raspberrypi weewx[2571]:         ****  Generator terminated...


if so, is there any way to filter it out?

Thanks,
Kenneth

Andrew Milner

unread,
Mar 7, 2014, 10:35:13 PM3/7/14
to weewx...@googlegroups.com
It's not the C - that is just a log string that is built for logging purposes.

Try and turn off the history setting for the gauge - should clear the error at least!!

Do you have records in the archive that cover the history period you have got specified for the gauge, or is it an empty (new) archive?

Are you using Nick's latest version of gaugeengine - I know that earlier versions had bugs related to None processing in several places.

Andrew

Kenneth Edwall

unread,
Mar 8, 2014, 2:14:41 AM3/8/14
to weewx...@googlegroups.com
Yes, you are right! I installed the new version of of gauge generator.py and the error is now gone! But I still get some errors(even though everything appears to be normal?):

GaugeGenerator: Gauge generator code run... marvellous.
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator: outTemp = -0.25
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator: Generating outTemp gauge, (180 x 180), value = -0.2°C
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator->histogram(): Cannot decode reading for gauge 'outTemp'
Mar  8 08:10:26 raspberrypi weewx[3285]: GaugeGenerator: barometer = 936.0

Thanks,
Kenneth


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/OzIQCB2gWW0/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/d/optout.

Andrew Milner

unread,
Mar 8, 2014, 9:10:55 AM3/8/14
to weewx...@googlegroups.com
Have you checked your archive database to see if you have some strange values in there during the hours of history you are trying to display on the gauge?

What happens if you comment out history for the out temp gauge in the skin??  Can you attach the gauges section of your skin?  Do the other gauges (without history) work OK?

Christian Müller

unread,
Oct 28, 2014, 11:11:03 AM10/28/14
to weewx...@googlegroups.com
Hi!
I also downloaded and tested this really very nice skin.
My Problem is that one of the Sensors (outTemp) of the Ventus W831 ran out of Battery and the Station is about 700 km far away :-(
The transmitted Value for outTemt is now "None" and the gaugeengine complains about this strange value an generates no HTML-pages.
Is it possible to turn of the outTemp temporary until the sonsor gets fresh Batteries?

 GaugeGenerator: outTemp, could not plot reading value of = None
Oct 28 14:50:31 piwetter weewx[2686]:         ****  Traceback (most recent call last):
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/reportengine.py", line 137, in run
Oct 28 14:50:31 piwetter weewx[2686]:         ****      obj.start()
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/reportengine.py", line 304, in start
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.run()
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/gaugeengine.py", line 126, in run
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.gen_gauges()
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/gaugeengine.py", line 157, in gen_gauges
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.gen_gauge(gauge, plot_options, img_file)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/gaugeengine.py", line 277, in gen_gauge
Oct 28 14:50:31 piwetter weewx[2686]:         ****      gauge.add_history(history_list, num_buckets, history_color)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/gauges.py", line 214, in add_history
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.buckets = [i / roof for i in self.buckets]
Oct 28 14:50:31 piwetter weewx[2686]:         ****  ZeroDivisionError: float division by zero
Oct 28 14:50:31 piwetter weewx[2686]:         ****  Traceback (most recent call last):
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/reportengine.py", line 137, in run
Oct 28 14:50:31 piwetter weewx[2686]:         ****      obj.start()
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/reportengine.py", line 304, in start
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.run()
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/cheetahgenerator.py", line 129, in run
Oct 28 14:50:31 piwetter weewx[2686]:         ****      self.generate(time_period, self.gen_ts)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/cheetahgenerator.py", line 266, in generate
Oct 28 14:50:31 piwetter weewx[2686]:         ****      archivedb, statsdb)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/cheetahgenerator.py", line 303, in _getSearchList
Oct 28 14:50:31 piwetter weewx[2686]:         ****      + self.getToDateSearchList(archivedb, statsdb, timespan)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/historygenerator.py", line 217, in get_extension
Oct 28 14:50:31 piwetter weewx[2686]:         ****      search_list_extension[table + '_table'] = self.statsHTMLTable(table, self.table_dict[table]['sqlquery'], self.table_dict[table]['units'], statsdb)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/historygenerator.py", line 309, in statsHTMLTable
Oct 28 14:50:31 piwetter weewx[2686]:         ****      htmlLine += (' ' * 12) + self.colorCell(record[2], units, bgColours)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/user/historygenerator.py", line 226, in colorCell
Oct 28 14:50:31 piwetter weewx[2686]:         ****      value = conversionDict['degree_F']['degree_C'](value)
Oct 28 14:50:31 piwetter weewx[2686]:         ****    File "/home/weewx/install/bin/weewx/units.py", line 169, in <lambda>
Oct 28 14:50:31 piwetter weewx[2686]:         ****      'degree_F'         : {'degree_C'         : lambda x : (x-32.0) * (5.0/9.0)},
Oct 28 14:50:31 piwetter weewx[2686]:         ****  TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'


Thanks!

Christian

Andrew Milner

unread,
Oct 28, 2014, 11:36:26 AM10/28/14
to weewx...@googlegroups.com
The 'simple' way would be to just comment out the out\Temp gauge - so he does not even try and generate it.  Your error is coming from the histogram part though - so just remove the history line.  You wil stil get the onfo log about 'none' but will not get the error condition.  Also comment out the temperature tables - or get inside the code as it looks like it cannot handle all None for a month correctly - but that is an unusual situation!!  May be easier to just temporarily replace the history page with one that is fixed and says 'Not available' until you are able to sort it out!!
Reply all
Reply to author
Forward
0 new messages