Mercurial > ~darius > hgwebdir.cgi > wh1080
comparison README @ 0:9dab44dcb331
Initial commit of Greg's code from http://www.lemis.com/grog/tmp/wh1080.tar.gz
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Tue, 09 Feb 2010 13:44:25 +1030 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9dab44dcb331 |
---|---|
1 $Id: README,v 1.4 2010/01/15 01:51:17 grog Exp grog $ | |
2 | |
3 This is an early snapshot of my WH-1080 code. Currently it works on | |
4 FreeBSD and NetBSD. I'm still actively developing it, and numerous | |
5 things will change. Note that many of the programs are buggy and may | |
6 crash, but all can be restarted without problem. | |
7 | |
8 At some time in the future, I'll create proper installation stuff for | |
9 this software. Currently I strongly recommend leaving it in the | |
10 structure it is. | |
11 | |
12 Greg Lehey, 20 December 2009 | |
13 | |
14 This hierarchy contains: | |
15 | |
16 Top level directory: | |
17 | |
18 - wh1080, a program that collects data from the station and | |
19 stores it in a MySQL database. This program frequently runs | |
20 into trouble with the USB connection, at least under FreeBSD. | |
21 When this happens, there appears to be no recovery except for | |
22 restarting the program, so that's what I do. I haven't been | |
23 able to get it to attach under Linux; freeing the kernel driver | |
24 (necessary under Linux) doesn't work. | |
25 | |
26 - report, which I think is obsolete, but which I haven't deleted | |
27 yet. | |
28 | |
29 - xreport, which takes the data from the database at regular | |
30 intervals and sends it to Wunderground | |
31 (http://www.wunderground.com/wundermap) | |
32 | |
33 - yreport, which creates a header file for the PHP page index.php | |
34 (see below). This currently frequently crashes, probably | |
35 because of inadequate error checking. | |
36 | |
37 - dereel-compare, which generates data for plotting comparative | |
38 temperatures between Dereel (where I live) and Ballarat (the | |
39 closest BoM station). | |
40 | |
41 - wundersend, a script to send data to Wunderground. Invoked by | |
42 xreport. | |
43 | |
44 I'm still working on code for a configuration file; in the | |
45 meantime, I enter the configuration manually in config.c. Most of | |
46 the current entries are still tailored to my specific environment, | |
47 and will definitely need change. | |
48 | |
49 Directory db | |
50 | |
51 - mkdb is SQL code to create the tables I'm using, currently | |
52 observations for local observations, remote_observations for | |
53 observations I pull in from Wunderground and the BoM, and | |
54 lastreport to keep track of what has been reported to remote | |
55 stations. | |
56 | |
57 - Script getremote-today, which pulls in observations fro | |
58 Wunderground and the BoM. It has a hard-coded list of station | |
59 IDs. | |
60 | |
61 - insertwunderground and insertBoM, which take the readings from | |
62 the script and insert them into the database. Currently very | |
63 kludgy. | |
64 | |
65 - tidyobservations, SQL code which fixes various breakage I've seen | |
66 in the incoming data. | |
67 | |
68 - Other stuff which I think is no longer needed. | |
69 | |
70 Directory plots | |
71 | |
72 - Script doplots, which creates various plots. Two optional | |
73 parameters, date and enddate. enddate is the first day not to be | |
74 considered in the plots (i.e. they go from 0:0 on date to 0:0 on | |
75 enddate). date defaults to today, and enddate defaults to date + | |
76 1. Currently I'm still working on the multi-day plots, and | |
77 there's nothing to display them. | |
78 | |
79 - Various gnuplot scripts for the individual plots. Most won't need | |
80 changing, but clearly plot-Ballarat-Dereel.gnuplot is just an | |
81 example. Change the list at the top of gnuplots to get rid of it. | |
82 | |
83 Directory web | |
84 | |
85 - File index.php, which displays values for today and yesterday. It | |
86 doesn't access the database, so it can be put on remote web | |
87 servers. It accesses the file current.php (see config.c | |
88 config.php_header) and the plots created by doplot. | |
89 | |
90 - File db.php, effectively the same page as index.php, but it gets | |
91 its info directly from the database. It's also capable of | |
92 creating plots on demand. | |
93 | |
94 - File comparison.php, which displays comparative graphs of local | |
95 and remote stations, also generated by plots/doplots. | |
96 | |
97 Getting the pig to fly | |
98 | |
99 - Install MySQL, PHP and gnuplot. | |
100 - Fix config.c to match local conditions. | |
101 - Build the software. | |
102 - Create the web hierarchy. | |
103 - Create the database. By default the database is called 'weather'; | |
104 if you want something else, edit db/mkdb. Then: | |
105 | |
106 mysql < db/mkdb | |
107 | |
108 - Create the configuration. Edit db/mkconfig and do: | |
109 | |
110 mysql < db/mkconfig | |
111 | |
112 - Run: | |
113 | |
114 while :; do wh1080; done & | |
115 while :; do ./xreport -v -d ; done & | |
116 while :; do yreport; sleep 20; done & | |
117 | |
118 About the WH-108[01]: | |
119 | |
120 - I've seen from the comparative readings in my area | |
121 (http://www.lemis.com/grog/weather/comparison.php) that many | |
122 weather stations show very inaccurate barometric pressures. Mine | |
123 showed pressures that were uniformly about 14 hPa too low. I've | |
124 compensated for this by adding a correction factor in the config. | |
125 | |
126 - I still don't trust the rainfall readings. They are supposed to | |
127 be in units of 0.3 mm. I forget where this information comes | |
128 from, but it agrees with the information displayed on the unit. | |
129 But I also have a manual rain gauge, and it shows only about 70% | |
130 of the readings of the WH-1080. I'm still observing this, but it | |
131 looks like I'm due for another correction factor. | |
132 |