poblabs / weewx-belchertown

A clean and modern weewx skin with real time streaming updates, forecast data and interactive charts. View it in action at BelchertownWeather.com
https://belchertownweather.com
GNU General Public License v3.0
211 stars 112 forks source link

Belchertown metric 0.8.2 #36

Closed fscwetter closed 5 years ago

fscwetter commented 5 years ago

Hello I allways get this error!What value its wrong, I try with other versions too

Jan  6 17:42:55 raspberrypi weewx[24314]: cheetahgenerator: Generated 4 files for report Highcharts_Belchertown in 11.23 seconds
Jan  6 17:42:55 raspberrypi weewx[24314]: copygenerator: copied 0 files to /var/www/html/belchertown
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: Generate failed with exception '<type 'exceptions.ValueError'>'
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Belchertown/index.html.tmpl
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: **** Reason: invalid literal for float(): 0,5
Jan  6 17:42:56 raspberrypi weewx[24314]: ****  Traceback (most recent call last):
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 330, in generate
Jan  6 17:42:56 raspberrypi weewx[24314]: ****      print >> _file, compiled_template
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Jan  6 17:42:56 raspberrypi weewx[24314]: ****      rc = getattr(self, mainMethName)()
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "_home_weewx_skins_Belchertown_index_html_tmpl.py", line 1548, in respond
Jan  6 17:42:56 raspberrypi weewx[24314]: ****  ValueError: invalid literal for float(): 0,5
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: Generate failed with exception '<type 'exceptions.ValueError'>'
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: **** Ignoring template /home/weewx/skins/Belchertown/pi/index.html.tmpl
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: **** Reason: invalid literal for float(): 0,5
Jan  6 17:42:56 raspberrypi weewx[24314]: ****  Traceback (most recent call last):
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 330, in generate
Jan  6 17:42:56 raspberrypi weewx[24314]: ****      print >> _file, compiled_template
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Jan  6 17:42:56 raspberrypi weewx[24314]: ****      rc = getattr(self, mainMethName)()
Jan  6 17:42:56 raspberrypi weewx[24314]: ****    File "_home_weewx_skins_Belchertown_pi_index_html_tmpl.py", line 1197, in respond
Jan  6 17:42:56 raspberrypi weewx[24314]: ****  ValueError: invalid literal for float(): 0,5
Jan  6 17:42:56 raspberrypi weewx[24314]: cheetahgenerator: Generated 11 files for report Belchertown in 1.59 seconds
Jan  6 17:42:56 raspberrypi weewx[24314]: copygenerator: copied 1 files to /var/www/html/belchertown
poblabs commented 5 years ago

Got it. I can't look until later tonight.

On Mon, Jan 7, 2019, 11:27 AM fscwetter notifications@github.com wrote:

weewx.zip https://github.com/poblabs/weewx-belchertown/files/2733436/weewx.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/36#issuecomment-451992720, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUsZ3X3qWioaEHHdSJozTXUGCJUeTNvks5vA3VwgaJpZM4ZygXS .

poblabs commented 5 years ago

Initial test, using your database I was able to get the skin to compile correctly.

Jan  7 20:01:05 weewx2019 wee_reports[1923]: Belchertown Extension: version 0.8.2
Jan  7 20:01:05 weewx2019 wee_reports[1923]: cheetahgenerator: Generated 13 files for report Belchertown in 0.71 seconds
Jan  7 20:01:05 weewx2019 wee_reports[1923]: copygenerator: copied 22 files to /var/www/html
Jan  7 20:01:06 weewx2019 wee_reports[1923]: cheetahgenerator: Generated 4 files for report Highcharts_Belchertown in 1.01 seconds
Jan  7 20:01:06 weewx2019 wee_reports[1923]: copygenerator: copied 0 files to /var/www/html

So I changed my locale to de_AT.UTF-8

root@weewx2019:~# env | grep LANG
LANG=de_AT.UTF-8

