WS2350 - Synology - NameSpace - No Charts

919 views
Skip to first unread message

Chris Davies-Barnard

unread,
Dec 28, 2013, 8:43:28 AM12/28/13
to weewx...@googlegroups.com
Hi,

Firstly a huge thanks to Tom, RRT4 and Matt for all their help getting me this far.  I now have a working weewx to weather station connection as seen below.

but the reporting is not quite at full speed - http://www.byteinsight.net/weather.  If I force a report to be generated:

and the log files show:

I'm using sqlite because I cannot get mysqld to work on the synology box (Luc - I think you might have solved this problem?)

If anyone has any ideas I would be so grateful.  It's been a really good couple of days getting the weather station this far.

Thanks

Chris


Thomas Keffer

unread,
Dec 28, 2013, 9:50:09 AM12/28/13
to weewx-user
Without knowing the entire history of your install, it's hard to tell exactly what went wrong.

Most likely, when you installed Cheetah, it did not find a C compiler, and so it installed the pure Python version, which is much slower.

Try uninstalling Cheetah, then installing the gcc compiler, then the python development library. Then retry the Cheetah install. I am not sure what these are called on our system, but on a Debian system the sequence would be

sudo apt-get remove python-cheetah
sudo apt-get install gcc
sudo apt-get install python-devel
sudo apt-get install python-cheetah

-tk





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

Chris Davies-Barnard

unread,
Dec 28, 2013, 2:05:34 PM12/28/13
to weewx-user
Hi Tom,

Thanks for the reply.  I'm using a Synology box so cannot use apt-get but can use pip and ipkg.  I have uninstalled Cheetah and downloaded it as source.  Trying to build it I get the following amongst the other output.  

  • running build_ext
  • building 'Cheetah._namemapper' extension
  • creating build/temp.linux-x86_64-2.7
  • creating build/temp.linux-x86_64-2.7/cheetah
  • creating build/temp.linux-x86_64-2.7/cheetah/c
  • /usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-gcc -fno-strict-aliasing -I/usr/syno/include/ncurses/ -I. -I./Modules/expat/ -I/usr/local/i686-linux-gnu/include -DSYNO_X86 -O2 -I/usr/syno/include -g -DSYNO_PLATFORM=X64 -g -DSDK_VER_MIN_REQUIRED=400 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c cheetah/c/_namemapper.c -o build/temp.linux-x86_64-2.7/cheetah/c/_namemapper.o
  • unable to execute /usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-gcc: No such file or directory
  • One or more C extensions failed to build.
  • Details: command '/usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-gcc' failed with exit status 1
  • Retrying without C extensions enabled.
Sadly, there does not seem to be an easy way to fix this.

Chris



--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Chris Davies-Barnard

unread,
Dec 28, 2013, 4:07:09 PM12/28/13
to weewx...@googlegroups.com
Hi again,

Thanks for all the help getting this sorted and sorry for the constant stream of questions.

Having looked and thought about this some more I have charts for other time periods e.g. week, month etc but the problem seems to exist with current data and it not being seen by Cheetah although it exists in the mysql database.  

I have two questions:
1)  Does anyone have any idea what might be causing this.
2)  If I wrote my own python script to process the data from the database that didn't use Cheetah is there a way to include it in the main program?

Thanks as always

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

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

--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Thomas Keffer

unread,
Dec 28, 2013, 6:04:43 PM12/28/13
to weewx-user
Yes, you are missing the gcc compiler. There has to be a way to install it --- how else would they have built the rest of the system?

-tk

Thomas Keffer

unread,
Dec 28, 2013, 6:10:56 PM12/28/13
to weewx-user
The problem is that you are missing the "C" version of Cheetah, which is necessary to process the templates. The charts do not use it, so they are fine.

The main program uses the weewx service StdReport to do its reporting. I suppose you could write a replacement but, believe me, it would be a lot easier to just get Cheetah running. 

Cheetah is a very reliable, very old library --- nothing exotic. It will work on ancient versions of Python. The only thing standing in the way of using it is getting the gcc compiler up and running and, possibly, python-dev (or whatever the equivalent is on the Synology).

BTW, what operating system does the Synology use?

-tk


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

Chris Davies-Barnard

unread,
Dec 29, 2013, 3:47:21 AM12/29/13
to weewx-user
Hi Tom,

Thanks again for your help. Like I said at the start you probably don't get anywhere near enough credit for the work you do and the support you provide.  THANK YOU!!!

Synology uses a linux/BSD variant called DSM. So you have all the normal *inx tools like apache, samba and iptables.   The standard terminal is ash although you can instal bash via ipkg.    I have installed gcc this way and have version 4

bash-3.2# gcc --version

gcc (GCC) 4.2.1

Copyright (C) 2007 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bash-3.2# 


I think the problem is that this version of gcc does not come with ccache or at least we cannot find it.  Having looked around a lot of people seem to be suffering with this line

  • unable to execute /usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-gcc: No such file or directory
