Files
weewx/docs/upgrading.htm
Tom Keffer 60aee4f4a3 Updated to V2.1.
Simplified install instructions.
Added documentation for Fine Offset.
Added hardware specific install instructions.
2013-01-01 16:35:35 +00:00

231 lines
12 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!-- $Revision$ -->
<!-- $Author$ -->
<!-- $Date$ -->
<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upgrading weewx</title>
<!-- CSS -->
<link href="weewx_docs.css" rel="stylesheet" />
<style type="text/css">
.style1 {
margin-left: 80px;
}
</style>
</head>
<body>
<h1 class="title">Upgrading to <span class="code">weewx</span> v2.1</h1>
<h1>Version specific directions</h1>
<p>What follows are directions for upgrading from specific versions.</p>
<h2>V1.14 or earlier</h2>
<p>Version 2.0 introduces many new features, including a revamped internal
engine. There are two changes that are not backwards compatible:</p>
<ul>
<li>The configuration file, <span class="code">weewx.conf</span>. When
upgrading from V1.X, the setup utility will
install a new, fresh copy of <span class="code">weewx.conf</span>, which you will
then have to edit by hand. Thereafter, V2.X upgrades should be automatic.</li>
<li>Custom services. If you have written a custom service, it will have to be updated to use the
new engine. The overall architecture is very similar, except that
functions must be <em>bound</em> to events, rather than get called implicitly.
See the sections <a href="customizing.htm#Customizing_a_Service">Customizing a
Service</a> and <a href="customizing.htm#Adding_a_Service">Adding a Service</a>
in the <a href="customizing.htm">Customizing Guide</a> for details on how to do
this.</li>
</ul>
<p>All skins should be completely backwards compatible, so you
should not have to change your templates or skin configuration file,
<span class="code">skin.conf</span>. </p>
<p>If you have written a custom report generator it should also be backwards
compatible.</p>
<h2>V1.13 or earlier</h2>
<p>Version 1.14 introduces some new webpages that have been expressly formatted for
the smartphone by using <a href="http://jquery.com/">jQuery</a>.</p>
<p>The skins shipped with the distribution take advantage of these features. If
you do nothing, your old skins will continue to work, but you will not be taking
advantage of these new webpages.</p>
<p>If you want them, then you have two choices:</p>
<ol>
<li>Rename your old skin directory (call it &quot;<span class="code">skins.old</span>&quot;)
then do the install. This will install the new skin distribution. You can
then modify it to reflect any changes you have made, referring to <span class="code">
skins.old</span> for guidance. If you have not changed many things, this
approach will be the easiest.</li>
<li>Alternatively, change the contents of your existing skin directory to
include the new webpages. If you take this approach, you will need to copy
over the contents of the subdirectory <span class="code">
skins/Standard/smartphone</span> from the distribution into your <span class="code">skins/Standard</span>
directory. You will then need to modify your <span class="code">skin.conf</span>.
</ol>
<p class="indent">After the section that looks like</p>
<pre class="style1"> [[[Mobile]]]
template = mobile.html.tmpl</pre>
<p class="indent">add the following directives:</p>
<pre class="style1"> [[[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</pre>
<p class="indent">Then modify section <span class="code">[CopyGenerator]</span>
to add the <span class="highlight">highlighted</span> files:</p>
<pre class="style1">[CopyGenerator]
#
# This section is used by the generator CopyGenerator
#
# List of files that are to be copied at the first invocation of the generator only
copy_once = backgrounds/*, weewx.css, mobile.css, favicon.ico, <span class="highlight">smartphone/icons/*, smartphone/custom.js</span></pre>
<p>Whichever approach you chose, the generated files will appear in
<span class="code">public_html/smartphone</span>. The start of the document root
will be at <span class="code">public_html/smartphone/index.html</span>. You may want
to add a link to this in the template for your main index page
<span class="code">skins/Standard/index.html.tmpl</span>.</p>
<h2>V1.12 or earlier</h2>
<p>Version 1.13 changed the way binding happens to the databases used in reports
so that it happens much later. The upshot is that the signature of a few
functions changed. Most you are unlikely to encounter. The exception is if you
have written custom template <em>search lists</em>, as described in the section <em>
<a href="customizing.htm#Extending_an_existing_generator">Extending an existing report generator</a></em> in the
<a href="customizing.htm">Customizing weewx guide</a>. This section has been
updated to reflect the new function signatures. As a side effect, the
illustrated example actually has become much simpler!</p>
<p>No changes to skins.</p>
<h2>V1.9 or earlier</h2>
<p>Version 1.10 introduced several new features. </p>
<h3>New almanac features, icon, and mobile template</h3>
<p>Version 1.10 introduces some extra almanac features, such as the azimuth and
elevation of the sun and moon, or when the next solstice will be. It also
includes a template formatted for smartphones, as well as an icon (&quot;<span class="code">favicon.ico</span>&quot;)
that displays in your browser toolbar. The skins shipped with the distribution
take advantage of these features. If you do nothing, your old skins will
continue to work, but you will not take advantage of these new features. </p>
<p>If you want these new features then you have two choices:</p>
<ol>
<li>Rename your old skin directory (call it &quot;<span class="code">skin.old</span>&quot;)
then do the install. This will install the new skin distribution. You can
modify it to reflect any changes you have made, referring to <span class="code">
skin.old</span> for guidance.</li>
<li>Alternatively, change the contents of your existing skin directory to take
advantage of the new features. If you take this approach, you will need to
copy over files <span class="code">favicon.ico, mobile.css</span>, and
<span class="code">mobile.html.tmpl</span> from the distribution into your <span class="code">skin/Standard</span>
directory. Modify <span class="code">skins/Standard/index.html.tmpl</span>
to take advantage of the new almanac features, using the version shipped
with the distribution for guidance. You will then need to modify your <span class="code">skin.conf</span>.
<p>Add a new <span class="code">[[[Mobile]]]</span> section:</p>
<p class="tty">[FileGenerator]<br />
&nbsp; .<br />
&nbsp; .<br />
&nbsp; .<br />
&nbsp; [[ToDate]]<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; [[[Mobile]]]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; template = mobile.html.tmpl</p>
<p>Then add <span class="code">mobile.css</span> and <span class="code">
favicon.ico</span> to the list of files to be copied on report generation:</p>
<p class="tty">[CopyGenerator]<br />
&nbsp; copy_once = backgrounds/*, weewx.css, mobile.css, favicon.ico</p>
</ol>
<p>Which approach you should take will depend on how extensively you have
modified the stock skin distribution. If the modifications are slight, approach
#1 will be easier, otherwise use approach #2.</p>
<h3>Backwards compatibility</h3>
<p>With the introduction of explicit control of output units in the templates
such as</p>
<p class="tty">$day.outTemp.max.degree_C</p>
<p>the calling signature of the following two Python classes was changed</p>
<ul>
<li><span class="code">weewx.stats.TaggedStats</span></li>
<li><span class="code">weewx.stats.TimeSpanStats</span></li>
</ul>
<p>The example of writing a custom generator <span class="code">MyFileGenerator</span>
(which produced &quot;all time&quot; statistics) has been changed to reflect the new
signatures.</p>
<p>This will only affect you if you have written a custom generator.</p>
<h2>V1.7.0 or earlier</h2>
<p>With the introduction of a standard archiving service, <span class="code">
StdArchive</span>, the names of some events have changed. This will not affect
you unless you have written a custom service.</p>
<h2>V.1.5.0 or earlier</h2>
<p>V1.7 introduces <em>skins</em>. The skins live in subdirectory
<span class="code">skins</span>. They are <em>not</em> compatible with the old
<span class="code">template</span> subdirectory --- you can&#39;t simply rename
<span class="code">templates</span> to <span class="code">skins</span>. </p>
<p>The part of the configuration file dealing with the presentation layer has
been split off into a separate file <span class="code">skin.conf</span>. Hence,
once again, the installation script
<span class="code">setup.py</span> will NOT merge your old <span class="code">
weewx.conf</span> configuration file
into the new one. You will have to re-edit <span class="code">weewx.conf</span>
to put in your customizations. You may also have to edit <span class="code">
skin.conf</span> for whatever skin you choose (right now, only one skin, <em>Standard</em>,
comes with the distribution).</p>
<p>However, a reinstall of V1.7 <em>will</em> merge your changes for
<span class="code">weewx.conf</span>. It will also merge any changes you have made to <span class="code">skin.conf</span>
as well.</p>
<p>Please check the following:</p>
<ul>
<li>Option &quot;<span class="code">altitude</span>&quot; in section
<span class="code">[Station]</span> now takes a unit. Hence, it should look
something like: <pre> altitude = 120, meter</pre>
</li>
<li>In a similar manner, options <span class="code">heating_base</span> and
<span class="code">cooling_base</span> in <span class="code">skin.conf</span>
also take units:
<pre>heating_base = 65, degree_F
cooling_base = 65, degree_F</pre>
</li>
</ul>
<p>The directory &#39;<span class="code">templates</span>&#39; is no longer used;
it has been replaced with directory &#39;<span class="code">skins</span>&#39;. You
may delete it if you wish:</p>
<p class="tty">rm -r <em>$WEEWX_ROOT</em>/templates</p>
<h2>V1.4.0 or earlier</h2>
<p>Because the configuration file <span class="code">weewx.conf</span> changed
significantly going from V1.4 to V1.5, the installation script
<span class="code">setup.py</span> will NOT merge your old configuration file
into the new one. You will have to re-edit <span class="code">weewx.conf</span>
to put in your customizations.</p>
<h2>V1.2.0 or earlier</h2>
<h3>Optional</h3>
<p>Option <span class="code">clock_check</span>, previously found in the <span class="code">[VantagePro]</span> section, is now found in the
<span class="code">[Station]</span> section. The install program will put a
default value in the new place, but it will not delete nor move your old value
over. If you have changed this value or if you can&#39;t stand the thought of
<span class="code">clock_check</span> appearing in two different places, you
should delete the old one found under <span class="code">[VantagePro]</span> and
make sure the new value, found under <span class="code">[Station]</span> is
correct.</p>
<p>Two Python files are no longer used, so they may be deleted from your
installation if you wish:</p>
<p class="tty"><em>rm $WEEWX_ROOT</em>/bin/weewx/processdata.py<br />
<em>rm $WEEWX_ROOT</em>/bin/weewx/mainloop.py</p>
<p>In addition, file <span class="code">readme.htm</span> has been moved to
subdirectory <span class="code"><em>$WEEWX_ROOT</em>/docs</span>, so the old one
can be deleted:</p>
<p class="tty">rm <em>$WEEWX_ROOT</em>/readme.htm</p>
<p>&nbsp;</p>
</body>
</html>