Re-ran the report and I got an error

Jan  7 20:07:13 weewx2019 wee_reports[2638]: Belchertown Extension: version 0.8.2
Jan  7 20:07:13 weewx2019 wee_reports[2638]: reportengine: Caught unrecoverable exception in generator weewx.cheetahgenerator.CheetahGenerator
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****  'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****  Traceback (most recent call last):
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 239, in run
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      obj.start()
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 273, in start
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      self.run()
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 158, in run
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      ngen = self.generate(gen_dict[section_name], self.gen_ts)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      ngen += self.generate(section[subsection], gen_ts)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 232, in generate
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      ngen += self.generate(section[subsection], gen_ts)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 320, in generate
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      default_binding)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 372, in _getSearchList
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      searchList += obj.get_extension_list(timespan, db_lookup)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****    File "/usr/share/weewx/user/belchertown.py", line 319, in get_extension_list
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****      at_rainiest_month = [ calendar.month_name[ int( at_rainiest_month_query[0] ) ] + ", " + at_rainiest_month_query[1], at_rainiest_month_converted ]
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Jan  7 20:07:13 weewx2019 wee_reports[2638]:         ****  Generator terminated
Jan  7 20:07:13 weewx2019 wee_reports[2638]: copygenerator: copied 22 files to /var/www/html
Jan  7 20:07:14 weewx2019 wee_reports[2638]: cheetahgenerator: Generated 4 files for report Highcharts_Belchertown in 1.02 seconds
Jan  7 20:07:14 weewx2019 wee_reports[2638]: copygenerator: copied 0 files to /var/www/html

I think this is a different error than you were seeing. Not sure why, but right now it seems there's a locale issue I'll have to look into deeper.

fscwetter commented 5 years ago

this i found and try on belchertown.py

Re: [weewx-user] Re: UnicodeDecodeError: 'ascii' codec can't decode byte Nachricht auf Deutsch übersetzen Unfortunately, I cannot replicate your problem. I used your index.html.tmpl file, and your skin.conf file, and things worked fine.

For Cheetah to recognize that a template uses UTF-8, it must have an 'encoding' directive. You have one, but for some reason it is not recognizing it. ​Why, I don't know.​

Suggestions:

1. Try eliminating the blank line at the top of index.html.tmpl between "#encoding UTF-8" and the "<!DOCTYPE..." directive. I doubt this will do anything, but we're getting desperate.

2. Start with the skin.conf and index.html.tmpl file that come with weewx and gradually add things until you have a problem.

3. Check what default encoding your python installation uses. You can do this by running the line
   python -c "import sys; print sys.getdefaultencoding()"

Mine says 'ascii', and yours should as well.

1. Try changing the default encoding used by weewx by adding the following to the top of the file user/extensions.py:
   import sys
   # Reload sys, because site.py deletes the function setdefaultencoding().
   reload(sys)
   sys.setdefaultencoding('UTF8')

If this works, it's a bit of a hack, but it might get you running. It can also break other things.

-tk get a new error

fscwetter commented 5 years ago

What locale use you I will try it

poblabs commented 5 years ago

I use en utf-8

On Mon, Jan 7, 2019, 3:47 PM fscwetter notifications@github.com wrote:

What locale use you I will try it

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/36#issuecomment-452076291, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUsZwu6rNuLu3BGlcnmWWu6ijltdznUks5vA7JsgaJpZM4ZygXS .

fscwetter commented 5 years ago

i try with en_GB.UTF-8 UTF-8 get error