I have seen references to it in connection with NameMapper and the python mysql library > https://www.google.co.uk/search?q=i686-linux-gnu-ccache-gcc+synology


What is confusing me is that if you look at the actual page http://www.byteinsight.net/weather/  everything seems to work (there are faint dots on the current charts) except the current conditions.  Would cheetah not have failed to pull through data for the since midnight section as well if it was really having a problem?

Cheers

Chris





To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Dec 29, 2013, 9:11:11 AM12/29/13
to weewx-user
Well, that's a good point. You would think that if it works for the statistical summaries, it would work for the current conditions.

Are we sure there is anything in the archive database? Do you have the utility sqlite3 on the Synology? If so, try this:

$ sqlite3 /home/weewx/archive/weewx.sdb
sqlite> select datetime(max(dateTime), 'unixepoch', 'localtime')) from archive;

This will show you the timestamp of the last record in the database. Given that time, you can see what that record looks like:

sqlite> select barometer, outTemp from archive where dateTime = xxxxxxxx;

If you don't have the sqlite3 utility, then we can write something similar in Python, but let's try this first.

One other thought: try setting debug=1, then restart weewx. Then post the entire syslog from startup of weewx through the first attempt at running a report. There may be clue in there. If you can, please post the text, and not the screenshots --- it's a lot easier to do searches on the former!

-tk

Chris Davies-Barnard

unread,
Dec 29, 2013, 10:30:45 AM12/29/13
to weewx-user
Hi Tom, 

Thank you for the reply.  I'm working on a Raspberry Pi alternative now but would prefer this solution as the Synology box is already turned on and running.  So based on your suggestion.

sqlite> select datetime(max(dateTime), 'unixepoch', 'localtime') from archive;

2013-12-29 10:00:00

I had to try the next step slightly differently to how you suggested but...

sqlite> select max(dateTime) from archive;  

1388311200

sqlite> select barometer, outTemp from archive where dateTime = 1388311200;

|6.17142857142857

There are some fields missing such as wind.  The anemometer is broken and if I can get this working I'll look at buying a replacement or maybe upgrading but its not worth the investment without a suitable software solution.

sqlite> select * from archive where dateTime = 1388311200;

1388311200|16|60||1008.06326530612|1011.3580540946|20.4397959183674|6.17142857142857|46.1326530612245|87.8367346938775|||||0.0|0.0|4.26979591836735|-18.9|6.17142857142857|||||||||||||||||||||||||||||||||

So there is something there and interestingly the Raspberry Pi version is working 100% and has produced correct reports http://weather.byteinsight.co.uk.   I moved the databases across to the Synology box and ran ./bin/wee_reports weewx.conf but it still gave the same missing current data.

Interestingly the raspberry pi did complain about None types not being ints but seemed to recover from it.

Attached is the messages log file from the Synology box. 

Thanks again for your help.

Chris


messages

Thomas Keffer

unread,
Dec 29, 2013, 1:36:58 PM12/29/13
to weewx-user, Matthew Wall
(Once again, I learn not to try a diagnosis without the log! :-))

The problem is in the driver or its configuration, not in the reporting system. The driver is emitting archive records with an interval of 'None', which prevents them from being inserted into the database.

Time to call in our WS23XX expert. Matthew?

-tk

mwall

unread,
Dec 29, 2013, 5:33:41 PM12/29/13
to weewx...@googlegroups.com
Chris, is your station archive interval 1 minute or 60 minutes?

Assuming that your problem is nulls in the database and your interval is 1 minute, you can repair existing data by doing this:

sqlite3 /home/weewx/archive/weewx.sdb
update archive set interval=1 where interval=NULL;

I'll try to replicate the null intervals when i get access to my dev system again.

unfortunately i borked my dev system by trying to install lm-sensors, and there is no way for me to do a remote reboot. i'll be back in the us soon to fix it.

m

mwall

unread,
Dec 29, 2013, 5:42:13 PM12/29/13
to weewx...@googlegroups.com
Chris,

be sure to set record_generation=software in weewx.conf. Until we sort the interval problem, that is a safer way to run the ws23xx stations.

tom,

it might be time to put a 2.5.1 out, even though 2.6 is lurking on the horizon. There is a bugfix on the trunk that makes at least part of chris' problem go away, and it would get the ws23xx and te923 drivers into an actual release. Let me know how you want to play this...

m

Thomas Keffer

unread,
Dec 29, 2013, 6:16:32 PM12/29/13
to weewx-user
Matthew: I'm absolutely helpless to do a 2.5.1 release. All I have here is a Windows 8 laptop!

If you want to handle it yourself, go ahead.

I guess we didn't anticipate how many weather stations there would be under the Xmas tree!

-tk



m

Chris Davies-Barnard

unread,
Dec 30, 2013, 3:29:47 AM12/30/13
to weewx-user
Hi M, TK

