Autor Tema: Weewx no genera archivo anual  (Leído 1586 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado pachu

  • Full Member
  • ***
  • Mensajes: 136
    • Ver Perfil
    • www.meteolamadrid.es
  • Estación: Lamadrid (ESCTB3900000039593F)
Weewx no genera archivo anual
« en: 05 de Octubre del 2021, 18:39:06 pm »
Hola
 Me he dado cuenta que desde Junio,Weewx no me genera el archivo anual.
He accedido a la dirección /var/www/html/weewx/NOAA y borrado el archivo 2021.txt,reiniciado la raspi y no lo genera de nuevo.También la plantilla /etc/weewx/skins/neowx/NOAA-YYY.txt.tmpl la he metido de nuevo de una copia de seguridad y nada,en camio los meses sin problema  ???

Saludos

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Weewx no genera archivo anual
« Respuesta #1 en: 05 de Octubre del 2021, 19:55:07 pm »
Hola pachu.

Has tocado algo del archivo skin.conf o de la plantilla del año NOAA/NOAA-YYYY.txt.tmpl ?? Mira el log de weewx por si sale algún fallo.

En el skin.conf deberás de tener la línea:

[[SummaryByYear]]
        # Reports that summarize "by year"
        [[[NOAA_year]]]
            encoding = strict_ascii
            template = NOAA/NOAA-YYYY.txt.tmpl

y mirar que la plantilla esté efectivamente allí y no esté corrupta.


Archena, Valle de Ricote (Murcia). 120 msnm. 19.622 hab.
Davis Vantage Pro2 Plus

www.meteoarchena.es

Desconectado pachu

  • Full Member
  • ***
  • Mensajes: 136
    • Ver Perfil
    • www.meteolamadrid.es
  • Estación: Lamadrid (ESCTB3900000039593F)
Re:Weewx no genera archivo anual
« Respuesta #2 en: 06 de Octubre del 2021, 19:49:18 pm »
Hola

No he tocado nada del skin y la plantilla está en su sitio.
Si veo en el log error pero no consigo descifrar a que se refiere exactamente el problema de la plantilla NOOA.

Saludos y gracias :)



Código: [Seleccionar]
Oct  6 19:40:14 raspberrypi weewx[1174] INFO weewx.manager: Added record 2021-10-06 19:40:00 CEST (1633542000) to database 'weewx.sdb'
Oct  6 19:40:14 raspberrypi weewx[1174] INFO weewx.manager: Added record 2021-10-06 19:40:00 CEST (1633542000) to daily summary in 'weewx.sdb'
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: Generate failed with exception '<type 'exceptions.ValueError'>'
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx/NOAA/NOAA-YYYY.txt.tmpl
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: invalid literal for int() with base 10: ''
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 719, in respond
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 281, in __errorCatcher23
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", line 347, in __getattr__
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      return self._do_query(aggregate_type)
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", line 364, in _do_query
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      db_manager, val=val, **self.option_dict)
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 102, in get_aggregate
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      **option_dict)
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/xtypes.py", line 458, in get_aggregate
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      value = int(row[0])
Oct  6 19:40:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****  ValueError: invalid literal for int() with base 10: ''
Oct  6 19:40:18 raspberrypi weewx[1174] INFO weewx.cheetahgenerator: Generated 9 files for report SeasonsReport in 1.76 seconds
Oct  6 19:40:53 raspberrypi weewx[1174] INFO weewx.imagegenerator: Generated 12 images for report SeasonsReport in 35.65 seconds
Oct  6 19:40:53 raspberrypi weewx[1174] INFO weewx.reportengine: Copied 17 files to /var/www/html/weewx
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'socket.error'>': [Errno 111] Conexión rehusada
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 330, in run
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      n = ftp_data.run()
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weeutil/ftpupload.py", line 163, in run
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      ftp_server.storbinary(stor_cmd, fd)
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/lib/python2.7/ftplib.py", line 479, in storbinary
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      conn = self.transfercmd(cmd, rest)
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/lib/python2.7/ftplib.py", line 378, in transfercmd
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      return self.ntransfercmd(cmd, rest)[0]
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/lib/python2.7/ftplib.py", line 337, in ntransfercmd
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      conn = socket.create_connection((host, port), self.timeout)
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****    File "/usr/lib/python2.7/socket.py", line 575, in create_connection
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****      raise err
Oct  6 19:40:58 raspberrypi weewx[1174] ERROR weewx.reportengine:         ****  error: [Errno 111] Conexión rehusada

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Weewx no genera archivo anual
« Respuesta #3 en: 06 de Octubre del 2021, 23:26:01 pm »
El último error es este:

ERROR weewx.cheetahgenerator: ****  ValueError: invalid literal for int() with base 10: ''

Ese error lo da Python si encuentra un string al convertirlo a número. Por ejemplo:

>>> a=''
>>> print(int(a))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: ''


Si en la consola de Python le damos a la variable a (una inventada) el valor vacío de string a = '' al convertirlo a número suelta ese error por lo que sospecho que se habrá quedado algún valor así en la BBDD.

Detén weewx y ejecuta este comando:

sudo wee_database --check-strings

y cuando termine este otro:

sudo wee_database --fix-strings

No sé si te notificará de los errores que haya corregido. Después pon weewx en marcha a ver si se ha solucionado el problema.



Archena, Valle de Ricote (Murcia). 120 msnm. 19.622 hab.
Davis Vantage Pro2 Plus

www.meteoarchena.es