Jan  7 21:43:35 raspberrypi weewx[13386]: Starting weewx weather system: weewxTraceback (most recent call last):
Jan  7 21:43:35 raspberrypi weewx[13386]:   File "/home/weewx/bin/weewxd", line 12, in <module>
Jan  7 21:43:35 raspberrypi weewx[13386]:     import user.extensions       #@UnusedImport
Jan  7 21:43:35 raspberrypi weewx[13386]:   File "/home/weewx/bin/user/extensions.py", line 18, in <module>
Jan  7 21:43:35 raspberrypi weewx[13386]:     locale.setlocale(locale.LC_ALL, '')
Jan  7 21:43:35 raspberrypi weewx[13386]:   File "/usr/lib/python2.7/locale.py", line 581, in setlocale
Jan  7 21:43:35 raspberrypi weewx[13386]:     return _setlocale(category, locale)
Jan  7 21:43:35 raspberrypi weewx[13386]: locale.Error: unsupported locale setting
Jan  7 21:43:35 raspberrypi weewx[13386]:  failed!
Jan  7 21:43:35 raspberrypi systemd[1]: weewx.service: Control process exited, code=exited status=1
Jan  7 21:43:35 raspberrypi systemd[1]: Failed to start LSB: weewx weather system.
Jan  7 21:43:35 raspberrypi systemd[1]: weewx.service: Unit entered failed state.
poblabs commented 5 years ago

Did you restart the Pi after changing locale?

I'm USA English too. But GB should work.

On Mon, Jan 7, 2019, 3:50 PM fscwetter notifications@github.com wrote:

i try with en_GB.UTF-8 UTF-8 get error

Jan 7 21:43:35 raspberrypi weewx[13386]: Starting weewx weather system: weewxTraceback (most recent call last): Jan 7 21:43:35 raspberrypi weewx[13386]: File "/home/weewx/bin/weewxd", line 12, in Jan 7 21:43:35 raspberrypi weewx[13386]: import user.extensions

@UnusedImport

Jan 7 21:43:35 raspberrypi weewx[13386]: File "/home/weewx/bin/user/extensions.py", line 18, in Jan 7 21:43:35 raspberrypi weewx[13386]: locale.setlocale(locale.LC_ALL, '') Jan 7 21:43:35 raspberrypi weewx[13386]: File "/usr/lib/python2.7/locale.py", line 581, in setlocale Jan 7 21:43:35 raspberrypi weewx[13386]: return _setlocale(category, locale) Jan 7 21:43:35 raspberrypi weewx[13386]: locale.Error: unsupported locale setting Jan 7 21:43:35 raspberrypi weewx[13386]: failed! Jan 7 21:43:35 raspberrypi systemd[1]: weewx.service: Control process exited, code=exited status=1 Jan 7 21:43:35 raspberrypi systemd[1]: Failed to start LSB: weewx weather system. Jan 7 21:43:35 raspberrypi systemd[1]: weewx.service: Unit entered failed state.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/poblabs/weewx-belchertown/issues/36#issuecomment-452077043, or mute the thread https://github.com/notifications/unsubscribe-auth/ADUsZ9ayJigYSbE8O9ApJvx4Wcl0-0Koks5vA7MBgaJpZM4ZygXS .

fscwetter commented 5 years ago
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.

and

pi@raspberrypi:~ $ sudo /etc/init.d/weewx restart
[....] Restarting weewx (via systemctl): weewx.serviceJob for weewx.service failed because the control process exited with error code.
See "systemctl status weewx.service" and "journalctl -xe" for details.
 failed!
sgrayban commented 5 years ago

Try en_US.UTF8 and set it as the default/

dpkg-reconfigure locales

sgrayban commented 5 years ago

His Rpi is messed up. someplace his LANG isn't getting set correctly and causing python to revolt.

sgrayban commented 5 years ago

@fscwetter are you doing root commands as root or are you using sudo ? This makes a difference on Rpi.

fscwetter commented 5 years ago

reboot works

