Getting and installing the software

Download

The meteo package is free software distributed under the GNU general public license GPL. The full license is included with the package. The current version is 0.9.23, it can be downloaded from http://meteo.othello.ch/download/meteo-0.9.23.tar.gz.

Build

Before configuring and building the software, make sure that your build system meets all the prerequisites as described on the prerequisites page.

Configuration and Installation of the package follow the familiar configure; make; make install pattern. For details see the INSTALL in the distribution. As a quick guide to meteo, read SETUP.

The most common failures during build usually have to do with missing libraries and header files. Many Linux systems have separate packages for libraries and headers, to build the software, you have to install both. E.g. SuSE systems have the headers in RPMs with the string -devel in the name.

If you encounter problems installing or using the meteo package, you can try your luck with the mailing list, just send a message containing nothing but "subscribe meteo" in the body to majordomo@lists.othello.ch.

Install

The install target of the Makefile installs the programs in /usr/local/bin and /usr/local/sbin, the libraries in /usr/local/lib and a sample configuration file in /usr/local/etc/meteo.xml.

Database setup

Most meteo programs need access to the database. The database not only contains the data read from the weather station, but also structural information about the sensors of a station. This is done so that applications don't need to be able to read the meteo XML configuration file to make use of the data. The meteo XML configuration file contains instructions that are relevant to the meteo programs only, e.g. the communications parameters to talk to the weather station, or the description of the graphs drawn by meteodraw.

To create an initially empty database, you can use the script meteo.sql in the db directory of the distribution. This will create the necessary tables and add entries for the fields known to meteo. Since it will also create entries in the station and sensor tables for weather stations used during development, you will probably want to modify existing records or add records describing your own station.

To add records to these tables are modify some records, you can use a web based tool like phpMyAdmin or send SQL statements directly to the database using the mysql program. To add an entry for a new station Foo with id 47 (must be smaller than 128), you would use

mysql> insert into station(name, id, timezone, offset) values ('Foo', 47, 'BRT', -10800);
This station is 3 hours west of Grenwich.

Each station has a couple of sensor arrays. The VantagePro station usually comes with some sensors in the console, and some in the integrated sensor suite ISS, so the VantagePro has the sensor arrays console and iss. But you can add additional sensors to the VantagePro, e.g. a soil station or an extra temperature/humidity sensor. A sensor array can only have one sensor of a given type, e.g. it can only have one temperature sensor. For the console, the temperatur sensor is the inside temperature, for the iss, it is the outside temperature, and if you have a soil1 sensor array connected to your VantagePro, its temperature sensor measures soil temperature.

For each sensor array, you need an entry in the sensor table. The sensor table just keeps track of the names of the sensor arrays and connects them to stations. To create sensor entries for the Foo-station above, you could use

mysql> insert into sensor(name, id, stationid) values ('console', 85, 47);
mysql> insert into sensor(name, id, stationid) values ('iss', 86, 47);

The mfield table contains the various field types known to meteo. The only column of interest is unit, which specifies the units for the values stored in the database. The defaults in meteo.sql use metric units. Note that all stations in the database use the same units, and all fields of the same type use the same units. E.g. you cannot have metric units for soil temperature and Fahrenheit for outside temperature. Note that you can still convert values to other units for graphing using the XML expression syntax of meteodraw. The unit column only affects the units in the database.

When meteo adds an entry to the sdata or avg tables, it builds the primary key from the time, the sensor id and the fieldid (as found in the mfield table).

Database Access Rights

All meteo programs that access the database must be able to read all 5 tables. The following statement creates a user meteo who has read access to all tables of the meteo database:

mysql> grant select on meteo.* to meteo@localhost identified by 'public';
The meteoavg and meteopoll programs need update rights to the sdata and avg tables. The following statement actually grants some more rights:
mysql> grant all on meteo.* to writer@localhost identified by 'secret';

Upgrade from a previous version

Please read the ChangeLog or the NEWS files for specific information about upgrading. If any large scale conversions are necessary, there will be programms supporting this in the support directory of the distribution.

Upgrade to 0.9.14

The station table now includes longitude, latitude and altitude fields, which can be added using the following SQL:

  mysql> alter table station add column longitude double not null;
  mysql> alter table station add column latitude double not null;
  mysql> alter table station add column altitude double not null;
  mysql> update station set longitude = ..., latitude = ..., altitude = ...
         where id = ...;

Upgrade to 0.9.8-0.9.13

Just install over 0.9.7, there are no changes in database structure or configuration files. Please note, however, that the 0.9.7 sample config file had a bug, it included a average element for a nonexistent winddir operator. This didn't stop meteoavg from working, but it caused many error messages. If you still have this element in your meteo.xml, you should remove to save space on your log partition.

Upgrade to 0.9.7

This release adds the offset field to the station table. To create this field and populate it, use the following commands:

mysql> alter table station add column offset int not null default 0;
mysql> update station set offset = -10800 where name = 'Lajeado';
All the references to the offset in station configurations in meteo.xml can be deleted. The graph definitions still need offsets. The reason for this change was that the offset is needed by independent applications, so it should be available through the database. It previously was only available through the XML configuration file.

The averages are no longer computed automatically. There is now a new averages element in the station definition in the XML configuration file which defines how each field is to be averaged. The sample configuration file includes suitable definitions for VantagePro and Weather Monitor II, which you can copy into your existing configuration file. Please read the new section in the meteo.xml(5) manual page for details.

Upgrade to 0.9.6

The header table is no longer needed, you can drop it using

mysql> drop table header;