Thank you for the ideas/advice.    This morning I made the changes suggested by M to the configuration 

[WS23xx]

    port = /dev/ttyUSB0

    driver = weewx.drivers.ws23xx

    record_generation=software


and deleted both the archive and public_html folders so forcing it so start over.  Both folders have been recreated and this is the net result http://www.byteinsight.net/weather/

I had left the weather station running overnight on the raspberry pi and by contrast this is what I get http://weather.byteinsight.co.uk/ (I'm still working on the template)  so I'm not sure it is a driver issue because the same set up is working on another machine.   

I fear that the NameMap problem causes the Synology version to crash during the creation of the html file so although the database is OK the pages are not formed correctly?  Yesterday I exported working databases from the RPi to the synology box and was not able to solve the problem i.e. current data was still not visible.

I'm going to try a couple more things today but would welcome your thoughts.  Thanks again.

Chris










--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

mwall

unread,
Dec 30, 2013, 7:19:51 AM12/30/13
to weewx...@googlegroups.com
On Monday, December 30, 2013 3:29:47 AM UTC-5, Chris Davies-Barnard wrote:
Hi M, TK

Thank you for the ideas/advice.    This morning I made the changes suggested by M to the configuration 

[WS23xx]

    port = /dev/ttyUSB0

    driver = weewx.drivers.ws23xx

    record_generation=software


and deleted both the archive and public_html folders so forcing it so start over.  Both folders have been recreated and this is the net result http://www.byteinsight.net/weather/

I had left the weather station running overnight on the raspberry pi and by contrast this is what I get http://weather.byteinsight.co.uk/ (I'm still working on the template)  so I'm not sure it is a driver issue because the same set up is working on another machine.


chris,

record_generation belongs in the StdArchive section of weewx.conf.  the default is hardware, but you should change it to software for the ws23xx (at least until i sort out the NULL interval problem).

btw, here is an example of what the plots look like when weewx does a 'catchup'.  in the following image, the dots are from a period of time when the computer was off, but the station was recording records every 30 minutes.  just before 22:00, the computer was turned on.  it downloaded the archive records from the station, then went into software record generation mode.  in week/month/year periods the dots don't show up because the data have been aggregated.

m
dayinouttempdew.png

Chris Davies-Barnard

unread,
Dec 30, 2013, 1:53:31 PM12/30/13
to weewx-user
Hi Matt,

Thanks for the reply and pointing out my mistake.   I wasn't really thinking about it properly this morning.    Here is where I am up to:

  • database updated as per your query
  • software generation added and weewx restarted.
Reports are being produced with current data showing in the left column but still only dots in the charts.  The wind is not showing but I am not getting anything on the display so need to investigate the sensor.
  • database updated as per your query
  • software generation added
i'm not currently running this version so did two things
  1. I deleted the public_html folder and ran the reports with wee_reports - no data in left column
  2. I copied the databases across from the RPi system and repeated 1 but no different.  Below is the error message I got.

/usr/local/lib/python2.7/site-packages/Cheetah-2.4.4-py2.7-linux-x86_64.egg/Cheetah/Compiler.py:1509: UserWarning: 

You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.

  "\nYou don't have the C version of NameMapper installed! "

and this is the dump from the logs

bash-3.2# tail -f /var/log/messages                        

Dec 30 18:50:47 mole wee_reports[11405]:         ****  Generator terminated...

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Byteweather/RSS/weewx_rss.xml.tmpl

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** reason: cannot find 'dateTime'

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Byteweather/mobile.html.tmpl

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** reason: cannot find 'outTemp'

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Byteweather/smartphone/index.html.tmpl

Dec 30 18:52:47 mole wee_reports[11418]: cheetahgenerator: **** reason: cannot find 'dateTime'

Thanks for all your effort trying to solve this problem with me. 

Regards

Chris



--

mwall

unread,
Dec 30, 2013, 3:12:55 PM12/30/13
to weewx...@googlegroups.com
chris,

you'll end up with fewer grey hairs if you get things working on the pi first.  only after it works on the pi move to the synology.

the dots are easy - i'll bet they are 1 hour apart.  the archive interval on your station is probably the factory default of 1 hour, and record_generation=hardware in weewx.conf (the default).  so you end up with one data point each hour, read from the station's memory.

1) stop weewx

2) in weewx.conf, change to record_generation=software

3) change the archive interval of your station to 5 minutes by running wee_config_ws23xx like this:

sudo /home/weewx/bin/wee_config_ws23xx --set-interval=5

4) start weewx.

as for figuring out what is wrong with the wind sensors, first try getting a single set of readings from the station.  do this:

sudo /home/weewx/bin/wee_config_ws23xx --current

you should see output like this:

Using configuration file /home/weewx/weewx.conf
Driver version 0.18
Querying the station for current weather data...
{'barometer': 1010.628960407956, 'windchill': -0.059999999999999998, 'dewpoint': -7.6200000000000001, 'pressure': 1009.3, 'outHumidity': 43.0, 'altimeter': 1010.2783882817305, 'heatindex': 3.8999999999999981, 'rain': None, 'dateTime': 1388433577, 'windDir': 270.0, 'outTemp': 3.8999999999999999, 'windSpeed': 10.800000000000001, 'inHumidity': 40.0, 'inTemp': 21.199999999999999, 'windGust': None, 'rainTotal': 10.048999999999999, 'rainRate': 0.0, 'usUnits': 16, 'windGustDir': None}

look for the 'windSpeed' and 'windDir' values.

the next level of sensor diagnosis is to get the raw numbers from each sensor.  for wind, do this (assuming a generic setup.py installation):

cd /home/weewx
sudo PYTHONPATH=bin python bin/weewx/drivers/ws23xx.py --measure ws
sudo PYTHONPATH=bin python bin/weewx/drivers/ws23xx.py --measure w0
sudo PYTHONPATH=bin python bin/weewx/drivers/ws23xx.py --measure wso
sudo PYTHONPATH=bin python bin/weewx/drivers/ws23xx.py --measure wsv
sudo PYTHONPATH=bin python bin/weewx/drivers/ws23xx.py --measure wind

'ws' is the wind speed.  'w0' is the latest wind direction.  'wso' is the flag for wind speed overflow.  'wsv' is the flag for wind speed validity.  'wind' is an aggregate call for all four values.  you should get output something like these:

{'ws': 1.7}
{'wind': (1.7, 292.5, 0, 0)}

you can do these while weexd is running, but then you take a chance of having delays due to serial port contention.

m

Chris Davies-Barnard

unread,
Dec 30, 2013, 3:30:16 PM12/30/13
to weewx-user
Thanks Matt, you are becoming a legend!

Totally agree with getting it to work on the Pi first.   So, first part done ok.  I had to give the full path for the config file because I have a non-standard instal location.  Hopefully I'll start to get lines rather than dots. 

As for the wind - I think its a hardware fault outside as there is nothing on the unit inside.   Current returns



--

Chris Davies-Barnard

unread,
Dec 30, 2013, 3:31:30 PM12/30/13
to weewx-user

{'barometer': 1005.6999142277193, 'windchill': -18.9, 'dewpoint': 2.82, 'pressure': 1002.0, 'outHumidity': 86.0, 'altimeter': 1005.2772719424348, 'heatindex': 5.0, 'rain': None, 'dateTime': 1388435251, 'windDir': None, 'outTemp': 5.0, 'windSpeed': None, 'inHumidity': 52.0, 'inTemp': 23.6, 'windGust': None, 'rainTotal': 79.764, 'rainRate': 0.0, 'usUnits': 16, 'windGustDir': None}

which would agree with this.

Any recommendations on a new weather station if one was to buy one.  How easy is it to cope with the Davis Vue if you don't buy the weatherlink adapter?

Thanks again

Chris


mwall

unread,
Dec 30, 2013, 4:42:51 PM12/30/13
to weewx...@googlegroups.com
On Monday, December 30, 2013 3:31:30 PM UTC-5, Chris Davies-Barnard wrote:
Any recommendations on a new weather station if one was to buy one.  How easy is it to cope with the Davis Vue if you don't buy the weatherlink adapter?

my experience with a davis station is only using the davis logger.

the davis vantage stations appear to be most popular at cwop:

http://weather.gladstonefamily.net/cgi-bin/wxequip.pl

the weewx map shows vantage and fine offset as the most popular, but that is a severely skewed sample (weewx drivers for stations other than vantage have only been available since january 2013).

if someone has a spare wmr300, wmr200, and/or vantage they would like to loan me for 3 months or so, i would be happy to do a head-to-head comparison of the quality of station/sensor data.  since a few weeks ago we have started to collect data from co-located ws2317, ws1090, and te923 sensors.  it would be fun to add some davis and oregon scientific equipment to the comparison.

m

Thomas Keffer

unread,
Dec 30, 2013, 5:16:23 PM12/30/13
to weewx-user
Chris,

Unfortunately, the Davis Vantage is just about worthless without an adapter. There is no other way of getting data out of the thing.

There are a few brave souls who have cobbled together homebrew adapters. The problem is that earlier in the year, Davis changed their stations to prevent this (the so-called "Green Dot" loggers), so it is no longer as easy as it used to be. Nevertheless, the hive is endlessly creative and there have been some recent breakthroughs at getting around the Davis security algorithm. Here's the relevant thread on wxforum.net. If you want to go this approach, you should have considerable electronic skills.

As for quality, the Vantages are very good. My previous unit was on my roof for 6+ years and is still going strong at a neighbor's orchard. 

-tk


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.

Chris Davies-Barnard

unread,
Dec 31, 2013, 3:16:34 AM12/31/13
to weewx-user
Dear M and TK,

