1 ===========================================================================
2 $NetBSD: MESSAGE,v 1.4 2005/09/28 14:15:49 rillig Exp $
4 Before you can use this program, you need to configure the MySQL
5 connection in the open2300.conf file. The mysql user used by the
6 program only needs "insert" priviledges.
8 You need to creat a table 'weather' in the configured database.
9 The program code suggests the following table structure:
11 CREATE TABLE `weather` (
12 `timestamp` bigint(14) NOT NULL default '0',
13 `rec_date` date NOT NULL default '0000-00-00',
14 `rec_time` time NOT NULL default '00:00:00',
15 `temp_in` decimal(2,1) NOT NULL default '0.0',
16 `temp_out` decimal(2,1) NOT NULL default '0.0',
17 `dewpoint` decimal(2,1) NOT NULL default '0.0',
18 `rel_hum_in` tinyint(3) NOT NULL default '0',
19 `rel_hum_out` tinyint(3) NOT NULL default '0',
20 `windspeed` decimal(3,1) NOT NULL default '0.0',
21 `wind_angle` decimal(3,1) NOT NULL default '0.0',
22 `wind_direction` char(3) NOT NULL default '',
23 `wind_chill` decimal(2,1) NOT NULL default '0.0',
24 `rain_1h` decimal(3,1) NOT NULL default '0.0',
25 `rain_24h` decimal(3,1) NOT NULL default '0.0',
26 `rain_total` decimal(4,1) NOT NULL default '0.0',
27 `rel_pressure` decimal(4,1) NOT NULL default '0.0',
28 `tendency` varchar(7) NOT NULL default '',
29 `forecast` varchar(6) NOT NULL default '',
30 UNIQUE KEY `timestamp` (`timestamp`)
33 Not that the actual field names are not used, but the structure
34 needs to be compatible. This alternative structure (for newer MySQL
35 versions) works as well:
37 CREATE TABLE `weather` (
38 `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
39 `rec_date` date NOT NULL default '0000-00-00',
40 `rec_time` time NOT NULL default '00:00:00',
41 `temp_in` float NOT NULL default '0',
42 `temp_out` float NOT NULL default '0',
43 `dewpoint` float NOT NULL default '0',
44 `rel_hum_in` int(11) NOT NULL default '0',
45 `rel_hum_out` int(11) NOT NULL default '0',
46 `windspeed` float NOT NULL default '0',
47 `wind_angle` float NOT NULL default '0',
48 `wind_direction` enum('N','NNE','NE','ENE','E','ESE','SE','SSE','S',
49 'SSW','SW','WSW','W','WNW','NW','NNW') NOT NULL default 'N',
50 `wind_chill` float NOT NULL default '0',
51 `rain_1h` float NOT NULL default '0',
52 `rain_24h` float NOT NULL default '0',
53 `rain_total` float NOT NULL default '0',
54 `rel_pressure` float NOT NULL default '0',
55 `tendency` enum('Steady','Rising','Falling') NOT NULL default 'Steady',
56 `forecast` enum('Rainy','Cloudy','Sunny') NOT NULL default 'Rainy',
57 PRIMARY KEY (`timestamp`)
59 ENGINE=MyISAM DEFAULT CHARSET=latin1
60 COMMENT='Weather as reported by WS 2300';
62 The program will not output anything, unless errors occur. This
63 makes it easy to use it in cron jobs.
65 ===========================================================================