Autor Tema: Problemas con los reinicios de weewx  (Leído 9700 veces)

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

Desconectado jantoni

  • Hero Member
  • *****
  • Mensajes: 3.754
    • Ver Perfil
  • Estación: ESMAD2800000028522A
Re:Problemas con los reinicios de weewx
« Respuesta #15 en: 12 de Mayo del 2020, 15:03:57 pm »
Un lío, si

 *+* *+* *+* *+* *+*

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #16 en: 12 de Mayo del 2020, 15:45:16 pm »
Por probarlo, he dejado la orange pi un cuarto de hora apagada y la he vuelto a poner en marcha.
Resultado de syslog:

May 12 15:30:38 localhost systemd-time-wait-sync[280]: adjtime state 0 status 2000 time Tue 2020-05-12 13:30:38.925722 UTC
May 12 15:30:38 localhost systemd-timesyncd[344]: Synchronized to time server for the first time 162.159.200.123:123 (0.debian.pool.ntp.org).
May 12 15:30:38 localhost systemd[1]: Started Wait Until Kernel Time Synchronized.
May 12 15:30:38 localhost systemd[1]: Reached target System Time Synchronized.
May 12 15:30:38 localhost systemd[1]: Starting weewx weather system...
May 12 15:30:38 localhost systemd[1]: Started Daily man-db regeneration.
May 12 15:30:38 localhost systemd[1]: Started Clean PHP session files every 30 mins.
May 12 15:30:38 localhost systemd[1]: Started Daily apt download activities.
May 12 15:30:38 localhost systemd[1]: Started Daily apt upgrade and clean activities.
May 12 15:30:38 localhost systemd[1]: Started Daily rotation of log files.
May 12 15:30:38 localhost systemd[1]: Reached target Timers.
May 12 15:30:39 localhost systemd[1]: weewx.service: Supervising process 1220 which is not our child. We'll most likely not notice when it exits.
May 12 15:30:39 localhost systemd[1]: Started weewx weather system.

Creo que las primeras líneas lo dicen todo.

Primeramente el servicio systemd-time-wait-sync retrasa el inicio de los servicios que dependen de systemd-timesyncd para su arranque (weewx uno de ellos y el que más nos importa) y cuando está todo sincronizado incluido el kernel empieza a arrancar weewx.

De esa forma arrancando con weewx.service no tendremos el problema de ese desfase de tiempo al arrancar la raspi si ha estado horas apagada.



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

www.meteoarchena.es

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #17 en: 12 de Mayo del 2020, 20:58:09 pm »
Hola Rubén

Prueba a realizar el segundo paso para quitar el falso reloj:

https://github.com/weewx/weewx/wiki/Raspberry-Pi

$ sudo systemctl stop systemd-timesyncd
$ sudo systemctl disable systemd-timesyncd


Eso quitaría la sincronización de hora que usa la raspi.

También en el enlace al foro que hay en esa página se explica que ese servicio dependería de otro llamado systemd-time-wait-sync que esperaría a que se hubiese sincronizado la hora con el servidor NTP

Qué te pone al ejecutar sudo systemctl status systemd-time-wait-sync ??

Bien, pues este es el resultado:

