Software > WeeWX
Belchertown Skin
jantoni:
Luego miro mi instalación.
Desde el iPad es de masoquistas acceder en remoto a otro ordenador
*+* *+* *+* *+*
jantoni:
De todos modos, acuérdate de mirar siempre el log.
Es de gran ayuda
Samal:
--- Cita de: jantoni en 08 de Marzo de 2021, 14:38:58 ---De todos modos, acuérdate de mirar siempre el log.
Es de gran ayuda
--- Fin de la cita ---
He seguido estas instrucciones:
--- Código: ---El log de Weewx se mezcla con el del sistema operativo. ¿Puedo tener un log individual para Weewx?
Puedes....y casi debes.
Por defecto, weewx vuelca los datos en varios ficheros de log. Digamos que el que nos interesa es /var/log/syslog
Pero esto tiene un inconveniente. Los datos de Weewx se van a mezclar con otro montón de lineas de log que, para este caso, no nos interesa.
Para cambiar la configuración y que escriba en un fichero aparte (por ejemplo /var/log/weewx.log) seguiremos los siguientes pasos:
En un editor de texto, por ejemplo nano, que es uno de los programa más útiles del mundo mundial.
sudo nano /etc/rsyslog.d/99-weewx.conf
Una vez dentro del editor, insertamos estas lineas:
:programname,startswith,"weewx" /var/log/weewx.log
:programname,startswith,"weewx" ~
Para grabar los cambios y salir de nano, pulsaremos CTRL-X, nos preguntará si queremos escribir los cambios, contestamos Y y luego nos pide confirmación del nombre de archivo. Pulsamos enter para confirmar el nombre.
Este fichero de log, cada vez, irá grabando lo que ocurra en weewx.
Pero llegará un momento, que se hará enorme, ocupando un precioso espacio en nuestra tarjeta SD, si nuestra sistema está funcionando en un ordenador de bajo consumo.
Para evitar esto, nuestro Linux nos ofrece el demonio logrotate que hace que los ficheros de log, se vayan cerrando y cambiando de nombre a nuestra voluntad.
Vamos a crear el fichero /etc/logrotate.d/weewx
sudo nano /etc/logrotate.d/weewx
Una vez dentro del editor, insertamos las siguientes lineas:
/var/log/weewx.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 644 syslog adm
sharedscripts
postrotate
reload rsyslog > /dev/null 2>&1
endscript
}
Pulsamos CTRL-X para salir como explicamos anteriormente.
Ahora solo necesitamos reiniciar rsyslog.d
sudo service rsyslog restart
Terminado, ya tienes un log específico para Weewx en /var/log/weewx.log
--- Fin del código ---
El archivo weewx.log me lo ha creado. le he dado permisos:
sudo su
chmod ugo+rwx /var/log/weewx.log
Si pongo /var/log/weewx.log
me dice que el archivo esta ocupado. He probado de cerrar weewx: sudo /etc/init.d/weewx stop . Me continua diciendo lo mismo :-[
Saludos
jantoni:
pero le tienes que decir qué quieres hacer con el fichero
por ejemplo:
sudo less /var/log/weewx.log
te mostrará el fichero con paginación
o
sudo cat /var/log/weewx.log
te lo mostrará todo de una tacada
jantoni:
Te pongo mi sección [StdReport]
--- Citar ---##############################################################################
# This section specifies what reports, using which skins, to generate.
[StdReport]
# Where the skins reside, relative to WEEWX_ROOT
SKIN_ROOT = /etc/weewx/skins
# Where the generated reports should go, relative to WEEWX_ROOT
HTML_ROOT = /var/www/html/weewx
# The database binding indicates which data should be used in reports.
data_binding = wx_binding
# Whether to log a successful operation
log_success = True
# Whether to log an unsuccessful operation
log_failure = False
# Each of the following subsections defines a report that will be run.
# See the customizing guide to change the units, plot types and line
# colors, modify the fonts, display additional sensor data, and other
# customizations. Many of those changes can be made here by overriding
# parameters, or by modifying templates within the skin itself.
[[SeasonsReport]]
# The SeasonsReport uses the 'Seasons' skin, which contains the
# images, templates and plots for the report.
skin = Seasons
enable = true
HTML_ROOT = /var/www/html/weewx/davis1
[[SmartphoneReport]]
# The SmartphoneReport uses the 'Smartphone' skin, and the images and
# files are placed in a dedicated subdirectory.
skin = Smartphone
enable = false
HTML_ROOT = /var/www/html/weewx/smartphone
[[MobileReport]]
# The MobileReport uses the 'Mobile' skin, and the images and files
# are placed in a dedicated subdirectory.
skin = Mobile
enable = false
HTML_ROOT = /var/www/html/weewx/mobile
[[StandardReport]]
# This is the old "Standard" skin. By default, it is not enabled.
skin = Standard
enable = false
[[Highcharts_Belchertown]]
HTML_ROOT = /var/www/html/weewx
skin = Highcharts_Belchertown
[[Belchertown]]
HTML_ROOT = /var/www/html/weewx
skin = Belchertown
[[[Extras]]]
belchertown_root_url = https://jantoni.es/meteo
[[Inigo]]
HTML_ROOT = /var/www/html/weewx/
skin = Inigo
[[[Units]]]
[[[[Groups]]]]
group_altitude = meter
group_speed2 = km_per_hour2
group_pressure = mbar
group_rain = mm
group_rainrate = mm_per_hour
group_degree_day = degree_C_day
group_temperature = degree_C
group_speed = km_per_hour
[[FTP]]
# FTP'ing the results to a webserver is treated as just another report,
# albeit one with an unusual report generator!
skin = Ftp
# If you wish to use FTP, set "enable" to "true", then
# fill out the next four lines.
# Use quotes around passwords to guard against parsing errors.
enable = true
user = blablabla
password = blablabla
server = ftp.blablabla.bla.net # The ftp server name, e.g, www.myserver.org
path = www/meteo # The destination directory, e.g., /weather
# Set to True for an FTP over TLS (FTPS) connection. Not all servers
# support this.
secure_ftp = False
# To upload files from something other than what HTML_ROOT is set
# to above, specify a different HTML_ROOT here.
#HTML_ROOT = /var/www/html/weewx
# Most FTP servers use port 21
port = 21
# Set to 1 to use passive mode, zero for active mode
passive = 1
[[RSYNC]]
# rsync'ing to a webserver is treated as just another report
skin = Rsync
# If you wish to use rsync, you must configure passwordless ssh using
# public/private key authentication from the user account that weewx
# runs to the user account on the remote machine where the files
# will be copied.
#
# If you wish to use rsync, set "enable" to "true", then
# fill out server, user, and path.
# The server should appear in your .ssh/config file.
# The user is the username used in the identity file.
# The path is the destination directory, such as /var/www/html/weather.
# Be sure that the user has write permissions on the destination!
enable = false
server = replace_me
user = replace_me
path = replace_me
# To upload files from something other than what HTML_ROOT is set
# to above, specify a different HTML_ROOT here.
#HTML_ROOT = /var/www/html/weewx
# Rsync can be configured to remove files from the remote server if
# they don't exist under HTML_ROOT locally. USE WITH CAUTION: if you
# make a mistake in the remote path, you could could unintentionally
# cause unrelated files to be deleted. Set to 1 to enable remote file
# deletion, zero to allow files to accumulate remotely.
delete = 0
####
# Various options for customizing your reports.
[[Defaults]]
[[[Units]]]
# The following section sets what unit to use for each unit group.
# NB: The unit is always in the singular. I.e., 'mile_per_hour',
# NOT 'miles_per_hour'
[[[[Groups]]]]
group_altitude = meter # Options are 'foot' or 'meter'
group_degree_day = degree_C_day # Options are 'degree_F_day' or 'degree_C_day'
group_pressure = hPa # Options are 'inHg', 'mmHg', 'mbar', or 'hPa'
group_rain = mm # Options are 'inch', 'cm', or 'mm'
group_rainrate = mm_per_hour # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
group_speed = km_per_hour # Options are 'mile_per_hour', 'km_per_hour', 'knot', or 'meter_per_second'
group_speed2 = km_per_hour2 # Options are 'mile_per_hour2', 'km_per_hour2', 'knot2', or 'meter_per_second2'
group_temperature = degree_C # Options are 'degree_F' or 'degree_C'
# The following section sets the formatting for each type of unit.
[[[[StringFormats]]]]
centibar = %.0f
cm = %.2f
cm_per_hour = %.2f
degree_C = %.1f
degree_F = %.1f
degree_compass = %.0f
foot = %.0f
hPa = %.1f
hour = %.1f
inHg = %.3f
inch = %.2f
inch_per_hour = %.2f
km_per_hour = %.0f
km_per_hour2 = %.1f
knot = %.0f
knot2 = %.1f
mbar = %.1f
meter = %.0f
meter_per_second = %.1f
meter_per_second2 = %.1f
mile_per_hour = %.0f
mile_per_hour2 = %.1f
mm = %.1f
mmHg = %.1f
mm_per_hour = %.1f
percent = %.0f
second = %.0f
uv_index = %.1f
volt = %.1f
watt_per_meter_squared = %.0f
NONE = " N/A"
# The following section sets the label for each type of unit
[[[[Labels]]]]
day = " day", " days"
hour = " hour", " hours"
minute = " minute", " minutes"
second = " second", " seconds"
NONE = ""
# The following section sets the format for each time scale.
# The values below will work in every locale, but they may not look
# particularly attractive.
[[[[TimeFormats]]]]
hour = %H:%M
day = %X
week = %X (%A)
month = %x %X
year = %x %X
rainyear = %x %X
current = %x %X
ephem_day = %X
ephem_year = %d-%b-%Y %H:%M
[[[[Ordinates]]]]
# Ordinal directions. The last one is for no wind direction
directions = N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, N/A
# The following section sets the base temperatures used for the
# calculation of heating and cooling degree-days.
[[[[[DegreeDays]]]]]
# Base temperature for heating days, with unit:
heating_base = 65, degree_F
# Base temperature for cooling days, with unit:
cooling_base = 65, degree_F
# A trend takes a difference across a time period. The following
# section sets the time period, and how big an error is allowed to
# still be counted as the start or end of a period.
[[[[[Trend]]]]]
time_delta = 10800 # 3 hours
time_grace = 300 # 5 minutes
# The labels to be used for each observation type
[[[Labels]]]
# Set to hemisphere abbreviations suitable for your location:
hemispheres = N, S, E, W
# Formats to be used for latitude whole degrees, longitude whole
# degrees, and minutes:
latlon_formats = %02d, %03d, %05.2f
# Generic labels, keyed by an observation type.
[[[[Generic]]]]
barometer = Barómetro
dewpoint = Punto Rocío
ET = ET
heatindex = Heat Index
inHumidity = Inside Humidity
inTemp = Temperatura interior
outHumidity = Humedad Rel.
outTemp = Temperatura exterior
radiation = Radiación
rain = Lluvia
rainRate = Lluvia/Hora
UV = UV Index
windDir = Dirección del viento
windGust = Velocidad de Racha
windGustDir = Dirección de Racha
windSpeed = Velocidad del Viento
windchill = Sensación Térmica
windgustvec = Gust Vector
windvec = Wind Vector
extraTemp1 = Temperature1
extraTemp2 = Temperature2
extraTemp3 = Temperature3
# Sensor status indicators
rxCheckPercent = Signal Quality
txBatteryStatus = Transmitter Battery
windBatteryStatus = Wind Battery
rainBatteryStatus = Rain Battery
outTempBatteryStatus = Outside Temperature Battery
inTempBatteryStatus = Inside Temperature Battery
consBatteryVoltage = Console Battery
heatingVoltage = Heating Battery
supplyVoltage = Supply Voltage
referenceVoltage = Reference Voltage
[[[Almanac]]]
# The labels to be used for the phases of the moon:
moon_phases = New, Waxing crescent, First quarter, Waxing gibbous, Full, Waning gibbous, Last quarter, Waning crescent
##############################################################################
# This service acts as a filter, converting the unit system coming from
# the hardware to a unit system in the database.
--- Fin de la cita ---
Navegación
[#] Página Siguiente
[*] Página Anterior
Ir a la versión completa