Cambio de versión de weewx

182 views
Skip to first unread message

jose riaño

unread,
Aug 20, 2021, 11:19:50 AM8/20/21
to weewx-user
al cambiar mi versión o reinstalar   se me puso la versión 4.5.1 pero cuando quiero arrancar el sistema me sale esto:

Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 495, in add_value
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****      self[obs_type].addHiLo(val, record['dateTime'])
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 168, in addHiLo
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****      val = to_float(val)
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1276, in to_float
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****      return float(x) if x is not None else None
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****  ValueError: could not convert string to float:
Aug 20 10:04:16 raspberrypi weewx[1514] CRITICAL __main__:     ****  Exiting. 


no encuentro el error o que debo hacer por favor me ayudan 

Tom Keffer

unread,
Aug 20, 2021, 11:26:00 AM8/20/21
to weewx-user
You did not show very much of the log, so it is difficult to determine what happened.

My best guess is that somewhere in your database you have a string where you should have a number.

Did you edit the database?

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/79fe0a4e-6c0c-43b4-9244-77ed14330e8cn%40googlegroups.com.

jose riaño

unread,
Aug 20, 2021, 11:56:12 AM8/20/21
to weewx-user

no señor nada solo que me averió la Rpi y al cargar todo de nuevo y arrancar me sale eso ....

Rainer Lang

unread,
Aug 20, 2021, 12:32:08 PM8/20/21
to weewx...@googlegroups.com, Rainer Lang

¿puede poner DEBUG = 1 en weewx.conf y enviarnos todo el syslog desde el inicio de weewx, no sólo un fragmento, por favor?

Can you please set DEBUG = 1 in weewx.conf and send aus the whole syslog from the weewx launch on and not only a fragment !?

algo parecido a lo siguiente ((tendrá un driver) diferente, un mapa de sensores diferente, etc.)

