|     Inicio    |   |         |  |   FOROS      |  |      |      
   Elastix - VoIP B4A (Basic4Android) App inventor 2 PHP - MySQL
  Estación meteorológica B4J (Basic4Java) ADB Shell - Android Arduino
  AutoIt (Programación) Visual Basic Script (VBS) FireBase (BD autoactualizable) NodeMCU como Arduino
  Teleco - Emisora de A.M. Visual Basic Cosas de Windows Webs interesantes
Translate:
Búsqueda en este sitio:


.

Estación meteorológica
Cómo montar una estación meteorológica
Juan Antonio Villalpando

-- Tutorial de montaje y configuración --

Volver al índice del tutorial  

____________________________

34.- Configuramos plantillas.

- Vamos a cambiar y crear los archivos:

/etc/weewx/weewx.conf

/etc/weewx/skins/Standard/skin.conf
/etc/weewx/skins/Standard/index.html.tmpl
/etc/weewx/skins/Standard/index2.html.tmpl
/etc/weewx/skins/Standard/index3.html.tmpl

Mediante el Putty vamos a poner esta orden en el terminal, para establecer las presentaciones en español:

export LANG=es_ES.UTF-8

sudo /etc/init.d/weewx restart

________________________________________________________

1.- Baja este archivo y lo descomprimes en tu ordenador.

plantillas.zip

- Ahí están los archivos de configuración y plantillas que utlizaremos. No los cambies, pruébalos tal como vienen, cuando veas su funcionamiento los adaptas a tu cofiguración.

 

2.- Aquí he puesto el contenido de cada uno:

- No cambies ningún dato, cuando ya te funcione lo editas como quieras.

________________________________________
weewx.conf

/etc/weewx/weewx.conf
 
# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2015 Tom Keffer 
# See the file LICENSE.txt for your rights.

##############################################################################

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 0

# Root directory of the weewx data file hierarchy for this station
WEEWX_ROOT = /

# How long to wait before timing out a socket (FTP, HTTP) connection
socket_timeout = 20

# Do not modify this. It is used when installing and updating weewx.
version = 3.5.0

##############################################################################

#   This section is for information about the station.

[Station]
    
    # Description of the station location
    location = "Puerto Real"
    
    # Latitude and longitude in decimal degrees
    latitude = 36.500
    longitude = -6.200
    
    # Altitude of the station, with unit it is in. This is downloaded from
    # from the station if the hardware supports it.
    altitude = 12, meter
    
    # Set to type of station hardware. There must be a corresponding stanza
    # in this file with a 'driver' parameter indicating the driver to be used.
    station_type = FineOffsetUSB
    
    # If you have a website, you may specify an URL
      station_url = http://kio4.com
    
    # The start of the rain year (1=January; 10=October, etc.). This is
    # downloaded from the station if the hardware supports it.
    rain_year_start = 1
    
    # Start of week (0=Monday, 6=Sunday)
    week_start = 0

##############################################################################

[FineOffsetUSB]
    # This section is for the Fine Offset series of weather stations.
    
    # The station model, e.g., WH1080, WS1090, WS2080, WH3081
    model = WH1080
    
    # How often to poll the station for data, in seconds
    polling_interval = 60
    
    # The driver to use:
    driver = weewx.drivers.fousb

##############################################################################

#   This section is for uploading data to Internet sites