Thank you so much for your dedicated help.  It is working just fine on the RPi now.   the interval was the issue with the dots.  I'm going to look at solving the C and NameMapper issue on the synology box as that is clearly the problem. Thanks also for your advice on the weather stations.   

Best wishes for the new year and thanks again.

Chris

Tyler McNamee

unread,
Jan 1, 2014, 2:51:33 AM1/1/14
to weewx...@googlegroups.com
Hello Chris, Matt and Tom,

I've been following this discussion with great interest as I have connected my weather station to a Synology box as well (DS212). 

Following Chris' instructions I was able to (mostly) get it working. Uploading to weather underground works fine, and that site is able to access my current weather data without problem (http://www.wunderground.com/personal-weather-station/dashboard?ID=IAUCKLAN151).

However the local site hosted on my synology box suffers the same problem described above in that any data associated with $current doesn't show (it displays "$current.xxx") (see pic).  All other data & graphs seem to work fine. (even the barometer $trend works ok in the current section)



 I do get some errors with cheetah as noted by chris (see log excerpt below) however I do note that it doesn't seem to affect the main index.html template.

I did try to install another version of cheetah (following instructions here: http://sickbeard.com/install.html) but no luck. In any event it seems far more complex an issue so will wait for you 3 to work it out as I'm a rank amateur! 

Probably a great over simplification but is there any other way to call the most recent record other than using $current? I can see the data in the sqlite database.



Jan 1 20:12:59 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Jan 1 20:12:59 weewx[19576]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Standard/wxtest.html.tmpl

Jan 1 20:12:59 weewx[19576]: cheetahgenerator: **** reason: cannot find 'outTemp'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Standard/RSS/weewx_rss.xml.tmpl

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** reason: cannot find 'dateTime'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Standard/mobile.html.tmpl

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** reason: cannot find 'outTemp'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Standard/smartphone/index.html.tmpl

Jan 1 20:13:01 weewx[19576]: cheetahgenerator: **** reason: cannot find 'dateTime'

Jan 1 20:13:08 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

Jan 1 20:13:08 weewx[19576]: cheetahgenerator: **** ignoring template /volume1/homes/weewx/system/skins/Standard/wxtest.html.tmpl

Jan 1 20:13:08 weewx[19576]: cheetahgenerator: **** reason: cannot find 'outTemp'

Jan 1 20:13:10 weewx[19576]: cheetahgenerator: generate failed with exception '<class 'Cheetah.NameMapper.NotFound'>'

 

Thomas Keffer

unread,
Jan 1, 2014, 7:46:33 AM1/1/14
to weewx-user
Hello, Tyler,

This is triggering a memory of a similar issue many years ago with the Python version of Cheetah.

I'm pretty sure the issue has to do with this version of Cheetah probing objects in the search list, trying to see if they are dictionaries by looking for a key "has_key". The literal value "has_key" is treated like an observation type by the weewx search list extensions. 

There are guards against this in the stats code, but we've added some recent code when the search list extensions were introduced a few months ago.

I can't test the theory because I'm far away from home, but I've made a stab at it. Without testing it, there's no way of being sure, but it's worth a try. Replace your version of bin/weewx/units.py with the attached version, then restart weewx and let us know if anything is different.

Chris: you might want to try this version as well.

-tk



--
units.py

Chris Davies-Barnard

unread,
Jan 1, 2014, 9:05:41 AM1/1/14
to weewx-user
Hi Tom and Tyler,

Firstly, thanks to Tyler for describing the problem so clearly and showing that the data was there and getting through to Wunderground if not showing in the index files.  Thanks also to Tom for taking time out to send a possible solution.

I have now set up two simulation versions on my synology box as the WS2350 is running OK on the RPi for now:

I have reset both with zero archive and public_html, deleted the unit.pyc, renamed unit.py and added your new version.   Unfortunately, it doesn't look hopeful but they need a little more time to produce more data.

Chris








--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Tyler McNamee

unread,
Jan 1, 2014, 3:48:08 PM1/1/14
to weewx...@googlegroups.com
Hi,

Thanks Tom for trying to come up with a solution on what I imagine must be your holiday!

I've tried using the new units.py but unfortunately there doesn't seem to be any difference with the $current data for the cheetah generated index. 

 I did notice the following message when I restarted weewxd from the terminal:

/usr/local/lib/python2.7/site-packages/Cheetah-2.4.4-py2.7.egg/Cheetah/Compiler.py:1509: UserWarning: 
You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.
  "\nYou don't have the C version of NameMapper installed! "

Although I suspect this might be a red-herring to the problem with $current as clearly some is working.

Thanks! 
Tyler

Thomas Keffer

unread,
Jan 1, 2014, 4:07:04 PM1/1/14
to weewx-user
Actually, Tyler, I think it's exactly the problem. The Python version is supposed to work identically to the C version, just slower.

Unfortunately, as I've discovered in the past, it is not quite as mature and has a few bugs. I'm aware of most of them, but this one seems to be a new one. Also unfortunate, I'm far away from my development computer, so I cannot reproduce the problem.

If you can get the C version of Cheetah running, it could well solve your problems. Here's the Cheetah download page.

-tk


--

Chris Davies

unread,
Jan 1, 2014, 4:18:34 PM1/1/14
to weewx...@googlegroups.com
Hi Tom, Tyler,

This is where I got to and basically it comes down to the version of gcc bundled with ipkg not including ccache. It also affects the required MySQL package.

Chris.

Sent from a mobile device.
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Tyler McNamee

unread,
Jan 1, 2014, 7:54:46 PM1/1/14
to weewx...@googlegroups.com
Hi again,

Well I've managed to hack together a solution that works for me because I'm serving the webpage directly from my synology box and seemed much simpler than trying to install the c version of cheetah (really don't know where to begin with that one!).

I inserted some php code in the index template to directly query the most recent record from the sqlite database, and then output these values in the "current" table.  I had to rename the file to index.php.tmpl and update skins.conf accordingly -- but it works!

Here is the code to retrieve the data:

<?php

  class MyDB extends SQLite3
  {
     function __construct()
     {
        $this->open('/volume1/homes/weewx/system/archive/weewx.sdb');
     }
  }
  $datab = new MyDB();
  if(!$datab){
     echo $datab->lastErrorMsg();
  } 

  $sql ="SELECT * from archive where oid = (select max(oid) from archive);";

  $ret = $datab->query($sql);
  $row = $ret->fetchArray(SQLITE3_ASSOC);
  $datab->close();
?>

I put it right after the </head> tag but I think as long as it's before you need the data it doesn't matter where it goes.

Then for each table row where it would otherwise say (for example) $current.outTemp I've replaced that with <?php echo $row['outTemp'];?>

I did run into a couple of issues to over come:
- Intially the database variable was $db -- that causes cheetah to try and replace it so you need to make sure you don't have any variable name collisions.
- On the synology you may need to set the open_basedir to "none" in the php preferences to be able to access weewx.sdb.
- I used round() on some of the value (eg pressure).
- I still need to convert the Winddir to letters but this should be easy enough.

Attached is my complete index.php.tmpl in case anyone might find it helpful.

Cheers,
Tyler


 
index.php.tmpl

Thomas Keffer

unread,
Jan 1, 2014, 8:26:12 PM1/1/14
to weewx-user
I don't think installing Cheetah is very hard. It's probably just one of those unpack the tarball, type "config", then "make" jobs, but you seem to have found a creative solution!

Glad it worked out!

-tk



--

Tyler McNamee

unread,
Jan 1, 2014, 8:54:54 PM1/1/14
to weewx...@googlegroups.com
Thanks Tom and thanks for your help -- now the fun begins and I can start trying some customisations!

Chris Davies-Barnard

unread,
Jan 2, 2014, 3:44:42 AM1/2/14
to weewx-user
Hi Tyler,

I think that is a brilliant solution to this problem.   I spent most of yesterday evening chasing Cheetah/Synology issues on the web and got no where.   

I stepped out of weewx last night and focused on Cheetah.  There is a command to test the installation - cheetah text - but this didn't help and gave identical output to my working RPi solution.

Regards

Chris


--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Jan 2, 2014, 7:07:33 AM1/2/14
to weewx-user
Well, it is a solution, but I don't think it's the right solution.

Go ahead and use Tyler's solution in the interim, but I'm confident we can get the pure Python version of Cheetah working again. But, it's going to take a little while until I can get home and reproduce the problem.

-tk



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

Tyler McNamee

unread,
Jan 2, 2014, 3:02:12 PM1/2/14
to weewx...@googlegroups.com
Thanks Chris, but yes I agree Tom it would be much cleaner to get Cheetah working.

Also, there is still some work to do on my workaround with units, etc. but they are all fairly straight forward.

Chris Davies-Barnard

unread,
Jan 2, 2014, 3:26:40 PM1/2/14
to weewx...@googlegroups.com
Hi,

I think it really depends on what fix we can achieve for Cheetah.  If its to get the python version working but at a speed which is not too slow then yes.  If its super slow I'd rather strip out the template creation and let php deal with it.  Others may have a different opinion.

For me it actually makes sense to have php dealing with it.  The webserver and weewx are on the same machine and it will get a low number of hits compared to the five minute interval on weewx.   It would not be particularly difficult to have some sort of page cache.   I actually started to look at building Tyler's code into a full-blooded class today but it took longer than expected to prepare something that would read the skin.conf as is.   I'm going to return to it but have to get ready for school on Monday!  

The problem with Cheetah seems to revolve around the C library.  Even from source it fails to build because Synology do not include gnu-ccache-gcc in the gcc build provided via ipkg.   I have done a quick search for building gcc from source but not found anything.

The lack of gnu-ccache-gcc also affects pyephem and python-mysql which is a real shame because both would have been awesome.

Anyway,  I still think Weewx is awesome and have been touched at the quality of support on here.  Registered my station with wunderground today, ordered a new wind anemometer and longer pole.  Just hope it all arrives before the next big storm!

Chris

Thomas Keffer

unread,
Jan 2, 2014, 5:13:10 PM1/2/14
to weewx-user
The Python version of Cheetah is likely to be painfully slow but, remember, it has to run only once every 5 minutes or so. It would be a very different situation if weewx used Cheetah the way it is usually used: to provide dynamic content that can change with every web request. Perhaps hundreds of times each second.

-tk


--

edehn

unread,
Jan 18, 2014, 7:22:13 PM1/18/14
to weewx...@googlegroups.com
Hi

I had the same problems with current data on the templates, when running ver 2.5.1 on a Synology DFS211j, but
 
cheetah without the compiled namespace was working ok in weewx ver 3.4. I was testing the ws28xx driver on a DS211j with Python ver. 2.6 in september and it was ok then.

I have just reinstalled  ver. 3.4, this time With Python 2.7 (Synology standard packages), and it still put all the data on the templates.

I have looked at the creating time for the html files, to get an idée of  how fast/slow Cheetah is running without the compiled namespace.:

indix.html     20:49:36     (strange before 20:50)
mobile.html 20:50:12
month.htmt  20:50:12
week.html    20:50:15
year.html      20:50:17
(missing files for smartphones !)

For me, it looks as running without the C namespace is could be OK, but thats not poosible for the moment with ver. 2.5.


Ebbe


Chris Davies-Barnard

unread,
Jan 19, 2014, 3:14:38 AM1/19/14
to weewx-user
Thanks Ebbe,

That's useful to know.

Chris


--
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/qAF7Fn7D3h8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Luc

unread,
Jan 19, 2014, 7:04:57 PM1/19/14
to weewx...@googlegroups.com
On Saturday, 28 December 2013 10:43:28 UTC-3, Chris Davies-Barnard wrote:

I'm using sqlite because I cannot get mysqld to work on the synology box (Luc - I think you might have solved this problem?)

Chris, 
Happy new year to you - and sorry for the late reply... (I was busy with the maintenance of a PHP-website and had weewx on hold.)

Last year I got weewx with MySQL working for Python 2.5. Attempts to switch to python 2.7 failed, most of the time because the modules were not compiled for the right CPU.
Below the steps to get it working on a DS209+ii or DS211

Installation of  weewx-2.5.1 with ws28xx driver on ds-luc4 (ds211- Marvel Kirkwood mv6282 ARM)

Reset ds-luc4 (2x reset button)

Apply latest patch (3810.pat)

Select: DHCP

Select: TS Santiago

 

Control panel  - Webservices - Enable Webstation - Enable MySQL

Control panel - Terminal - Enable SSH service - Apply

Create User - Luc

HTTP service Port: change to: 1450 (each of my DiskStations has it's own port)

 

Package Center – Install phpMyAdmin

Set pasword for user root (localhost)

Note: Don't install any python package

 

Putty - ssh connection with disk station

First visit shows Warning - Potential Security Breach - Yes

Login as : root - root@[ip-address] password: same pasword as admin

BusyBox v1.16.1 (2013-11-06 05:31:51 CST) built-in shell (ash)

 

First time: create directories for weewx

mkdir /home

mkdir /home/weewx

 

First time: install ipkg

cd /volume1/@tmp

rm -rf /volume1/@optware

rm -rf /usr/lib/ipkg

wget http:[the right bootstrap file for your CPU]

sh [the right bootstrap file for your CPU]

Note: most of the times a reboot isn't needed

 

ipkg update

ipkg upgrade

ipkg install py26-setuptools

ipkg install py26-configobj

ipkg install py26-cheetah

ipkg install python26 Note: is installed at first request (py26-setuptools)

ipkg install mysql

ipkg install py26-mysql

 

Note: if needed, the root passwords of MySQL can be set with:

cd /opt ; /opt/bin/mysqld_safe &

/opt/bin/mysqladmin -u root password 'password-for-root'

/opt/bin/mysqladmin -u root -h ds-luc4 password 'password-for-root'

 

cd /volume1/homes/download (storage for downloads; accesible from a Windows share)

wget http://downloads.sourceforge.net/project/weewx/weewx-2.5.1.tar.gz

tar -xvf weewx-2.5.1.tar.gz

cd /volume1/homes/download/weewx-2.5.1

copy weewx.conf from an earlier version to weewx-2.5.1 (or modify weewx.conf to your needs)

python2.6 setup.py build

python2.6 setup.py install

 

cd /home/weewx (the directory of weewx; note: this directory is lost after a DSM upgrade!)

./bin/wee_config_database weewx.conf --create-archive

Using configuration file weewx.conf.

Created database 'archive_mysql'

./bin/wee_config_database weewx.conf --create-stats

Using configuration file weewx.conf.

Created database 'stats_mysql'


Note: the USB-serial part is not installed yet; I've got problems with this.

Cheers, Luc

Florian Roth

unread,
Jan 26, 2014, 8:10:32 AM1/26/14
to weewx...@googlegroups.com
Am Mittwoch, 1. Januar 2014 22:07:04 UTC+1 schrieb Tom Keffer:

If you can get the C version of Cheetah running, it could well solve your problems. Here's the Cheetah download page.

Updating to weewx 2.5.1 today I have trouble with the same issue on my QNAP TS-220 (python 2.5.6). I'm not sure if I got it: Is the .tar in this link the C version of Cheetah? If not where can I find the C version? Installing Cheetah 2.4.4 with 'python setup.py build/install' works (as replacement for the ipkg-installation), but does not solve the problem.

Thanks!

Felix

Thomas Keffer

unread,
Jan 26, 2014, 8:53:26 AM1/26/14
to weewx-user
Yes, that link should be to the "C" version of Cheetah. If it's not working, it's most likely because your version of Python is not finding the one you just installed and, instead, is using the old version.

Here's a program that will show you which Cheetah is being used, as well as testing to make sure it is working correctly.

File cheetahtest.py:

import Cheetah.Template
print "Using the version of Cheetah at", Cheetah.Template.__file__
template="""#errorCatcher Echo
Dictionary substitution: $current['outTemp'] 
Attribute substitution: $current.outTemp"""

class Foo(object):
    def __getitem__(self, key):
        if key=="outTemp":
            return "Lookup worked"
        
f=Foo()
t=Cheetah.Template.Template(template, searchList=[{'current':f}])
print t

Assuming you put it in file cheetahtest.py, to run it just do the following:

python cheetahtest.py

It will first print the location of the version of Cheetah it is using. Compare to where you just installed Cheetah. If you don't know where the new version of Cheetah was installed, you're going to have to look around. Here's a shell command that might help you:

find /usr/lib/pyth* /usr/local/lib/pyth* -name "Cheetah*" -print

This will show both your original version of Cheetah, as well as, hopefully, your freshly installed version. Once you find it, we'll find a way of making sure it is used.

Version 2.6 of weewx has a workaround for this problem. An alpha version is available, but I don't recommend using it unless you are very experienced. The release version should come out in a week or two.

-tk


--

Florian Roth

unread,
Jan 27, 2014, 5:29:16 PM1/27/14
to weewx...@googlegroups.com
Am Sonntag, 26. Januar 2014 14:53:26 UTC+1 schrieb Tom Keffer:
python cheetahtest.py

Using the version of Cheetah at /opt/local/lib/python2.5/site-packages/Cheetah-2.4.4-py2.5-linux-armv5tel.egg/Cheetah/Template.pyc
/opt/local/lib/python2.5/site-packages/Cheetah-2.4.4-py2.5-linux-armv5tel.egg/Cheetah/Compiler.py:1509: UserWarning:

You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option as it is painfully slow with the Python version of NameMapper. You should get a copy of Cheetah with the compiled C version of NameMapper.
  "\nYou don't have the C version of NameMapper installed! "
Dictionary substitution: Lookup worked
Attribute substitution: $current.outTemp

find /usr/lib/pyth* /usr/local/lib/pyth* -name "Cheetah*" -print
 
# find / -name "Cheetah"

/share/HDA_DATA/.qpkg/Optware/local/lib/python2.7/site-packages/Cheetah
/share/HDA_DATA/.qpkg/Optware/local/lib/python2.7/site-packages/Cheetah-2.4.4-py2.7-linux-armv5tel.egg/Cheetah
/share/HDA_DATA/.qpkg/Optware/local/lib/python2.5/site-packages/Cheetah-2.4.4-py2.5-linux-armv5tel.egg/Cheetah
/share/HDA_DATA/.qpkg/Optware/lib/python2.5/site-packages/Cheetah


This will show both your original version of Cheetah, as well as, hopefully, your freshly installed version. Once you find it, we'll find a way of making sure it is used.

I'm curious about the next steps :-)

Version 2.6 of weewx has a workaround for this problem. An alpha version is available, but I don't recommend using it unless you are very experienced. The release version should come out in a week or two.

Oh, great!

Thanks!

Felix 
 

Thomas Keffer

unread,
Jan 28, 2014, 9:41:04 AM1/28/14
to weewx-user
It looks like you installed the new version of Cheetah in a different place than where Python is looking. To add the new place, there are several approaches, but the simple is to set the environment variable PYTHONPATH

export PYTHONPATH=/usr/local/lib/python2.7/site-packages

You'll want to make sure this environment variable is set whenever your run weewx.

This is assuming that your system has a symbolic link from /share/HDA_DATA/.qpkg/Optware to /usr. If not, you should set one.

-tk


--
Reply all
Reply to author
Forward
0 new messages