Jan  7 22:00:18 raspberrypi weewx[685]: manager: Added record 2019-01-07 22:00:00 CET (1546894800) to database 'weewx.sdb'
Jan  7 22:00:18 raspberrypi weewx[685]: manager: Added record 2019-01-07 22:00:00 CET (1546894800) to daily summary in 'weewx.sdb'
Jan  7 22:00:23 raspberrypi weewx[685]: cheetahgenerator: Generated 12 files for report Newskin in 1.24 seconds
Jan  7 22:00:29 raspberrypi weewx[685]: imagegenerator: Generated 30 images for Newskin in 5.92 seconds
Jan  7 22:00:29 raspberrypi weewx[685]: copygenerator: copied 0 files to /var/www/html
Jan  7 22:00:40 raspberrypi weewx[685]: cheetahgenerator: Generated 4 files for report Highcharts_Belchertown in 10.28 seconds
Jan  7 22:00:40 raspberrypi weewx[685]: copygenerator: copied 0 files to /var/www/html/belchertown
Jan  7 22:00:41 raspberrypi weewx[685]: cheetahgenerator: Generated 13 files for report Belchertown in 1.53 seconds
Jan  7 22:00:41 raspberrypi weewx[685]: copygenerator: copied 1 files to /var/www/html/belchertown
Jan  7 22:00:57 raspberrypi weewx[685]: ftpgenerator: ftp'd 75 files in 15.72 seconds
sgrayban commented 5 years ago

YES !!!!!!!!!!!!!!!!!!!!!!

sgrayban commented 5 years ago

So add de back in locales but make en_US.UTF-8 the default that way German characters will still be allowed.

fscwetter commented 5 years ago

great

Jan  7 22:09:28 raspberrypi weewx[799]: manager: Added record 2019-01-07 22:09:00 CET (1546895340) to database 'weewx.sdb'
Jan  7 22:09:28 raspberrypi weewx[799]: manager: Added record 2019-01-07 22:09:00 CET (1546895340) to daily summary in 'weewx.sdb'
Jan  7 22:09:55 raspberrypi weewx[799]: cheetahgenerator: Generated 25 files for report Newskin in 13.27 seconds
Jan  7 22:10:15 raspberrypi weewx[799]: imagegenerator: Generated 61 images for Newskin in 20.44 seconds
Jan  7 22:10:15 raspberrypi weewx[799]: copygenerator: copied 3 files to /var/www/html
Jan  7 22:10:26 raspberrypi weewx[799]: cheetahgenerator: Generated 4 files for report Highcharts_Belchertown in 11.27 seconds
Jan  7 22:10:26 raspberrypi weewx[799]: copygenerator: copied 0 files to /var/www/html/belchertown
Jan  7 22:10:27 raspberrypi weewx[799]: Belchertown Extension: version 0.8.2
Jan  7 22:10:47 raspberrypi weewx[799]: cheetahgenerator: Generated 26 files for report Belchertown in 20.32 seconds
Jan  7 22:10:47 raspberrypi weewx[799]: copygenerator: copied 22 files to /var/www/html/belchertown
Jan  7 22:11:26 raspberrypi weewx[799]: ftpgenerator: ftp'd 229 files in 39.59 seconds
fscwetter commented 5 years ago

missing graphic elements

http://scharfeseckgleitschirm.club/belchertown/

sgrayban commented 5 years ago

you root ulr isn't set correctly <a href="http://your_full_website_url/">

sgrayban commented 5 years ago
    [[[Extras]]]
        belchertown_root_url = http://scharfeseckgleitschirm.club/belchertown/
sgrayban commented 5 years ago

make sure you edit the EXTRAS settings under [[Belchertown]]

fscwetter commented 5 years ago

yes

fscwetter commented 5 years ago

thanks its late here I will look tomorow

poblabs commented 5 years ago

Make sure to update all skins settings in weewx.conf.

See the readme on this repo on how.

When I release 0.8.3 it will delete your skin.conf

Which means your customization in skin.conf will be deleted.

fscwetter commented 5 years ago

Thanks to Pat O'Brien and Scott Grayban I will close it