[StdRESTful]
    
    [[StationRegistry]]
        # To register this weather station with weewx, set this to true
        register_this_station = false
    
    [[AWEKAS]]
        # This section is for configuring posts to AWEKAS.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a username and password.
        enable = false
        username = juan
        password = micontraseña
    
    [[CWOP]]
        # This section is for configuring posts to CWOP.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify the station ID (e.g., CW1234).
        enable = false
        station = replace_me
    
    # If this is an APRS (radio amateur) station, uncomment
    # the following and replace with a passcode (e.g., 12345).
    #passcode = replace_me (APRS stations only)
    
    [[PWSweather]]
        # This section is for configuring posts to PWSweather.com.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station and password.
        enable = false
        station = PREAL
        password = micontraseña
    
    [[WOW]]
        # This section is for configuring posts to WOW.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station and password.
        enable = false
        station = replace_me
        password = replace_me
    
    [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station (e.g., 'KORHOODR3') and password.
        enable = false
        station = PREAL
        password = micontraseña
        
        # Set the following to True to have weewx use the WU "Rapidfire"
        # protocol. Not all hardware can support it. See the User's Guide.
        rapidfire = False

##############################################################################

#   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/weewx
   # En una versión de Debian con Apache se sitúa como arriba y en otras como abajo
HTML_ROOT = /var/www/html/weewx # The database binding indicates which data should be used in reports. data_binding = wx_binding # Each of the following subsections defines a report that will be run. [[StandardReport]] # 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. # The StandardReport uses the 'Standard' skin, which contains the # images, templates and plots for the report. skin = Standard [[[Units]]] [[[[Groups]]]] group_altitude = meter group_speed2 = km_per_hour2 group_pressure = mbar group_rain = mm group_rainrate = mm_per_hour group_temperature = degree_C group_degree_day = degree_C_day 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, uncomment and fill out the next four lines. user = juan password = micontraseña server = kio4.com path = /public_html/estacionmeteo/weewx # Set to True for a secure FTP (SFTP) 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/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 as to the user account on the remote machine where the files # will be copied. # # The following three lines determine where files will be sent. #server = replace with the rsync server name, e.g, www.threefools.org #path = replace with the rsync destination directory (e.g., /weather) #user = replace with the rsync username # 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 ############################################################################## # This service acts as a filter, converting the unit system coming from # the hardware to a unit system in the database. [StdConvert] # The target_unit affects only the unit system in the database. Once # chosen it cannot be changed without converting the entire database. # Modification of target_unit after starting weewx will result in # corrupt data - the database will contain a mix of US and METRIC data. # # The value of target_unit does not affect the unit system for # reporting - reports can display US, Metric, or any combination of units. # # In most cases, target_unit should be left as the default: US # # In particular, those migrating from a standard wview installation # should use US since that is what the wview database contains. # DO NOT MODIFY THIS VALUE UNLESS YOU KNOW WHAT YOU ARE DOING! target_unit = US # Options are 'US', 'METRICWX', or 'METRIC' ############################################################################## # This section can adjust data using calibration expressions. [StdCalibrate] [[Corrections]] # For each type, an arbitrary calibration expression can be given. # It should be in the units defined in the StdConvert section. # Example: foo = foo + 0.2 ############################################################################## # This section is for quality control checks. If units are not specified, # values must be in the units defined in the StdConvert section. [StdQC] [[MinMax]] barometer = 900, 2000, mbar outTemp = -20, 50, degree_C inTemp = -20, 50, degree_C outHumidity = 0, 100 inHumidity = 0, 100 windSpeed = 0, 120, km_per_hour pressure = 900, 2000, mbar ############################################################################## # This section controls the origin of derived values. [StdWXCalculate] # Derived quantities are calculated by this service. Possible values are: # hardware - use the value provided by hardware # software - use the value calculated by weewx # prefer_hardware - use value provide by hardware if available, # otherwise use value calculated by weewx pressure = prefer_hardware barometer = prefer_hardware altimeter = prefer_hardware windchill = prefer_hardware heatindex = prefer_hardware dewpoint = prefer_hardware inDewpoint = prefer_hardware rainRate = prefer_hardware ############################################################################## # For hardware that supports it, this section controls how often the # onboard clock gets updated. [StdTimeSynch] # How often to check the weather station clock for drift (in seconds) clock_check = 14400 # How much it can drift before we will correct it (in seconds) max_drift = 5 ############################################################################## # This section is for configuring the archive service. [StdArchive] # If the station hardware supports data logging then the archive interval # will be downloaded from the station. Otherwise, specify it (in seconds). archive_interval = 300 # How long to wait (in seconds) before processing new archive data. Must # be greater than zero. archive_delay = 15 # If possible, new archive records are downloaded from the station # hardware. If the hardware does not support this, then new archive # records will be generated in software. # Set the following to "software" to force software record generation. record_generation = software # Whether to include LOOP data in hi/low statistics loop_hilo = True # The data binding used to save archive records data_binding = wx_binding ############################################################################## # This section binds a data store to a database. [DataBindings] [[wx_binding]] # The database must match one of the sections in [Databases]. # This is likely to be the only option you would want to change. database = archive_sqlite # The name of the table within the database table_name = archive # The manager handles aggregation of data for historical summaries manager = weewx.wxmanager.WXDaySummaryManager # The schema defines the structure of the database. # It is *only* used when the database is created. schema = schemas.wview.schema ############################################################################## # This section defines various databases. [Databases] # A SQLite database is simply a single file [[archive_sqlite]] database_type = SQLite database_name = weewx.sdb # MySQL [[archive_mysql]] database_type = MySQL database_name = weewx ############################################################################## # This section defines defaults for the different types of databases. [DatabaseTypes] # Defaults for SQLite databases [[SQLite]] driver = weedb.sqlite # Directory in which the database files are located SQLITE_ROOT = /var/lib/weewx # Defaults for MySQL databases [[MySQL]] driver = weedb.mysql # The host where the database is located host = localhost # The user name for logging in to the host user = weewx # The password for the user name password = weewx ############################################################################## # This section configures the internal weewx engine. [Engine] [[Services]] # This section specifies the services that should be run. They are # grouped by type, and the order of services within each group # determines the order in which the services will be run. prep_services = weewx.engine.StdTimeSynch data_services = , process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate,weewx.engine.StdQC, weewx.wxservices.StdWXCalculate archive_services = weewx.engine.StdArchive restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather,
weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS report_services = weewx.engine.StdPrint, weewx.engine.StdReport

________________________________________
skin.conf

- El archivo skin.conf, es muy largo y no lo voy a poner en esta tabla completamente, solo he puesto la parte que nos interesa, concretamente he añadido:

[[[index2]]]

template = index2.html.tmpl

[[[index3]]]

template = index3.html.tmpl

de esta manera los nuevos archivos index2.html y index3.html, serán creados cuando se realice el skin.

/etc/weewx/skins/Standard/skin.conf


				   
	  [[ToDate]]
        # Reports that show statistics "to date", such as day-to-date,
        # week-to-date, month-to-date, etc.
        [[[day]]]
            template = index.html.tmpl
        
        [[[week]]]
            template = week.html.tmpl
        
        [[[month]]]
            template = month.html.tmpl
        
        [[[year]]]
            template = year.html.tmpl
            
        [[[RSS]]]
            template = RSS/weewx_rss.xml.tmpl
                
        [[[Mobile]]]
            template = mobile.html.tmpl
            
        [[[MobileSmartphone]]]
            template = smartphone/index.html.tmpl
            
        [[[MobileTempOutside]]]
            template = smartphone/temp_outside.html.tmpl

        [[[MobileRain]]]
            template = smartphone/rain.html.tmpl

        [[[MobileBarometer]]]
            template = smartphone/barometer.html.tmpl

        [[[MobileWind]]]
            template = smartphone/wind.html.tmpl
            
        [[[MobileRadar]]]
            template = smartphone/radar.html.tmpl
			
		[[[index2]]]
            template = index2.html.tmpl

		[[[index3]]]
            template = index3.html.tmpl
            
###############################################################################
				   
				   

________________________________________
index2.html.tmpl

- Esta nuestra plantilla personalizada, la he llamado index2.html.tmpl

- La mejor forma de editarla es quitarle el .tmpl y dejarla como index2.html

- Luego vas a un editor de páginas web y cambias los elementos que quieras.

- Al final le vuelves a añadir el .tmpl para que sea plantilla y se llame index2.html.tmpl

- Fíjate los parámetros interiores:

$current.dateTime
$current.inTemp
$current.inHumidity
$current.pressure

- Solo queremos ver esos valores que capta la centralita, sin utilizar el mástil con los demás sensores.

- Para que esta plantilla se realice, en el skin.conf que hemos visto anteriormente debe estar...

[[[index2]]]
     template = index2.html.tmpl

/etc/weewx/skins/Standard/index2.html.tmpl

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//ES"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Weewx - KIO4.COM</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
<p><font size="4" face="Arial, Helvetica, sans-serif">KIO4.COM</font></p>
<p><font size="4" face="Arial, Helvetica, sans-serif">Plantilla realizada por Juan A. Villalpando.</font></p>
<p><font size="4" face="Arial, Helvetica, sans-serif">Fecha: $current.dateTime</font></p>
<p><font size="4" face="Arial, Helvetica, sans-serif">Temperatura interior: $current.inTemp</font></p>
<p><font size="4" face="Arial, Helvetica, sans-serif">Humedad interior: $current.inHumidity</font></p>
<p><font size="4" face="Arial, Helvetica, sans-serif">Presi&oacute;n: $current.pressure</font></p>
</body>
</html>

 

- Cuando en nuestro navegador escribamos:

http://192.168.1.5/weewx/index2.html

se debe ver esa página.

________________________________________
index.html.tmpl

- Este es el archivo original index.html.tmpl

- Es la plantilla original index.html.tmpl, dado que solo estoy utilizando la centralita sin los sensores del mástil, solo quiero ver la humedad interna, la temperatura interna y la presión.

- He modificado:

<tr>
<td class="stats_label">Humidity-Humedad</td>
<td class="stats_data">$current.inHumidity</td>
</tr>
<tr>
<td class="stats_label">Barometer-Presion</td>
<td class="stats_data">$current.pressure</td>
</tr>
<tr>
<td class="stats_label">Barometer Trend ($trend.time_delta.hour.format("%.0f"))</td>
<td class="stats_data">$trend.pressure</td>
</tr>

Para que se vean los valores que capta la centralita, sin importar los sensores del mástil.

/etc/weewx/skins/Standard/index.html.tmpl

#errorCatcher Echo
##
## Specifying an encoding of UTF-8 is usually safe, but if your text is
## actually in Latin-1, then you should replace the string "UTF-8" with "latin-1"
#encoding UTF-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2005/10/profile">
#if $encoding == 'utf8'
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
#end if
<title>$station.location Current Weather Conditions</title>
<link rel="stylesheet" type="text/css" href="weewx.css"/>
<link rel="icon" type="image/png" href="favicon.ico" />
<script type="text/javascript">
function openURL(urlname)
{
window.location=urlname;
}
function openNoaaFile(date)
{
var url = "NOAA/NOAA-";
url = url + date;
url = url + ".txt";
window.location=url;
}
</script>
</head>

<body>
<div id="container">
<div id="masthead">
<h1>$station.location</h1>
<h2>Current Weather Conditions</h2>
<h2>$current.dateTime</h2>
</div>

<div id="stats_group">

<div class="stats">
<div class="stats_header">
Current Conditions
</div>

<table>
<tbody>
<tr>
<td class="stats_label">Outside Temperature</td>
<td class="stats_data">$current.outTemp</td>
</tr>
<tr>
<td class="stats_label">Wind Chill</td>
<td class="stats_data">$current.windchill</td>
</tr>
<tr>
<td class="stats_label">Heat Index</td>
<td class="stats_data">$current.heatindex</td>
</tr>
<tr>
<td class="stats_label">Dewpoint</td>
<td class="stats_data">$current.dewpoint</td>
</tr>
<tr>
<td class="stats_label">Humidity-Humedad</td>
<td class="stats_data">$current.inHumidity</td>
</tr>
<tr>
<td class="stats_label">Barometer-Presion</td>
<td class="stats_data">$current.pressure</td>
</tr>
<tr>
<td class="stats_label">Barometer Trend ($trend.time_delta.hour.format("%.0f"))</td>
<td class="stats_data">$trend.pressure</td>
</tr>
<tr>
<td class="stats_label">Wind</td>
<td class="stats_data">$current.windSpeed from $current.windDir ($current.windDir.ordinal_compass)</td>
</tr>
<tr>
<td class="stats_label">Rain Rate</td>
<td class="stats_data">$current.rainRate</td>
</tr>
<tr>
<td class="stats_label">Inside Temperature</td>
<td class="stats_data">$current.inTemp</td>
</tr>
#if $day.extraTemp1.has_data
<tr>
<td class="stats_label">Pond Temperature</td>
<td class="stats_data">$current.extraTemp1</td>
</tr>
#end if
#if $day.UV.has_data
<tr>
<td class="stats_label">UV</td>
<td class="stats_data">$current.UV</td>
</tr>
#end if
#if $day.ET.has_data and $day.ET.sum.raw > 0.0
<tr>
<td class="stats_label">ET</td>
<td class="stats_data">$current.ET</td>
</tr>
#end if
#if $day.radiation.has_data
<tr>
<td class="stats_label">Solar Radiation</td>
<td class="stats_data">$current.radiation</td>
</tr>
#end if
</tbody>
</table>
</div>

<p>&nbsp;</p>

<div class="stats">
<div class="stats_header">
Since Midnight
</div>
<table>
<tbody>
<tr>
<td class="stats_label">
High Temperature<br/>
Low Temperature
</td>
<td class="stats_data">
$day.outTemp.max at $day.outTemp.maxtime<br/>
$day.outTemp.min at $day.outTemp.mintime
</td>
</tr>
<tr>
<td class="stats_label">
High Heat Index<br/>
Low Wind Chill
</td>
<td class="stats_data">
$day.heatindex.max at $day.heatindex.maxtime<br/>
$day.windchill.min at $day.windchill.mintime
</td>
</tr>
<tr>
<td class="stats_label">
High Humidity<br/>
Low Humidity
</td>
<td class="stats_data">
$day.outHumidity.max at $day.outHumidity.maxtime<br/>
$day.outHumidity.min at $day.outHumidity.mintime
</td>
</tr>
<tr>
<td class="stats_label">
High Dewpoint<br/>
Low Dewpoint
</td>
<td class="stats_data">
$day.dewpoint.max at $day.dewpoint.maxtime<br/>
$day.dewpoint.min at $day.dewpoint.mintime
</td>
</tr>
<tr>
<td class="stats_label">
High Barometer<br/>
Low Barometer
</td>
<td class="stats_data">
$day.barometer.max at $day.barometer.maxtime<br/>
$day.barometer.min at $day.barometer.mintime
</td>
</tr>
<tr>
<td class="stats_label">Today's Rain</td>
<td class="stats_data">$day.rain.sum</td>
</tr>
<tr>
<td class="stats_label">High Rain Rate</td>
<td class="stats_data">$day.rainRate.max at $day.rainRate.maxtime</td>
</tr>
<tr>
<td class="stats_label">
High Wind
</td>
<td class="stats_data">
$day.wind.max from $day.wind.gustdir at $day.wind.maxtime
</td>
</tr>
<tr>
<td class="stats_label">
Average Wind
</td>
<td class="stats_data">
$day.wind.avg
</td>
</tr>
<tr>
<td class="stats_label">
RMS Wind
</td>
<td class="stats_data">
$day.wind.rms
</td>
</tr>

<tr>
<td class="stats_label">
Vector Average Speed<br/>
Vector Average Direction
</td>
<td class="stats_data">
$day.wind.vecavg<br/>
$day.wind.vecdir
</td>
</tr>

<tr>
<td class="stats_label">
High Inside Temperature<br/>
Low Inside Temperature
</td>
<td class="stats_data">
$day.inTemp.max at $day.inTemp.maxtime<br/>
$day.inTemp.min at $day.inTemp.mintime
</td>
</tr>
#if $day.extraTemp1.has_data
<tr>
<td class="stats_label">
High Pond Temperature<br/>
Low Pond Temperature
</td>
<td class="stats_data">
$day.extraTemp1.max at $day.extraTemp1.maxtime<br/>
$day.extraTemp1.min at $day.extraTemp1.mintime
</td>
</tr>
#end if
#if $day.UV.has_data
<tr>
<td class="stats_label">
High UV<br/>
Low UV
</td>
<td class="stats_data">
$day.UV.max at $day.UV.maxtime<br/>
$day.UV.min at $day.UV.mintime
</td>
</tr>
#end if
#if $day.ET.has_data and $day.ET.sum.raw >0.0
<tr>
<td class="stats_label">
High ET<br/>
Low ET
</td>
<td class="stats_data">
$day.ET.max at $day.ET.maxtime<br/>
$day.ET.min at $day.ET.mintime
</td>
</tr>
#end if
#if $day.radiation.has_data
<tr>
<td class="stats_label">
High Radiation<br/>
Low Radiation
</td>
<td class="stats_data">
$day.radiation.max at $day.radiation.maxtime<br/>
$day.radiation.min at $day.radiation.mintime
</td>
</tr>
#end if
</tbody>
</table>
</div> <!--End class "stats" -->

<p>&nbsp;</p>

#if $Extras.has_key('radar_img')
<div id="radar_img">
#if $Extras.has_key('radar_url')
<a href="$Extras.radar_url">
#end if
<img src="$Extras.radar_img" alt="Radar" />
#if $Extras.has_key('radar_url')
</a>
<p>Click image for expanded radar loop</p>
#end if
</div>
#end if

</div> <!--End class "stats_group" -->

<div id="content">
<div id="about">
<div class="header">
About this weather station:
</div>
<table>
<caption class="caption">Location</caption>
<tr>
<td class="label">Latitude:</td>
<td class="data">$station.latitude[0]&deg; $station.latitude[1]' $station.latitude[2]</td>
</tr>
<tr>
<td class="label">Longitude:</td>
<td class="data">$station.longitude[0]&deg; $station.longitude[1]' $station.longitude[2]</td>
</tr>
<tr>
<td class="label">Altitude:</td>
<td class="data">$station.altitude</td>
</tr>
</table>
<p>
This station uses a $station.hardware, controlled by
<a href="http://www.weewx.com">'weewx'</a>, an experimental
weather software system written in Python. Weewx
was designed to be simple, fast, and easy to understand by
leveraging modern software concepts.
</p>
<p><a href="RSS/weewx_rss.xml">RSS feed</a></p>
<p><a href="mobile.html">Mobile formatted</a></p>
<p><a href="smartphone/index.html">Smartphone formatted</a></p>
<p>Weewx uptime: $station.uptime<br/>
Server uptime: $station.os_uptime<br/>
weewx v$station.version</p>
</div> <!-- End id "about" -->

<div id="almanac">
<div class="header">
Today's Almanac
</div>
<div class="celestial_group">
#if $almanac.hasExtras
## Extended almanac information is available. Do the full set of tables.
#set $sun_altitude = $almanac.sun.alt
#if $sun_altitude < 0
#set $sun_None="<i>(Always down)</i>"
#else
#set $sun_None="<i>(Always up)</i>"
#end if
<div class="celestial_body">
<table>
<caption class="caption">Sun</caption>
<tr>
<td class="label">Start civil twilight:</td>
<td class="data">$almanac(horizon=-6).sun(use_center=1).rise</td>
</tr>
<tr>
<td class="label">Sunrise:</td>
<td class="data">$almanac.sun.rise.string($sun_None)</td>
</tr>
<tr>
<td class="label">Transit:</td>
<td class="data">$almanac.sun.transit</td>
</tr>
<tr>
<td class="label">Sunset:</td>
<td class="data">$almanac.sun.set.string($sun_None)</td>
</tr>
<tr>
<td class="label">End civil twilight:</td>
<td class="data">$almanac(horizon=-6).sun(use_center=1).set</td>
</tr>
<tr>
<td class="label">Azimuth:</td>
<td class="data">$("%.1f&deg;" % $almanac.sun.az)</td>
</tr>
<tr>
<td class="label">Altitude:</td>
<td class="data">$("%.1f&deg;" % $sun_altitude)</td>
</tr>
<tr>
<td class="label">Right ascension:</td>
<td class="data">$("%.1f&deg;" % $almanac.sun.ra)</td>
</tr>
<tr>
<td class="label">Declination:</td>
<td class="data">$("%.1f&deg;" % $almanac.sun.dec)</td>
</tr>
#if $almanac.next_equinox.raw < $almanac.next_solstice.raw
## The equinox is before the solstice. Display them in order.
<tr>
<td class="label">Equinox:</td>
<td class="data">$almanac.next_equinox</td>
</tr>
<tr>
<td class="label">Solstice:</td>
<td class="data">$almanac.next_solstice</td>
</tr>
#else
## The solstice is before the equinox. Display them in order.
<tr>
<td class="label">Solstice:</td>
<td class="data">$almanac.next_solstice</td>
</tr>
<tr>
<td class="label">Equinox:</td>
<td class="data">$almanac.next_equinox</td>
</tr>
#end if
</table>
</div> <!-- end class "celestial_body" -->
<div class="celestial_body">
<table>
<caption class="caption">Moon</caption>
<tr>
<td class="label">Rise:</td>
<td class="data">$almanac.moon.rise</td>
</tr>
<tr>
<td class="label">Transit:</td>
<td class="data">$almanac.moon.transit</td>
</tr>
<tr>
<td class="label">Set:</td>
<td class="data">$almanac.moon.set</td>
</tr>
<tr>
<td class="label">Azimuth:</td>
<td class="data">$("%.1f&deg;" % $almanac.moon.az)</td>
</tr>
<tr>
<td class="label">Altitude:</td>
<td class="data">$("%.1f&deg;" % $almanac.moon.alt)</td>
</tr>
<tr>
<td class="label">Right ascension:</td>
<td class="data">$("%.1f&deg;" % $almanac.moon.ra)</td>
</tr>
<tr>
<td class="label">Declination:</td>
<td class="data">$("%.1f&deg;" % $almanac.moon.dec)</td>
</tr>
#if $almanac.next_full_moon.raw < $almanac.next_new_moon.raw
<tr>
<td class="label">Full moon:</td>
<td class="data">$almanac.next_full_moon</td>
</tr>
<tr>
<td class="label">New moon:</td>
<td class="data">$almanac.next_new_moon</td>
</tr>
#else
<tr>
<td class="label">New moon:</td>
<td class="data">$almanac.next_new_moon</td>
</tr>
<tr>
<td class="label">Full moon:</td>
<td class="data">$almanac.next_full_moon</td>
</tr>
#end if
<tr>
<td class="label">Phase:</td>
<td class="data">$almanac.moon_phase<br/>($almanac.moon_fullness% full)</td>
</tr>
</table>
</div> <!-- end class "celestial_body" -->
#else
## No extended almanac information available. Fall back to a simple table.
<table>
<tr>
<td class="label">Sunrise:</td>
<td class="data">$almanac.sunrise</td>
</tr>
<tr>
<td class="label">Sunset:</td>
<td class="data">$almanac.sunset</td>
</tr>
<tr>
<td class="label">Moon Phase:</td>
<td class="data">$almanac.moon_phase<br/>($almanac.moon_fullness% full)</td>
</tr>
</table>
#end if
</div> <!-- end class "celestial_group" -->
</div> <!-- end id "almanac" -->

<div id="plots">
<img src="daytempdew.png" alt="temperatures" />
<img src="daytempchill.png" alt="heatchill" />
<img src="dayrain.png" alt="rain" />
<img src="daywind.png" alt="wind" />
<img src="daybarometer.png" alt="barometer"/>
<img src="daywinddir.png" alt="Hi Wind" />
<img src="dayinside.png" alt="Inside" />
<img src="daywindvec.png" alt="Wind Vector" />
#if $day.radiation.has_data
<img src="dayradiation.png" alt="Radiation" />
#end if
#if $day.UV.has_data
<img src="dayuv.png" alt="UV Index" />
#end if
#if $day.rxCheckPercent.has_data
<img src="dayrx.png" alt="day rx percent"/>
#end if
#if $day.extraTemp1.has_data
<img src="daypond.png" alt="Pond Temperatures" />
#end if
</div> <!-- End id "plots" -->
</div> <!-- End id "content" -->

<div id="navbar">
<input type="button" value=" Current " onclick="openURL('index.html')" />
<input type="button" value=" Week " onclick="openURL('week.html')" />
<input type="button" value=" Month " onclick="openURL('month.html')" />
<input type="button" value=" Year " onclick="openURL('year.html')" />
<p>Monthly summary:&nbsp;
<select NAME=noaaselect onchange="openNoaaFile(value)">
#for $monthYear in $SummaryByMonth
<option value="$monthYear">$monthYear</option>
#end for
<option selected>-Select month-</option>
</select>
<br/>
Yearly summary:&nbsp;
<select NAME=noaaselect onchange="openNoaaFile(value)">
#for $yr in $SummaryByYear
<option value="$yr">$yr</option>
#end for
<option selected>-Select year-</option>
</select>
</p>
</div>
</div>

## Include the Google Analytics code if the user has supplied an ID:
#if $Extras.has_key('googleAnalyticsId')
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("$Extras.googleAnalyticsId");
pageTracker._trackPageview();
} catch(err) {}
</script>
#end if

