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