something that looks like this (you will have a different driver, a different sensor map, etc. :

**************************** example ********************************

Aug 20 18:28:43 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Aug 20 18:28:43 raspberrypi weewx[25009] INFO __main__: Initializing weewx version 4.5.1
Aug 20 18:28:44 raspberrypi weewx[25009] INFO __main__: Using Python 3.7.3 (default, Jan 22 2021, 20:04:44) #012[GCC 8.3.0]
Aug 20 18:28:44 raspberrypi weewx[25009] INFO __main__: Platform Linux-5.10.52-v7l+-armv7l-with-debian-10.10
Aug 20 18:28:44 raspberrypi weewx[25009] INFO __main__: Locale is 'en_US.UTF-8'
Aug 20 18:28:44 raspberrypi weewx[25009] INFO __main__: PID file is /var/run/weewx.pid
Aug 20 18:28:44 raspberrypi weewx[25013] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Aug 20 18:28:44 raspberrypi weewx[25013] INFO __main__: Debug is 0
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Loading station type Interceptor (user.interceptor)
Aug 20 18:28:44 raspberrypi weewx[24997]: Starting weewx weather system: weewx.
Aug 20 18:28:44 raspberrypi systemd[1]: Started LSB: weewx weather system.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: driver version is 0.60
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: device type: ecowitt-client
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: hardware name: Froggit WH4000SE/Ecowitt WH2320E
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: mode is listen
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: listen on :8000
Aug 20 18:28:44 raspberrypi weewx[25013] INFO user.interceptor: sensor map: {'pressure': 'pressure', 'barometer': 'barometer', 'outHumidity': 'humidity_out', 'inHumidity': 'humidity_in', 'outTemp': 'temperature_out', 'inTemp': 'temperature_in', 'windSpeed': 'wind_speed', 'windGust': 'wind_gust', 'windDir': 'wind_dir', 'windGustDir': 'wind_gust_dir', 'radiation': 'solar_radiation', 'dewpoint': 'dewpoint', 'windchill': 'windchill', 'rain': 'rain', 'rainRate': 'rain_rate', 'UV': 'uv', 'txBatteryStatus': 'battery', 'extraTemp1': 'temperature_1', 'extraTemp2': 'temperature_2', 'extraTemp3': 'temperature_3', 'extraHumid1': 'humidity_1', 'extraHumid2': 'humidity_2', 'soilTemp1': 'soil_temperature_1', 'soilTemp2': 'soil_temperature_2', 'soilMoist1': 'soil_moisture_1', 'soilMoist2': 'soil_moisture_2', 'soilMoist3': 'soil_moisture_3', 'soilMoist4': 'soil_moisture_4', 'leafWet1': 'leafwetness_1', 'leafWet2': 'leafwetness_2', 'pm2_5': 'pm2_5', 'extraTemp4': 'temperature_4', 'extraTemp5': 'temperature_5', 'extraTemp6': 'temperature_6', 'extraTemp7': 'temperature_7', 'extraTemp8': 'temperature_8', 'extraHumid3': 'humidity_3', 'extraHumid4': 'humidity_4', 'extraHumid5': 'humidity_5', 'extraHumid6': 'humidity_6', 'extraHumid7': 'humidity_7', 'extraHumid8': 'humidity_8', 'soilTemp3': 'soil_temperature_3', 'soilTemp4': 'soil_temperature_4'}
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: StdConvert target unit is 0x1
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Archive will use data binding wx_binding
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Record generation will be attempted in 'hardware'
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Using archive interval of 60 seconds (specified in weewx configuration)
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: StationRegistry: Station will be registered.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: Wunderground: Posting not enabled.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: PWSweather: Posting not enabled.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: CWOP: Posting not enabled.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: WOW: Posting not enabled.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.restx: AWEKAS: Posting not enabled.
Aug 20 18:28:44 raspberrypi weewx[25013] INFO __main__: Starting up weewx version 4.5.1
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx-IC.sdb'
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.manager: Starting backfill of daily summaries
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.manager: Daily summaries up to date
Aug 20 18:28:44 raspberrypi weewx[25013] INFO weewx.engine: Starting main packet loop.

Rainer Lang

unread,
Aug 20, 2021, 1:50:45 PM8/20/21
to weewx-user

we had a similar case here in the forum earlier this year:
"
After further investigation, it turned out to be due to an errant record in the DB. The record’s “ET” field was blank; neither NULL nor a valid float. Not sure how it got there, but using an sqlite editor and setting it back to NULL did the trick. "

It would be worth checking the database for such a record using a SQlite Database browser. A field in the database that is usually filled by weewx with either a value or NULL but is "empty".

tuvimos un caso similar aquí en el foro a principios de este año:
"Tras una investigación más profunda, resultó ser debido a un registro erróneo en la base de datos. El campo "ET" del registro estaba en blanco; ni NULL ni un flotador válido. No estoy seguro de cómo llegó allí, pero usando un editor de sqlite y poniéndolo de nuevo en NULL hizo el truco. "

Valdría la pena revisar la base de datos en busca de ese registro utilizando un navegador de bases de datos SQlite. Un campo en la base de datos que normalmente es llenado por weewx con un valor o NULL pero que está "vacío".

Traducción realizada con la versión gratuita del traductor www.DeepL.com/Translator

-------- Forwarded Message --------
Subject: [weewx-user] Cambio de versión de weewx
Date: Fri, 20 Aug 2021 18:32:02 +0200
From: Rainer Lang <lang....@googlemail.com>
To: weewx...@googlegroups.com
CC: Rainer Lang <rai...@rainer-lang.eu>

Tom Keffer

unread,
Aug 20, 2021, 2:22:59 PM8/20/21
to weewx-user
Or, use the tool wee_database. It has a specific option "--check-strings" for doing this:

wee_database --check-strings

if you find any, you can use the option --fix-strings to fix them:

wee_database --fix-strings

-tk

jose riaño

unread,
Aug 25, 2021, 1:11:38 PM8/25/21
to weewx-user
los comandos  wee_database --check-strings y  wee_database --fix-strings
me dan este relusltado 

 File "/usr/share/weewx/wee_database", line 1138, in <module>
    main()
  File "/usr/share/weewx/wee_database", line 230, in main
    check_strings(config_dict, db_binding, options, fix=True)
  File "/usr/share/weewx/wee_database", line 913, in check_strings
    with weewx.manager.open_manager_with_config(config_dict, db_binding) as dbmanager:
  File "/usr/share/weewx/weewx/manager.py", line 746, in open_manager_with_config
    return open_manager(manager_dict, initialize)
  File "/usr/share/weewx/weewx/manager.py", line 737, in open_manager
    manager_dict['table_name'])
  File "/usr/share/weewx/weewx/manager.py", line 132, in open
    dbmanager = cls(connection, table_name)
  File "/usr/share/weewx/weewx/manager.py", line 881, in __init__
    self.patch_sums()
  File "/usr/share/weewx/weewx/manager.py", line 1344, in patch_sums
    self.recalculate_weights(start_d=datetime.date(2020, 6, 1))
  File "/usr/share/weewx/weewx/manager.py", line 1262, in recalculate_weights
    self._do_tranche(mark_d, end_of_tranche_d, weight_fn, progress_fn)
  File "/usr/share/weewx/weewx/manager.py", line 1301, in _do_tranche
    day_accum.addRecord(rec, weight=weight)
  File "/usr/share/weewx/weewx/accum.py", line 436, in addRecord
    func(self, record, obs_type, add_hilo, weight)
  File "/usr/share/weewx/weewx/accum.py", line 495, in add_value
    self[obs_type].addHiLo(val, record['dateTime'])
  File "/usr/share/weewx/weewx/accum.py", line 168, in addHiLo
    val = to_float(val)
  File "/usr/share/weewx/weeutil/weeutil.py", line 1276, in to_float
    return float(x) if x is not None else None