</body>

</html>

 

________________________________________
3.- Cambiamos los permisos

- Ahora debemos subir esos archivos al Raspberry Pi, lo haremos mediante el cliente FTP Filezilla.

- Primero vamos a cambiarle los permisos a esos archivos para poder sobreescribir los que tenía.

sudo chmod 777 /etc/weewx/weewx.conf
sudo chmod 777 /etc/weewx/skins/Standard/skin.conf
sudo chmod 777 /etc/weewx/skins/Standard/index.html.tmpl
sudo chmod 777 /etc/weewx/skins/Standard

(En el index2.html.tmpl, como no existe hemos cambiado los permisos del directorio que lo contendrá)
________________________________________
4.- Con el cliente FTP Filezilla los pasamos al Raspberry Pi.

Vamos al Filezilla FTP.

- Pasamos los archivos

skin.conf
index.html.tmpl

index2.html.tmpl
index3.html.tmpl

Al directorio: /etc/weewx/skins/Standard

- Luego pasamos:

weewx.conf

a /etc/weewx

________________________________________
5.- Si quisiéramos dejar los permisos como estaban. Pero por ahora déjalos con los 777.

Podemos dejar los permisos a como estaban antes del cambio, pero es mejor dejarlos con los permisos 777 para hacer las pruebas.

No es necesario que hagas estos cambios, no los cambies hasta que no aprendas bien todos los procesos.

sudo chmod 644 /etc/weewx/weewx.conf
sudo chmod 644 /etc/weewx/skins/Standard/skin.conf
sudo chmod 644 /etc/weewx/skins/Standard/index.html.tmpl
sudo chmod 755 /etc/weewx/skins/Standard

________________________________________
6.- Vemos el resultado.

Reiniciamos el programa:

sudo /etc/init.d/weewx restart

Esperamos algo más de 5 minutos para que se obtengan los datos y se puedan mostrar en web.

Vamos a un navegador y escribimos:

http://192.168.1.5/weewx

http://192.168.1.5/weewx/index2.html

Veremos la página con el formato original y la que hemos creado index2.html

________________________________________
index3.html.tmpl

7.- Plantillas muy personalizada.

Vamos a crear una plantilla totalmente personal empezando desde cero. Esta plantilla generará la página index3.html, por lo cual debemos añadir a skin.conf los siguente...

        [[[MobileWind]]]
            template = smartphone/wind.html.tmpl
            
        [[[MobileRadar]]]
            template = smartphone/radar.html.tmpl
			
		[[[index2]]]
            template = index2.html.tmpl

		[[[index3]]]
            template = index3.html.tmpl
            
###############################################################################
			   
....................................................................	

- He intentado que la plantilla se parezca a esta otra realizado con el programa Cumulus y Windows.

http://www.iesromerovargas.com/estacion_meteorologica/Cumulus/web/index.htm

La nuestra con Weewx y Raspberry Pi quedará así:

index3.html

- Ahora con un editor de páginas web crearemos la plantilla que llamaremos: index3.html

- IMPORTANTE: Si vas a cambiar la plantilla no utilices acentos ni eñes, más tarde cuando aprendas a utilizarla podrás ponerlos.

/etc/weewx/skins/Standard/index3.html.tmpl

 

___________________________________________________
Siguiente tema: 34.- Instalación de Raspberry Pi y weewx con NOOBS.

 

- Mi correo:
juana1991@yahoo.com
- KIO4.COM - Política de cookies. Textos e imágenes propiedad del autor:
© Juan A. Villalpando
No se permite la copia de información ni imágenes.
Usamos cookies propias y de terceros que entre otras cosas recogen datos sobre sus hábitos de navegación y realizan análisis de uso de nuestro sitio.
Si continúa navegando consideramos que acepta su uso. Acepto    Más información