Código: [Seleccionar]
pi@raspberrypi:~ $ sudo systemctl stop systemd-timesyncd
Warning: The unit file, source configuration file or drop-ins of systemd-timesyn
cd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
pi@raspberrypi:~ $ sudo systemctl disable systemd-timesyncd
Removed /etc/systemd/system/dbus-org.freedesktop.timesync1.service.
Removed /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service.
pi@raspberrypi:~ $ sudo systemctl status systemd-time-wait-sync
● systemd-time-wait-sync.service - Wait Until Kernel Time Synchronized
   Loaded: loaded (/lib/systemd/system/systemd-time-wait-sync.service; disabled; vendor preset: enab
   Active: inactive (dead)
     Docs: man:systemd-time-wait-sync.service(8)

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #18 en: 12 de Mayo del 2020, 21:06:39 pm »
Bueno, pues lo siguiente que he probado ha sido.

pi@raspberrypi:~ $ sudo systemctl start systemd-time-wait-sync
pi@raspberrypi:~ $ sudo systemctl status systemd-time-wait-sync
● systemd-time-wait-sync.service - Wait Until Kernel Time Synchronized
   Loaded: loaded (/lib/systemd/system/systemd-time-wait-sync.service; disabled; vendor preset: enab
   Active: active (exited) since Tue 2020-05-12 18:59:26 UTC; 8s ago
     Docs: man:systemd-time-wait-sync.service(8)
  Process: 17839 ExecStart=/lib/systemd/systemd-time-wait-sync (code=exited, status=0/SUCCESS)
 Main PID: 17839 (code=exited, status=0/SUCCESS)

may 12 18:59:26 raspberrypi systemd[1]: Starting Wait Until Kernel Time Synchronized...
may 12 18:59:26 raspberrypi systemd-time-wait-sync[17839]: adjtime state 0 status 2001 time Tue 2020
may 12 18:59:26 raspberrypi systemd[1]: Started Wait Until Kernel Time Synchronized.
pi@raspberrypi:~ $ date
mar may 12 18:59:42 UTC 2020

Ahora si sale como activo ese servicio, no se. Seguramente la haya liado gorda y ni me atrevo a reiniciar para probar.

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #19 en: 12 de Mayo del 2020, 22:57:03 pm »
Parece que está deshabilitado... Loaded: loaded (/lib/systemd/system/systemd-time-wait-sync.service; disabled; vendor preset: enab

Si ejecutas sudo systemctl list-unit-files | grep systemd-time-wait-sync.service te debe de salir como disabled

Para activarlo sudo systemctl enable systemd-time-wait-sync.service

Ya he dicho que todo esto es para que funcione con el sincronizador de tiempo de systemd y que no inicie weewx hasta que el sistema no esté en hora.

Los pasos ya los he puesto en mis anteriores mensajes.

Crear el archivo /etc/systemd/system/weewx.service y poner en su interior (copiar y pegar) este código:

Código: [Seleccionar]
# systemd configuration for weewx
[Unit]
Description=weewx weather system
Requires=time-sync.target
After=time-sync.target

# Uncomment the following two line if your database is written using mysql or MariaDB on the same host
#After=mysql.service
#BindsTo=mysql.service

# The following two lines  should be uncommented and used if you
# have enabled Restart=on-failure in the [Service] section below.
# StartLimitIntervalSec=100
# StartLimitBurst=5

[Service]
# The following two lines may be uncommented and used if you
# want the weewx service to automatically restart if it crashes.
# This can be particularly useful if weewx has an IP connection to the weather station
# it is monitoring, since transient network problems are quite
# common, and may cause the daemon to crash.
# Adjust timing according to the typical recovery times in your situation
#Restart=on-failure
#RestartSec=20

# See notes later in this wiki; by default weewx will run with root privileges, so
# comment out the following two lines to run weewx as root.
# User=weewx
# Group=weewx
# create a runtime directory below /run, because non-root users cannot create a file in /run itself
# This works for root as well as non-root users.
RuntimeDirectory=weewx
PIDFile=/run/weewx/weewx.pid
# setting the preserve option stops systemd deleting the PID file when weewx exits (debugging only)
# RuntimeDirectoryPreserve=yes


ExecStart=/usr/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid /etc/weewx/weewx.conf
ExecReload=/bin/kill -HUP $MAINPID
Type=forking

[Install]
WantedBy=multi-user.target

reiniciamos la carga de servicios con sudo systemctl daemon-reload

reiniciamos weewx y ya deberá salirnos que está cargado con weewx.service:

root@orangepipc:~# sudo service weewx status
● weewx.service - weewx weather system
   Loaded: loaded (/lib/systemd/system/weewx.service; enabled; vendor preset: enabled)

si es así ya podemos quitar de que se cargue con el viejo script /etc/init.d/weewx ejecutando sudo update-rc.d weewx remove

solo falta quitar ntp (sudo apt purge ntp) y configurar /etc/systemd/timesyncd.conf así:

Código: [Seleccionar]
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See timesyncd.conf(5) for details.

[Time]
NTP=0.debian.pool.ntp.org
FallbackNTP=1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
#RootDistanceMaxSec=5
#PollIntervalMinSec=32
#PollIntervalMaxSec=2048

Con esas líneas ya sincronizará la hora con los servidores NTP de debian al iniciar la raspi.

Reiniciar la raspi a ver cómo ha ido la cosa.... estado de weewx, si está funcionando es un buen síntoma  *-* *-* y ver el estado de los servicios de sincronización de systemd

sudo systemctl status systemd-time-wait-sync

sudo systemctl status systemd-timesyncd
« Última modificación: 12 de Mayo del 2020, 23:09:23 pm por jmviper »


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

www.meteoarchena.es

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #20 en: 13 de Mayo del 2020, 00:39:33 am »
Ah, no me di cuenta en tu anterior mensaje... deshabilitaste systemd-timesyncd porque yo iba por otro sitio por ahí.... lo siento... vuelve a activarlo con
sudo systemctl enable systemd-timesyncd


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

www.meteoarchena.es

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #21 en: 13 de Mayo del 2020, 17:04:47 pm »
He seguido todos los pasos hasta justo antes del punto donde me indicas de eliminar que se cargue con /etc/init.d
y eso es debido a que creo que no está funcionando bien.

pi@raspberrypi:~ $ sudo systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
     Docs: man:systemd-timesyncd.service(8)
pi@raspberrypi:~ $ sudo systemctl list-unit-files | grep systemd-time-wait-sync.service
systemd-time-wait-sync.service         disabled
pi@raspberrypi:~ $ sudo systemctl enable systemd-time-wait-sync.service
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service → /lib/systemd/system/                                                                               systemd-time-wait-sync.service.
pi@raspberrypi:~ $ sudo nano /etc/systemd/system/weewx.service
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo /etc/init.d/weewx restart
[ ok ] Restarting weewx (via systemctl): weewx.service.
pi@raspberrypi:~ $ sudo service weewx status
● weewx.service - weewx weather system
   Loaded: loaded (/etc/systemd/system/weewx.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-13 14:58:06 UTC; 12s ago
  Process: 9997 ExecStart=/usr/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid /etc/weewx/weewx.conf (code=exited, status=0/SUCCESS)
 Main PID: 10001 (python)
    Tasks: 5 (limit: 2319)
   Memory: 7.2M
   CGroup: /system.slice/weewx.service
           └─10001 python /usr/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid /etc/weewx/weewx.conf

may 13 14:58:06 raspberrypi weewx[10001]: restx: Wunderground-PWS: Data for station INIGRN7 will be posted
may 13 14:58:06 raspberrypi weewx[10001]: restx: PWSweather: Posting not enabled.
may 13 14:58:06 raspberrypi weewx[10001]: restx: CWOP: Posting not enabled.
may 13 14:58:06 raspberrypi weewx[10001]: restx: WOW: Posting not enabled.
may 13 14:58:06 raspberrypi weewx[10001]: restx: AWEKAS: Data will be uploaded for user pnsc16
may 13 14:58:06 raspberrypi weewx[10001]: restx: WeatherCloud: service version is 0.11
may 13 14:58:06 raspberrypi weewx[10001]: restx: WeatherCloud: Data will be uploaded for id=d87c7ffbe24b0539
may 13 14:58:06 raspberrypi weewx[10001]: engine: Starting up weewx version 3.9.2
may 13 14:58:07 raspberrypi weewx[10001]: engine: Clock error is 0.97 seconds (positive is fast)
may 13 14:58:07 raspberrypi weewx[10001]: engine: Starting main packet loop.

Ese disabled me mosquea y prefiero no seguir no sea que pierda el acceso a weewx .

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #22 en: 13 de Mayo del 2020, 17:35:39 pm »
No inicies ni operes ya con weewx con sudo /etc/init.d/weewx status|restart|start|stop|reload hazlo con sudo service weewx status|restart|start|stop|reload

Ese disabled puede que sea que lo tiene deshabilitado systemd pero funcionar está funcionando al haberlo reiniciado.

Ejecuta sudo systemctl enable weewx y reinicia weewx a ver qué dice ahora sudo service weewx status


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

www.meteoarchena.es

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #23 en: 13 de Mayo del 2020, 19:59:30 pm »
Pues tras finalizar los ajustes que me faltaban, por cierto,
Citar
solo falta quitar ntp (sudo apt purge ntp)
no estaba instalado.

He apagado la raspberry y como 1 minuto de espera la he vuelto a encender y este es el resultado.

pi@raspberrypi:/var/log $ sudo systemctl status systemd-time-wait-sync
● systemd-time-wait-sync.service - Wait Until Kernel Time Synchronized
   Loaded: loaded (/lib/systemd/system/systemd-time-wait-sync.service; enabled; vendor preset: enabled)
   Active: active (exited) since Wed 2020-05-13 17:43:02 UTC; 2min 58s ago
     Docs: man:systemd-time-wait-sync.service(8)
  Process: 103 ExecStart=/lib/systemd/systemd-time-wait-sync (code=exited, status=0/SUCCESS)
 Main PID: 103 (code=exited, status=0/SUCCESS)

feb 14 10:12:00 raspberrypi systemd-time-wait-sync[103]: adjtime state 5 status 40 time Thu 2019-02-14 10:11:59.759073 UTC
may 13 17:41:22 raspberrypi systemd-time-wait-sync[103]: adjtime state 5 status 40 time Wed 2020-05-13 17:41:22.968762 UTC
may 13 17:43:02 raspberrypi systemd-time-wait-sync[103]: adjtime state 0 status 2000 time Wed 2020-05-13 17:43:02.897174 UTC
may 13 17:43:02 raspberrypi systemd[1]: Started Wait Until Kernel Time Synchronized.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
pi@raspberrypi:/var/log $ sudo systemctl status systemd-timesyncd
Warning: The unit file, source configuration file or drop-ins of systemd-timesyncd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: active (running) since Wed 2020-05-13 17:41:22 UTC; 4min 54s ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 214 (systemd-timesyn)
   Status: "Synchronized to time server for the first time 162.159.200.1:123 (0.debian.pool.ntp.org)."
    Tasks: 2 (limit: 2319)
   Memory: 3.0M
   CGroup: /system.slice/systemd-timesyncd.service
           └─214 /lib/systemd/systemd-timesyncd

feb 14 10:12:03 raspberrypi systemd[1]: Starting Network Time Synchronization...
feb 14 10:12:04 raspberrypi systemd-timesyncd[214]: System clock time unset or jumped backwards, restoring from recorded timestamp: Wed 2020-05-13 17:41:22 UTC
may 13 17:41:22 raspberrypi systemd[1]: Started Network Time Synchronization.
may 13 17:43:02 raspberrypi systemd-timesyncd[214]: Synchronized to time server for the first time 162.159.200.1:123 (0.debian.pool.ntp.org).
pi@raspberrypi:/var/log $ sudo service weewx status
● weewx.service - weewx weather system
   Loaded: loaded (/etc/systemd/system/weewx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-13 17:43:03 UTC; 3min 30s ago
  Process: 419 ExecStart=/usr/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid /etc/weewx/weewx.conf (code=exited, status=0/SUCCESS)
 Main PID: 423 (python)
    Tasks: 5 (limit: 2319)
   Memory: 37.0M
   CGroup: /system.slice/weewx.service
           └─423 python /usr/bin/weewxd --daemon --pidfile=/run/weewx/weewx.pid /etc/weewx/weewx.conf

may 13 17:43:04 raspberrypi weewx[423]: engine: Starting main packet loop.
may 13 17:45:16 raspberrypi weewx[423]: manager: Added record 2020-05-13 17:45:00 UTC (1589391900) to database 'weewx.sdb'
may 13 17:45:16 raspberrypi weewx[423]: manager: Added record 2020-05-13 17:45:00 UTC (1589391900) to daily summary in 'weewx.sdb'
may 13 17:45:17 raspberrypi weewx[423]: restx: WeatherCloud: Published record 2020-05-13 17:45:00 UTC (1589391900)
may 13 17:45:17 raspberrypi weewx[423]: restx: AWEKAS: Published record 2020-05-13 17:45:00 UTC (1589391900)
may 13 17:45:18 raspberrypi weewx[423]: restx: StationRegistry: Published record 2020-05-13 17:45:00 UTC (1589391900)
may 13 17:45:18 raspberrypi weewx[423]: restx: Wunderground-PWS: Published record 2020-05-13 17:45:00 UTC (1589391900)
may 13 17:45:26 raspberrypi weewx[423]: cheetahgenerator: Generated 20 files for report StandardReport in 8.62 seconds
may 13 17:45:28 raspberrypi weewx[423]: imagegenerator: Generated 13 images for StandardReport in 2.09 seconds
may 13 17:45:28 raspberrypi weewx[423]: copygenerator: copied 9 files to /var/www/html




Y el log de weewx es este:

May 13 17:43:03 raspberrypi weewx[419]: engine: Initializing weewx version 3.9.2
May 13 17:43:03 raspberrypi weewx[419]: engine: Using Python 2.7.16 (default, Oct 10 2019, 22:02:15) #012[GCC 8.3.0]
May 13 17:43:03 raspberrypi weewx[419]: engine: Platform Linux-4.19.97-v7+-armv7l-with-debian-10.3
May 13 17:43:03 raspberrypi weewx[419]: engine: Locale is 'es_ES.UTF-8'
May 13 17:43:03 raspberrypi weewx[419]: engine: pid file is /run/weewx/weewx.pid
May 13 17:43:03 raspberrypi weewx[423]: engine: Using configuration file /etc/weewx/weewx.conf
May 13 17:43:03 raspberrypi weewx[423]: engine: Loading station type Vantage (weewx.drivers.vantage)
May 13 17:43:04 raspberrypi weewx[423]: engine: StdConvert target unit is 0x10
May 13 17:43:04 raspberrypi weewx[423]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer$
May 13 17:43:04 raspberrypi weewx[423]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
May 13 17:43:04 raspberrypi weewx[423]: engine: Archive will use data binding wx_binding
May 13 17:43:04 raspberrypi weewx[423]: engine: Record generation will be attempted in 'hardware'
May 13 17:43:04 raspberrypi weewx[423]: engine: Using archive interval of 300 seconds (specified by hardware)
May 13 17:43:04 raspberrypi weewx[423]: engine: Using binding 'wx_binding' to database 'weewx.sdb'
May 13 17:43:04 raspberrypi weewx[423]: manager: Starting backfill of daily summaries
May 13 17:43:04 raspberrypi weewx[423]: restx: StationRegistry: Station will be registered.
May 13 17:43:04 raspberrypi weewx[423]: restx: Wunderground-PWS: Data for station INIGRN7 will be posted
May 13 17:43:04 raspberrypi weewx[423]: restx: PWSweather: Posting not enabled.
May 13 17:43:04 raspberrypi weewx[423]: restx: CWOP: Posting not enabled.
May 13 17:43:04 raspberrypi weewx[423]: restx: WOW: Posting not enabled.
May 13 17:43:04 raspberrypi weewx[423]: restx: AWEKAS: Data will be uploaded for user pnsc16
May 13 17:43:04 raspberrypi weewx[423]: restx: WeatherCloud: service version is 0.11
May 13 17:43:04 raspberrypi weewx[423]: restx: WeatherCloud: Data will be uploaded for id=d87c7ffbe24b0539
May 13 17:43:04 raspberrypi weewx[423]: engine: Starting up weewx version 3.9.2
May 13 17:43:04 raspberrypi weewx[423]: engine: Clock error is 0.62 seconds (positive is fast)
May 13 17:43:04 raspberrypi weewx[423]: engine: Starting main packet loop.
May 13 17:45:16 raspberrypi weewx[423]: manager: Added record 2020-05-13 17:45:00 UTC (1589391900) to database 'weewx.sdb'
May 13 17:45:16 raspberrypi weewx[423]: manager: Added record 2020-05-13 17:45:00 UTC (1589391900) to daily summary in 'weewx.sdb'
May 13 17:45:17 raspberrypi weewx[423]: restx: WeatherCloud: Published record 2020-05-13 17:45:00 UTC (1589391900)
May 13 17:45:17 raspberrypi weewx[423]: restx: AWEKAS: Published record 2020-05-13 17:45:00 UTC (1589391900)
May 13 17:45:18 raspberrypi weewx[423]: restx: StationRegistry: Published record 2020-05-13 17:45:00 UTC (1589391900)
May 13 17:45:18 raspberrypi weewx[423]: restx: Wunderground-PWS: Published record 2020-05-13 17:45:00 UTC (1589391900)
May 13 17:45:26 raspberrypi weewx[423]: cheetahgenerator: Generated 20 files for report StandardReport in 8.62 seconds
May 13 17:45:28 raspberrypi weewx[423]: imagegenerator: Generated 13 images for StandardReport in 2.09 seconds
May 13 17:45:28 raspberrypi weewx[423]: copygenerator: copied 9 files to /var/www/html

Ya no salen los avisos de error a la hora de añadir los registros a la base de datos.

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #24 en: 13 de Mayo del 2020, 20:23:31 pm »
Pues tiene buena pinta la cosa  :)

Los tres servicios (weewx incluido) han trabajado como se esperaba...

Primero systemd-timesyncd ha sincronizado la hora con el servidor NTP de debian a las 17:41:22 UTC
Después systemd-time-wait-sync al estar sincronizada ya la raspi ha dado paso a que se iniciase weewx a las 2020-05-13 17:43:02 UTC

un segundo después weewx se ha puesto en marcha.

Ve observándolo a ver si ya no te hace ninguna pirula más  ;)

Saludos


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

www.meteoarchena.es

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #25 en: 14 de Mayo del 2020, 16:57:54 pm »
Hoy voy a clonar la tarjeta de la raspi donde está funcionando el weewx para tener una imagen completa para cuando casque, que lo hará tarde o temprano.
De esta manera, sudo dd if=/dev/mmcblk0 of=/media/sdmeteopi.img, me tarda unos 15 minutos.
Por lo tanto es una buena forma de comprobar la sincronización del reloj.
Si supera esto, no hay mas que hablar.


PD:
    Pues debo decir que todo ha ido de maravilla. Ni un solo error en la carga de weewx, y todos los registros atrasados, al final estuvo parada media hora larga, se añadieron sin problemas.
Un millón de gracias, jantoni y jmviper por vuestra ayuda.

PD2: (offtopic)
    Ahora, al hacer un ls en /home/pi me sale esto.

pi@raspberrypi:~ $ ls
'been rotated since unit was started. Log output is incomplete or unavailable.'
 copiaweewx.sh
'ince Wed 2020-05-13 17:32:09 UTC'
 meteoclimatic.php
'ource configuration file or drop-ins of systemd-timesyn cd.service changed on disk. Run systemctl daemon-reload to reload units.'
'pberrypi:~ $ sudo systemctl status systemd-time-wait-sync'
'pberrypi:~ $ sudo systemctl stop systemd-timesyncd'

Todo funciona con normalidad y un ls en cualquier otro sitio muestra perfectamente el contenido, solo falla en la carpeta pi.
He probado systemctl daemon-reload y sigue fallando.
He probado a detener y reiniciar systemd-time-wait-sync y systemd-timesyncd y nada.
Reiniciar la raspberry tampoco lo soluciona.
« Última modificación: 14 de Mayo del 2020, 18:21:48 pm por Rubendgl »

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #26 en: 14 de Mayo del 2020, 20:35:51 pm »
prueba a listar con sudo ls -la a ver qué sale


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

www.meteoarchena.es

Desconectado jantoni

  • Hero Member
  • *****
  • Mensajes: 3.754
    • Ver Perfil
  • Estación: ESMAD2800000028522A
Re:Problemas con los reinicios de weewx
« Respuesta #27 en: 14 de Mayo del 2020, 21:16:51 pm »
Pero......por lo que veo has hecho la imagen de la SD dentro de la propia SD.

Eso no se debe hacer.

Aparte de eso, ¿como vas de espacio en la SD?

Haz un

Código: [Seleccionar]
df -h

Desconectado Rubendgl

  • Jr. Member
  • **
  • Mensajes: 62
    • Ver Perfil
    • MeteoNigran
  • Estación: ESGAL3600000036350C
Re:Problemas con los reinicios de weewx
« Respuesta #28 en: 14 de Mayo del 2020, 22:38:03 pm »
prueba a listar con sudo ls -la a ver qué sale

pi@raspberrypi:~ $ ls -la
total 108
drwxr-xr-x 5 pi   pi    4096 may 13 17:36  .
drwxr-xr-x 3 root root  4096 jul 10  2019  ..
-rw------- 1 pi   pi   19562 may 14 16:20  .bash_history
-rw-r--r-- 1 pi   pi     220 jul 10  2019  .bash_logout
-rw-r--r-- 1 pi   pi    3523 jul 10  2019  .bashrc
-rw-r--r-- 1 root root 11925 may 13 17:36 'been rotated since unit was started.                                                                                                              Log output is incomplete or unavailable.'
drwx------ 3 pi   pi    4096 may  1 15:43  .config
-rwxr-xr-x 1 pi   pi     263 mar  4 17:13  copiaweewx.sh
drwx------ 3 pi   pi    4096 oct 15  2019  .gnupg
-rw-r--r-- 1 root root  1323 may 13 17:36 'ince Wed 2020-05-13 17:32:09 UTC'
drwxr-xr-x 3 pi   pi    4096 ene  6 00:16  .local
-rw-r--r-- 1 pi   pi     339 mar  9 23:02  meteoclimatic.php
-rw-r--r-- 1 root root 11925 may 12 18:55 'ource configuration file or drop-ins                                                                                                              of systemd-timesyn cd.service changed on disk. Run systemctl daemon-reload to re                                                                                                             load units.'
-rw-r--r-- 1 root root   254 may 12 18:49 'pberrypi:~ $ sudo systemctl status sy                                                                                                             stemd-time-wait-sync'
-rw-r--r-- 1 root root   254 may 12 18:55 'pberrypi:~ $ sudo systemctl stop syst                                                                                                             emd-timesyncd'
-rw-r--r-- 1 pi   pi     807 jul 10  2019  .profile
-rw-r--r-- 1 pi   pi      66 ene  6 00:16  .selected_editor
-rwxr-xr-x 1 pi   pi     292 dic 17 18:44  temp.sh

Me parece raro el resultado ya que en la carpeta pi solo tengo 2 archivos
copiaweewx.sh, que es el script que hace todos los dias la copia de la bbdd de /var/lib/weewx a /media y posteriormente la comprime
temp.sh para monitorizar la temperatura
No se de donde sale, por ejemplo meteoclimatic.php que su ubicación es /var/www/html/

Jantoni, con respecto a la imagen de la sd, la hice desde el portatil y la orden exacta es
sudo dd if=/dev/mmcblk0 of=/home/rubendgl/meteo/meteopi.iso bs=1M status=progress

pi@raspberrypi:~ $ df -h
S.ficheros     Tamaño Usados  Disp Uso% Montado en
/dev/root         15G   2,0G   12G  14% /
devtmpfs         484M      0  484M   0% /dev
tmpfs            488M      0  488M   0% /dev/shm
tmpfs            488M    31M  457M   7% /run
tmpfs            5,0M   4,0K  5,0M   1% /run/lock
tmpfs            488M      0  488M   0% /sys/fs/cgroup
/dev/mmcblk0p1   253M    53M  200M  21% /boot
tmpfs             98M      0   98M   0% /run/user/1000

Desconectado jmviper

  • Investigación
  • Hero Member
  • ******
  • Mensajes: 4.403
  • "Vortex Complex"
    • Ver Perfil
    • www.meteoarchena.es
  • Estación: Archena - ESMUR3000000030600B
Re:Problemas con los reinicios de weewx
« Respuesta #29 en: 14 de Mayo del 2020, 22:50:54 pm »
Curioso

Algo está dirigiendo la salida de comandos (stdout) y poniéndolo como nombres de archivos en /home/pi y son propiedad de root…

prueba a borrarlos ya que pueden haberse creado de alguna manera al realizar las operaciones que has hecho.

los tendrás que borrar con sudo ya que son de root

Por ejemplo para el primero ejecuta sudo rm been* para el segundo sudo rm ince* y así sucesivamente poniendo primeras letras y asterisco de comodín.

Si se vuelven a crear habrá que ver si hay algún script (algún crontab quizás) que los esté creando.



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

www.meteoarchena.es