ValueError: could not convert string to float: Chitaga


jose riaño

unread,
Aug 25, 2021, 1:12:28 PM8/25/21
to weewx-user

y este es el log mas completo

Aug 25 18:08:24 raspberrypi weewx[3531] INFO __main__: Using Python 2.7.16 (default, Oct 10 2019, 22:02:15) #012[GCC 8.3.0]
Aug 25 18:08:24 raspberrypi weewx[3531] INFO __main__: Platform Linux-5.10.17-v7+-armv7l-with-debian-10.9
Aug 25 18:08:24 raspberrypi weewx[3531] INFO __main__: Locale is 'en_GB.UTF-8'
Aug 25 18:08:24 raspberrypi weewx[3531] INFO __main__: PID file is /var/run/weewx.pid
Aug 25 18:08:24 raspberrypi weewx[3519]: Starting weewx weather system: weewx.
Aug 25 18:08:24 raspberrypi weewx[3535] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Aug 25 18:08:24 raspberrypi systemd[1]: Started LSB: weewx weather system.
Aug 25 18:08:24 raspberrypi weewx[3535] INFO __main__: Debug is 0
Aug 25 18:08:24 raspberrypi weewx[3535] INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Aug 25 18:08:24 raspberrypi weewx[3535] INFO weewx.engine: StdConvert target unit is 0x1
Aug 25 18:08:35 raspberrypi weewx[3535] INFO weewx.manager: Daily summaries at V2.0. Patching to V4.0
Aug 25 18:08:35 raspberrypi weewx[3535] INFO weewx.manager: recalculate_weights: Using database 'Estaciones'
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__: Caught unrecoverable exception:
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****  could not convert string to float: Chitaga
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****  Traceback (most recent call last):
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 151, in main
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 93, in __init__
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self.loadServices(config_dict)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self, config_dict)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/wxservices.py", line 91, in __init__
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self.db_manager = engine.db_binder.get_manager(data_binding=data_binding, initialize=True)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 584, in get_manager
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 734, in open_manager
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      manager_dict['schema'])
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 164, in open_with_create
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      dbmanager = cls(connection, table_name=table_name, schema=schema)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 881, in __init__
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self.patch_sums()
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 1344, in patch_sums
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self.recalculate_weights(start_d=datetime.date(2020, 6, 1))
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 1262, in recalculate_weights
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self._do_tranche(mark_d, end_of_tranche_d, weight_fn, progress_fn)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 1301, in _do_tranche
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      day_accum.addRecord(rec, weight=weight)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 436, in addRecord
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      func(self, record, obs_type, add_hilo, weight)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 495, in add_value
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      self[obs_type].addHiLo(val, record['dateTime'])
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/accum.py", line 168, in addHiLo
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      val = to_float(val)
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1276, in to_float
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****      return float(x) if x is not None else None
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****  ValueError: could not convert string to float: Chitaga
Aug 25 18:08:36 raspberrypi weewx[3535] CRITICAL __main__:     ****  Exiting.

gjr80

unread,
Aug 25, 2021, 7:59:09 PM8/25/21
to weewx-user
Hola, perdón por mi google español, intentaré ayudarte.  ¿Podría detener WeeWX (si se está ejecutando) y ejecutar el comando wee_database —check-strings?  Luego, capture la salida de la consola que muestre tanto el comando exacto que ingresó como la salida resultante en la consola.  Publique el texto capturado aquí.

Hi, pardon my google Spanish, I will try to help you. Could you stop WeeWX (if it is running) and issue the wee_database —check-strings command. Then capture the console output showing both the exact command you entered and the resulting output to the console. Post the captured text back here. 

Gary

gjr80

unread,
Aug 26, 2021, 5:11:05 AM8/26/21
to weewx-user
En realidad, ignore mi publicación anterior, he pasado más tiempo mirando un poco más de cerca su registro y creo que veo la causa.  Déjame intentar encontrar una solución.

Actually, please ignore my previous post, I've spent some more time looking a little closer at your log and I think I see the cause.  Let me try to find a solution.

Gary

gjr80

unread,
Aug 29, 2021, 1:42:33 AM8/29/21
to weewx-user
Mis disculpas, esto tomó un poco más de tiempo de lo que esperaba. El problema es que su base de datos requiere un parche a la última versión, pero tiene lo que WeeWX llama 'null strings' en uno o más campos. El parche no puede ocurrir con las 'null strings' en la base de datos, mientras que wee_database puede arreglar las 'null strings', no puede arreglar las 'null strings' hasta que la base de datos esté parcheada. Un escenario de huevo y gallina.

Creo que tengo el problema solucionado ahora para que pueda ejecutar wee_database para corregir las 'null strings' sin errores. Luego, cuando se inicie WeeWX, su base de datos se actualizará al nivel actual. Con este fin, he adjuntado dos archivos para que los descargue y reemplace los archivos correspondientes en su máquina WeeWX. Estos archivos se basan en su uso de WeeWX v4.5.1 según su publicación original. Si este no es el caso o si ha modificado alguno de los archivos fuente de WeeWX, no instale estos archivos y avíseme - si usa estos archivos en otra instalación que no sea WeeWX 4.5.1, pueden suceder cosas malas. Ahora que he terminado la advertencia, para solucionar su problema:

1. detenga WeeWX y haga una copia de seguridad de su base de datos, debería estar en el directorio /var/lib/weewx

2. cambie el nombre de sus archivos manager.py y wee_database existentes de la siguiente manera:

$ sudo mv /usr/share/weewx/weewx/manager.py /usr/share/weewx/weewx/manager_orig.py
$ sudo mv /usr/share/weewx/wee_database /usr/share/weewx/wee_database_orig

3. descargue los archivos adjuntos y guarde manager.py en el directorio /usr/share/weewx/weewx y guarde wee_database en el directorio /usr/share/weewx

4. ejecute wee_database --check-strings/wee_database --fix-strings según sea necesario para corregir cualquier 'null strings'

5. Una vez que se hayan solucionado las 'null strings', reinicie WeeWX como de costumbre y controle su registro en busca de errores. Debería ver una entrada en su registro durante el inicio con respecto a la actualización de su base de datos.

Por favor, avíseme aquí si encuentra algún error.

Incluiré esta solución en la v4.6.0 que aún no se ha publicado, dado que ahora ejecutará una versión híbrida v4.5.1, le sugiero que actualice a WeeWX v4.6.0 cuando se lance.

Gary

My apologies this took a little longer to fix than I hoped. The problem is that your database requires patching to the latest version but it has what WeeWX calls 'null strings' in one or more fields. The patching cannot occur with the 'null strings' in the database, whilst wee_database can fix the 'null strings' it cannot do so until the database is patched. A chicken and egg scenario.

I think I have the issue fixed now so that you can run wee_database to fix the 'null strings' without error. Then when WeeWX is next started your database will be patched to the current level. To this end I have attached two files for you to download and replace the corresponding files on your WeeWX machine. These files are based on you using WeeWX v4.5.1 as per your original post. If this is not the case or you have modified any of the WeeWX source files do not install these files and let me know - if you use these files on other than a WeeWX 4.5.1 install bad things may happen. Now that I have the warning over, to fix your issue:

1. stop WeeWX and make a backup copy of your database, it should be in the /var/lib/weewx directory

2. rename your existing manager.py and wee_database files as follows:

$ sudo mv /usr/share/weewx/weewx/manager.py /usr/share/weewx/weewx/manager_orig.py
$ sudo mv /usr/share/weewx/wee_database /usr/share/weewx/wee_database_orig


3. download the attached files and save manager.py to the /usr/share/weewx/weewx directory and save wee_database to the /usr/share/weewx directory

4. run wee_database --check-strings/wee_database --fix-strings as required to fix any 'null strings'

5. once the 'null strings' have been fixed restart WeeWX as normal and monitor your log for errors. You should see an entry in your log during startup regarding your database being patched.

Please let me know here if you encounter any errors.

I will include this fix in the yet to be released v4.6.0, given you will now be running a hybrid v4.5.1 I suggest you upgrade to WeeWX v4.6.0 when it is released.
wee_database
manager.py
Reply all
Reply to author
Forward
0 new messages