Desconectado pachu

  • Full Member
  • ***
  • Mensajes: 136
    • Ver Perfil
    • www.meteolamadrid.es
  • Estación: Lamadrid (ESCTB3900000039593F)
Re:Weewx no genera archivo anual
« Respuesta #4 en: 12 de Octubre del 2021, 11:05:33 am »
Hola
Creo que efectivamente el error viene de alguna línea dela BBDD,hace unos meses me dió guerra  :;

Código: [Seleccionar]
root@raspberrypi:~# sudo /etc/init.d/weewx stop
[ ok ] Stopping weewx (via systemctl): weewx.service.
root@raspberrypi:~# sudo wee_database --check-strings
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Preparing Null String Fix, this may take a while...
 Checking record: 719283; Timestamp: 2021-10-12 10:40:00 CEST (1634028000)
No null strings found.
Completed Null String Check in 179.66 seconds.
root@raspberrypi:~# sudo wee_database --fix-strings
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Preparing Null String Fix, this may take a while...
 Checking record: 719283; Timestamp: 2021-10-12 10:40:00 CEST (1634028000)
No null strings found.
Applied Null String Fix in 179.80 seconds.
root@raspberrypi:~# sudo /etc/init.d/weewx start
[ ok ] Starting weewx (via systemctl): weewx.service.
root@raspberrypi:~# sudo tail -f /var/log/weewx.log
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/neowx/NOAA/NOAA-YYYY.txt.tmpl
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: **** Reason: invalid literal for int() with base 10: ''
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 719, in respond
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "_etc_weewx_skins_neowx_NOAA_NOAA_YYYY_txt_tmpl.py", line 281, in __errorCatcher23
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "<string>", line 1, in <module>
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", line 347, in __getattr__
Oct  7 10:45:17 raspberrypi weewx[1174] ERROR weewx.cheetahgenerator: ****      return se

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Weewx no genera archivo anual
« Respuesta #5 en: 12 de Octubre del 2021, 11:22:22 am »
No ha encontrado ningún string vacío.

Adjunta la plantilla /etc/weewx/skins/neowx/NOAA/NOAA-YYYY.txt.tmpl y también en un zip una copia de la BBDD.

Así pruebo y a ver si veo algo raro.



Archena, Valle de Ricote (Murcia). 120 msnm. 19.622 hab.
Davis Vantage Pro2 Plus

www.meteoarchena.es

Desconectado pachu

  • Full Member
  • ***
  • Mensajes: 136
    • Ver Perfil
    • www.meteolamadrid.es
  • Estación: Lamadrid (ESCTB3900000039593F)
Re:Weewx no genera archivo anual
« Respuesta #6 en: 13 de Octubre del 2021, 11:30:58 am »
Hola

Te adjunto la plantilla y por drive la BBDD ya que por tamaño no me deja adjuntarla...

https://drive.google.com/file/d/1fg4Vn-XB8LdBYykj011CEOo1pvnpcURk/view?usp=sharing

Muchas gracias

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Weewx no genera archivo anual
« Respuesta #7 en: 14 de Octubre del 2021, 11:37:53 am »
Bueno, te explico.... tienes períodos de falta de datos, sobre todo en 2020 y a principios de este año, por lo que puede que hayan diarios de la tabla que estén en blanco o así.

wee_database tiene argumentos para comprobar la BBDD pero algunos de ellos como los que comprueban la existencia de campos en blanco lo hacen solo sobre la tabla archive y no sobre los diarios.

Lo único que me ha funcionado probando para que genere el informe de este año es:

sudo wee_database --drop-daily

y después:

sudo wee_database --rebuild-daily

Básicamente la primera orden quita los diarios de la tabla y la segunda los reconstruye a partir de la tabla archive.

Lo que puede suceder es que al hacerlo así, si has cambiado valores en los diarios a mano como acumulados de lluvia de un día o la racha máxima etc etc no salga igual ya que como digo toma los datos de la tabla archive (donde graba los datos cada 5 minutos en tu caso) y si no están ahí pues no los pondrá.

Haz copia de la BBDD antes de nada y si no tocas diarios de la tabla puede que quede bien.

Para regenerar los informes bórralos de /var/www/html/weewx/tuskin/NOAA
En la ruta he puesto tuskin porque no sé si tendrá el nombre de neowx o no, lo importante es que sea el contenido de la carpeta NOAA. Una vez borrados weewx los generará. Si quieres hacerlo rápido y no esperar a cuando los genere detén weewx y ejecuta sudo wee_reports

Todo esto han sido pruebas empíricas... basadas en probar  *+* *+*

Ya dices si lo haces cómo ha ido, lo importante es que hagas copia de la BBDD por si no te gusta el resultado. Las operaciones hazlas con weewx detenido.

Saludos


Archena, Valle de Ricote (Murcia). 120 msnm. 19.622 hab.
Davis Vantage Pro2 Plus

www.meteoarchena.es

Desconectado pachu

  • Full Member
  • ***
  • Mensajes: 136
    • Ver Perfil
    • www.meteolamadrid.es
  • Estación: Lamadrid (ESCTB3900000039593F)
Re:Weewx no genera archivo anual
« Respuesta #8 en: 21 de Octubre del 2021, 20:34:14 pm »
Estoy en pruebas,@jmviper no me he olvidado de tí  *+* *+*

Parece que sí se ha arreglado a falta de corregir inconsistencias,tengo que mirarlo con mas tiempo que ando bastante "liao" :;

Ya te diré con mas detalles  apla3 apla3

Muchas gracias  :aplaude1: