March 5, 2006
/COPYING | The GPL Version 2 License file |
/AUTHORS | My feeble attempt to give everyone their due credit |
/INSTALL | General GNU automake build instructions |
/stations/common | Source directory for the station daemon |
/stations/VantagePro | Source directory for the Davis Vantage Pro/Pro2 interface |
/stations/VantagePro/vpconfig | Source directory for the Vantage Pro/Pro2 config utility |
/stations/VantagePro/doc | Davis SDK documentation |
/htmlgenerator | Source directory for the HTML file generator |
/alarms | Source directory for the alarm and data feed daemon |
/ssh | Source directory for the rsync/ssh transfer daemon |
/ftp | Source directory for the FTP process |
/common | Common source and build files |
/cwop | Source directory for the CWOP process |
/wunderground | Source directory for the optional Weather Underground process |
/sqld | Source directory for the optional SQL archiving process |
/wviewconfig | Source directory for the wview configuration script |
/bin | Provides a template run environment with img and archive directories - various graphics are stored in the bin/img directory and must be transferred to your web site's document root directory |
/examples/conf | Example config files (see description below) |
/examples/html | Example HTML template files and tag description file parameters.txt (see description below) |
/examples/SuSE | Example SuSE boot start script location |
/examples/FreeBSD | Example FreeBSD boot start script location |
/examples/RedHat | Example RedHat boot start script location |
/examples/FedoraCore | Example Fedora Core boot start script location |
/examples/Debian | Example Debian boot start script location |
/examples/MacOSX | Example Mac OSX boot start environment location |
/utilities | Top-level wview utilities directory |
/utilities/archive-be2le | Source directory for the wview archive directory Big-Endian to Little-Endian command line convertor |
/utilities/archive-le2be | Source directory for the wview archive directory Little-Endian to Big-Endian command line convertor |
/configure | build configuration script to be executed before building wview |
/cross-compile | Contains example configure scripts for cross compilation. libz, libpng, libgd, librad and wview scripts are included (and should be built in that order). Use these scripts instead of "./configure" to configure these libraries for cross compilation. These scripts configure for arm-linux targets but could easily be edited for a different target. |
/ChangeLog | The release notes file |
/wview-User-Manual.html | This file, the User Manual |
/wview-Quick-Start.html | Quick Start Guide |
/wview-Quick-Start-MacOSX.html | MacOSX-specific Quick Start Guide |
/README | Just directs you to this file now... |
/UPGRADE | Notes on upgrading from previous versions |
Note: Some of these libraries may be represented as "-devel" or similar in your package management utility, i.e., "libcurl-devel". If they are, you should install the devel version in order to get the development libraries that radlib/wview needs.
4.1 Extract to the location [wview_bld_path] of your choosing. tar zxvf wview-x.y.z.tar.gz 4.2 Change directory to the wview root source directory. cd [wview_bld_path] 4.3 Run the configure script to create the build files for your platform. Note: [station_enable_str] refers to the appropriate enable string in the list of stations in the previous section *for your station*. => Possible Configuration Arguments: [station_enable_str] - one of: [none] --enable-station-vpro is default --enable-station-vpro --enable-station-wxt510 --enable-station-sim Optional - one of: [none] No SQL archiving support (default) --enable-mysql --enable-pgresql Optional - one of: [none] No Wunderground support (default) --enable-wunderground => Examples: [No database support (default)] ./configure [station_enable_str] [MySQL database support] ./configure [station_enable_str] --enable-mysql [PostgreSQL database support AND Wunderground] ./configure [station_enable_str] --enable-pgresql --enable-wunderground => Note: Execute "./configure --help" to see user configurable options. Be careful changing any of the prefix values, this has an effect on wview configuration. 4.4 Build. make 4.5 Install. First become root: su [root_password] If this is a new install or you want to obtain new wview templates, images and config files, install binaries and create the run environment. make install-env Otherwise, just install new binaries. make install Note: The following build targets are available: make - default target builds all source make clean - deletes binaries and object files make install - makes "default" then installs the binaries to ${prefix}/bin (usually /usr/local/bin) make install-env - builds "install" then copies example config files and run environment (from .../bin) to /etc/wview and /var/wview respectively, preserving existing data files and backing up existing configuration (if any) 4.6 Configure to run at system boot (if new install). Select the appropriate wview run script - wview-x.y.z/examples/SuSE|RedHat|FreeBSD|FedoraCore (based on your OS/distro) Copy it to the proper location for your system: SuSE: cp wview-x.y.z/examples/SuSE/wview /etc/init.d Redhat: cp wview-x.y.z/examples/RedHat/wview /etc/rc.d/init.d FreeBSD: cp wview-x.y.z/examples/FreeBSD/wview /etc/rc.d FedoraCore: cp wview-x.y.z/examples/FedoraCore/wview /etc/rc.d/init.d Debian: cp wview-x.y.z/examples/Debian/wview /etc/init.d Make sure it is executable: SuSE: chmod +x /etc/init.d/wview Redhat: chmod +x /etc/rc.d/init.d/wview FreeBSD: chmod +x /etc/rc.d/wview FedoraCore: chmod +x /etc/rc.d/init.d/wview Debian: chmod +x /etc/init.d/wview Create a symbolic link in the runlevel directory you boot your server to (the following example is for a RedHat/Fedora/Debian that boots into runlevel 3): cd /etc/rc.d/rc3.d ln -s ../init.d/wview S98wview wview will now be started when the system is booted. Note: You can start/stop wview using this run script: /etc/rc.d/init.d/wview start *or* /etc/rc.d/init.d/wview stop Run Script Notes: 1) These are example scripts - ergo their location in the distro under the examples directory. Don't be afraid to edit the appropriate one for your system to your configuration and install location. 2) If you specify a non-default "--prefix=xxx" to the configure script for wview, you will have to edit the wview start script so that all binaries are defined to be at "prefix/bin", otherwise, the script will not work. 3) You should use the same "--prefix=xxx" specification when configuring radlib and wview. Further, this should be the default install location for libraries and library headers in your system - i.e., prefix/lib and prefix/include for libgd.a, libpng.a, libz.a and gd.h respectively. Do not select a non-default prefix (/usr/local) randomly. 4.7 Add radlib location to shared library cache. If you get errors similar to: /usr/local/bin/wviewd: error while loading shared libraries: librad.so.0: cannot open shared object file: No such file or directory you need to either copy the latest wview start script from the distro (examples//wview) to your start script location (see the preceeding section), or add the radlib shared library location (/usr/local/lib) to your shared library cache (see /etc/ld.so.conf) and run ldconfig.
See the scripts in /cross-compile for "./configure" alternatives. This directory contains example configure scripts for cross compilation. libz, libpng, libgd, librad and wview scripts are included (and should be built in that order). Use these scripts instead of "./configure" to configure these libraries for cross compilation. These scripts configure for arm-linux targets but can be edited for other targets. Note: The config-radlib-arm-linux and config-wview-arm-linux scripts will accept up to 3 additional configure options. The general build sequence is: #./config-[pkgname]-arm-linux #make [become root] #make install All libs and applications are installed in the toolchain root, defined in the config scripts. The general build order is: libz libpng libgd librad wview
Note: See the appropriate station configuration section 7. Weather Station Configuration for a procedure to configure your weather station prior to running wview for the first time. Note: See the Configuration Files Description and Run Environment Description sections for detailed information concerning files and directories mentioned here. 6.1 (Mandatory) Setup Run Environment New Install: "make install-env" should be used instead of "make install" in the build instructions. Upgrading: If you are using the standard html templates provided with wview, it is safe to use the "install-env" make target described above. It will not disturb existing archive files and if you know your configuration settings (or don't "mind" referring to your old files in /etc/wview-old), you can just run the wviewconfig script on the newly copied configuration files. This approach keeps you up-to-date on new wview settings and features. The entire /etc/wview directory is renamed /etc/wview-old so that you will not lose anything. Even with custom html templates or alarm definitions, this is the preferred way to upgrade - just move or integrate your old templates and alarm definitions into the new config directory from the backed-up copies in /etc/wview-old. The /var/wview/img directory is similarly backed up prior to copying new image files for new capabilities. If you want to do it all manually, just use the "install" make target and check the wview-x.y.z/Changelog file for remarks on new config files, html templates or images that you may want to copy to your wview server from the distro. 6.2 (Mandatory) Read the distro (or online) version of the file UPGRADE. 6.3 (Mandatory) Run the wviewconfig Script wview configuration files should be autogenerated using the configure script "wviewconfig". This script asks questions interactively then creates (backing up the existing files, if any) the files /etc/wview/wview.conf and /etc/wview/htmlgen.conf based on the answers. It uses your previous settings as the default selections where appropriate. It will also allow interactive enabling/disabling of optional wview capabilities such as alarms or file transfer via ftp. The configuration files for the optional capabilities must still be edited manually. See the relevant sections of this manual for details concerning configuration of the optional capabilities. wviewconfig can be safely used (and should be) for existing installs. It uses the current settings as the default choices, so you don't have to remember what your prior settings were. It will also allow the configuration of new wview optional capabilities while remaining backward compatible with all versions of wview since the 1.0.0 release. 6.4 (New Installs or As Needed) Customizing HTML Templates For Your Site Note: Changing HTML templates in /etc/wview/html does not require a restart of wview. The changes you make will take effect at the next htmlgend generation cycle. Note: Changing the config files images.conf, images-user.conf, images-metric.conf, html-templates.conf and (if supported) forecast.conf does not require a restart of wview (as of version 3.1.0), but does require a HUP signal to be sent to htmlgend to cause these files to be re-read. Do this as follows (this will also toggle log verbosity): kill -s HUP `cat /var/wview/htmlgend.pid` HTML template files (in /etc/wview/html) should be customized to your language and your design preferences. The configuration file html-templates.conf specifies the template files to be used for generation. You may add or remove from this list as needed. Edit copies placed in /etc/wview/html directory, either by use of the "install-env" make target or manually copied for upgrades. The HTML tags "!--stationCity--" and "!--stationState--" should not be removed from template files for which you want the station location included. wview will replace these tags with the values you specify for "STATION_CITY" and "STATION_STATE" in /etc/wview/htmlgen.conf. You no longer need to edit every template for your location. Several home page template designs are now provided - they are named "index-[image file root].htx and their corresponding background images are "[image file root].png" in the bin/img directory. You can use any one of them by copying the file to index.htx or index_Plus.htx and editing the template for your site as usual. A script to rotate through home page templates every minute is included: examples/html/rotate-index.sh. This can be enabled via cron - see the examples/html/rotate-index.sh file for details on usage. If you want to have different homepage templates based on day or night, list the files "index-day.htx" and "index-night.htx" in /etc/wview/html-templates.conf INSTEAD of "index.htx", then wview will generate the file "index.html" based on the values of sunrise, sunset and the current wview server time. See the example html-templates.conf file in the distro for more details. Then either create soft links to the day and night templates you want to use in /etc/wview/html (ln -s index-clouds.htx index-day.htx), or copy the files you want to index-day.htx and index-night.htx. There is now support for XML file generation. XML templates should be named "*.xtx" and placed in /etc/wview/html. An example RSS feed template is included in the distro: examples/html/wxrss.xtx. An href to it is included in all home page template examples so the RSS feed may be discovered while visiting your home page. wxrss.xtx should be edited for your site when placed in /etc/wview/html either manually or via "make install-env". There is now support for "generic" template file types. For any template file named "example.[ext]x" and listed in html-templates.conf, wview will generate a file named "example.[ext]". For example, "myscript.phpx" listed in html-templates.conf and found in /var/wview/html will have all wview tags replaced and the resulting file will be named "myscript.php". Please note that if you are using FTP to transfer your files you will need to add rules for any new extensions you want to support in the wviewftp.conf file. There is support for two new html tags - forecast rule and forecast icon. The new tags are !--forecastRule-- and !--forecastIcon-- (brackets omitted) respectively. The configuration file forecast.conf allows the user to define the icon files and text associated with the forecast rules. See the example forecast.conf file for details. The icon tag will be replaced by an image html construct pointing at the appropriate icon image file. The rule tag will be replaced by the corresponding text string defined in forecast.conf. Because these capabilities require 35 KB or more of memory (and I think the VP forecasts are hokey), they are disabled by default. Note that you can create any page template design you like - the file examples/html/parameterlist.txt contains a list of all html tags supported by wview. These tags are replaced by the actual data when the html page is generated by wview. 6.5 (New Installs) Existing Weatherlink Archive Files If you have existing archive files (*.wlk) that you want to keep/use, copy them to /var/wview/archive prior to starting wview. It will find them and use them for historical charts and NOAA reports. But only if they were collected using the same archive interval that you are going to use for your VP with wview. See the section Preparing a New Vantage Pro Console for more details. Note: If you need to convert archive files from big endian to little endian, use the arc_be2le utility (specifying source and destination directories). This will convert all WLK files and the sensorstore.bin file in the source directory and place them in the destination directory specified. Folks moving from a PPC-based Mac to a PC host (for example) would need to do this conversion on their existing archive directory. Note: If you need to convert archive files from little endian to big endian, use the arc_le2be utility (specifying source and destination directories). This will convert all WLK files and the sensorstore.bin file in the source directory and place them in the destination directory specified. Folks moving from a PC host to an NSLU2 embedded host or a PPC-based Mac (for example) would need to do this conversion on their existing archive directory. 6.6 (Optional) Alarms or Weather Data Feeds If weather data alarm processing and/or TCP stream socket server for data feeds is desired, edit /etc/wview/wvalarm.conf - changing to fit your requirements. See Alarms and wview As a Data Feed Engine for details. 6.7 (Optional) FTP File Transfer If ftp of files to a remote host is desired, edit /etc/wview/wviewftp.conf - changing to fit your environment. 6.8 (Optional) Secure rsync Remote Syncronization If secure rsync synchronization of files to a remote host is desired, edit /etc/wview/wviewssh.conf - changing to fit your environment. See Secure File Transfer (rsync/ssh) for details.
This chapter contains station-specific configuration instructions.
The Simulator station requires no physical weather station. It is a quick and easy way to demo wview. It also provides an excellent debug platform as cyclic data is generated. There is no station setup, just configure wview for the Simulator (--enable-station-sim) then choose Station Type *Generic* when you run wviewconfig after build/install.
If you are installing a new VP console, there are a few initial settings that you need to set up so that your weather station and wview operate properly. Configuration of archive interval, station location (elevation, latitude and longitude) and your desired rain season start month must be set up before you start wview for the first time. Below is a short description of each of these: Archive Interval - this determines how often the VP console will generate an archive record and store it in its internal memory. These records are retrieved by wview from the console and stored in the archive files (and the archive database, if database archiving is enabled). The valid values are: 5, 10, 15, 30, 60 (minutes). Keep in mind that the shorter the archive interval, the more records that will be generated. More records means a shorter time span for internal storage in the VP console memory and larger archive files on the wview server disk (and larger database tables if stored in a database). I use an archive interval of 5 minutes. TO AVOID HAVING TO DELETE ALL OF YOUR ARCHIVE DATA LATER IN ORDER TO CHANGE THE ARCHIVE INTERVAL, IT IS VERY IMPORTANT THAT YOU MAKE THIS CHOICE CAREFULLY AND NOT CHANGE IT AFTER ARCHIVE DATA HAS BEEN STORED BY WVIEW. This does NOT effect how often HTML files containing current conditions are generated or the up to the minute values they contain, this is controlled by the configuration value "GENERATE_INTERVAL" in htmlgen.conf. It will effect the granularity of your charts for the last 24 hours. Elevation - this is given in feet above (or below) sea level. This is the recommended way to calibrate your barometer. Lat/Long - this describes the location of your weather station. Rain Season Start - this defines the first month of each year when yearly rain totals will begin. Most people will use a value of "1" here. In order to set these parameters in the VP console, the "vpinstall" script is provided with the wview distribution. Note that all of these can be configured using the On-Screen VP console setup utility. After building and installing wview, the vpinstall script can be found in ${prefix}/bin (usually /usr/local/bin). It is an interactive script which queries you for these initial values then uses the vpconfig utility to commit them to your new VP console. Once completed, it is advisable to wait 10 minutes or so before starting wview for the first time as it takes the VP console a little while to "digest" the new settings, in particular for the barometer.
7.2.2.1 Overview Note: If you do not have a Vantage Pro Plus or Vantage Pro2 Plus and you haven't added additional sensors ($$) to your VP, then there is no reason to enable Plus extended data in htmlgen.conf or to enable extended sensor generation in images.conf or images-metric.conf. You will only be wasting CPU cycles as the extended sensors will not be populated with anything meaningful. The Vantage Pro Plus adds Solar Radiation, UV and Evapotranspiration (ET) sensors with the potential to add other sensors. wview provides support for historical charts (day, month and year) for the following VP Plus sensors: Solar Radiation UV ET LeafTemp1 LeafTemp2 LeafWetness1 LeafWetness2 SoilTemp1 SoilTemp2 SoilTemp3 SoilTemp4 ExtraHumidity1 ExtraHumidity2 ExtraTemp1 ExtraTemp2 ExtraTemp3 SoilMoisture1 SoilMoisture2 SoilMoisture3 SoilMoisture4 wview also can generate current condition buckets for Radiation, UV and ET. 7.2.2.2 Configuration -------- htmlgen.conf -- Edit /etc/wview/htmlgen.conf -- Modify the following line (or add it if it is not present) so it is enabled (1): EXTENDED_DATA[1]=1 # store/process VP Plus extended sensor values -- Save and Exit the editor -------- images.conf or images-metric.conf -- If this is a new install, skip to 12.2.2.2. To upgrade, you will need to copy the new extended data image definitions from the distribution example file images.conf (images-metric.conf) found in .../wview-x.y.z/examples/conf. The new definitions begin with the heading: "################# V P P L U S D A T A B U C K E T S #################" Copy all definitions below this heading to your existing images.conf (images-metric.conf) file. -- Edit /etc/wview/images.conf (images-metric.conf if a metric station) -- Starting at the VP Plus Data Buckets header, enable all desired sensor images by removing all "#" characters from the beginning of the line. Remember, if you don't have the physical sensor installed on your station, you should not enable the corresponding images for it - it only wastes resources. At a minimum, it is safe to enable Radiation, UV and ET images if you have a Plus station. -- For each new image you have enabled, translate or edit the title and units strings as needed (no spaces in the units label). -- Save and Exit the editor -------- html-templates.conf -- Edit /etc/wview/html-templates.conf -- Replace the corresponding old references with: almanac_Plus.htx Current_Plus.htx Daily_Plus.htx Monthly_Plus.htx Yearly_Plus.htx Leave index.htx unchanged. -- Save and Exit the editor -------- index.htx -- Copy the Plus index.htx template over the standard file: cp /etc/wview/html/index_Plus.htx /etc/wview/html/index.htx -- Edit the index.htx file as usual to customize for your station, language and content preferences. -------- Current_Plus.htx -- If upgrading, copy the example Current_Plus.htx file from the distribution to your wview config tree: cp wview-x.y.z/examples/html/Current_Plus.htx /etc/wview/html -- Edit /etc/wview/html/Current_Plus.htx as usual to customize for your station, language and content preferences. -- Save and Exit the editor -------- Daily_Plus.htx -- If upgrading, copy the example Daily_Plus.htx file from the distribution to your wview config tree: cp wview-x.y.z/examples/html/Daily_Plus.htx /etc/wview/html -- Edit /etc/wview/html/Daily_Plus.htx -- Delete all extended data image references that are NOT supported by your station. Find the comment lines: !-- ***** Extended Data Begin ***** -- ... [extended sensor image references] ... !-- ***** Extended Data End ***** -- and delete all non-supported sensor images. The extended sensor images remaining should match the "Day" images you enabled in images.conf (images-metric.conf). -- Edit /etc/wview/html/Daily_Plus.htx as usual to customize for your station, language and content preferences. -- Save and Exit the editor -------- Monthly_Plus.htx -- If upgrading, copy the example Monthly_Plus.htx file from the distribution to your wview config tree: cp wview-x.y.z/examples/html/Monthly_Plus.htx /etc/wview/html -- Edit /etc/wview/html/Monthly_Plus.htx -- Delete all extended data image references that are NOT supported by your station. Find the comment lines: !-- ***** Extended Data Begin ***** -- ... [extended sensor image references] ... !-- ***** Extended Data End ***** -- and delete all non-supported sensor images. The extended sensor images remaining should match the "Month" images you enabled in images.conf (images-metric.conf). -- Edit /etc/wview/html/Monthly_Plus.htx as usual to customize for your station, language and content preferences. -- Save and Exit the editor -------- Yearly_Plus.htx -- If upgrading, copy the example Yearly_Plus.htx file from the distribution to your wview config tree: cp wview-x.y.z/examples/html/Yearly_Plus.htx /etc/wview/html -- Edit /etc/wview/html/Yearly_Plus.htx -- Delete all extended data image references that are NOT supported by your station. Find the comment lines: !-- ***** Extended Data Begin ***** -- ... [extended sensor image references] ... !-- ***** Extended Data End ***** -- and delete all non-supported sensor images. The extended sensor images remaining should match the "Year" images you enabled in images.conf (images-metric.conf). -- Edit /etc/wview/html/Yearly_Plus.htx as usual to customize for your station, language and content preferences. -- Save and Exit the editor
The Vaisala WXT-510 Weather Transmitter is a semi-professional instrument about the size of a 2 liter bottle of Coke. Ultrasonic wind speed sensors, non-tipping rain/hail measurement and low power are a few of the nice features of this station. A very simple NMEA 0183 protocol implementation is provided to retrieve the readings. Choose Station Type *Generic* when you run wviewconfig.
When you built wview for the WXT-510 (configure option --enable-station-wxt510) the wxt510config utility was built and installed as well. It simply autobauds the WXT-510 until it finds the station's current comm settings then resets the station to 19200-8-N-1. wview startup will do the remaining initialization of the station. To run it, determine what serial device your station is connected to, then as root execute: localhost> wxt510config [station_dev] where [station_dev] is something like /dev/ttyS0, /dev/cuaa0, /dev/ttyUSB0, etc.
A configuration parameter in htmlgen.conf named "METRIC_UNITS" has been added that if set to "1" will cause wview to output all images (buckets and charts) as well as all values for HTML tags in the metric equivalents. The conversions are: Temperature ........... Celsius Barometer ............. Millibars Wind Speed ............ Kilometers per hour Rain .................. Centimeters Date Format ........... YYYYMMDD The image config file named "images-metric.conf" is used instead of "images.conf" if "METRIC_UNITS" is set. This file can be edited to translate the English labels, titles, and units to any language. By editing this file and the HTML template files, any language can be supported by wview. For existing installations, if the "METRIC_UNITS" parameter is not found in htmlgen.conf, wview will assume US units and no conversions will be done. In fact one can easily switch back and forth between US and metric units by toggling this configuration value and restarting wview. NOTE: All archive data in the WLK files is still stored in US format - the conversions are only done for real time image and HTML file generation. NOTE: The Vantage Pro Console should be configured for US units and 0.01" rain buckets.
/etc/wview - configuration files *.conf - configuration files described below html/*.htx - HTML template files to be customized for your site and language html/parameterlist.txt - contains the list of all available HTML tags which can be placed in *.htx template files. These tags are replaced each time htmlgend generates new image and html files. /var/wview - run time data files *.pid - run time pid files created/deleted by the wview daemons. Do NOT alter or delete these files. They should only be present if the corresponding wview daemon is running. archive/*.wlk - Weatherlink format archive files, 1 per month dev/* - FIFO device files created by wview - do NOT alter or delete them img/* - default destination for generated image and HTML files - in particular if subsequent ftp/ssh of files is required noaa/noaa.dat - NOAA data file
1) wview.conf - configures the wview console interface daemon. Automatically generated/updated by the wviewconfig script. 2) htmlgen.conf - configures the html generator daemon Automatically generated/updated by the wviewconfig script. 3) wviewftp.conf - defines the connection information and files to be transfered by the wviewftpd daemon. If absent (or renamed), the wviewftpd daemon will not run. This is the default and a way to disable the wviewftpd daemon. Requires manual editing by user. 4) wviewssh.conf - defines the connection information and directory to be synced by the rsync/ssh daemon. If absent (or renamed), the wviewsshd daemon will not run. This is the default and a way to disable the wviewsshd daemon. Requires manual editing by user. 5) wvalarm.conf - defines the alarm types, thresholds and actions for the wvalarmd daemon. If absent (or renamed), the wvalarmd daemon will not run. This is the default and a way to disable the wvalarmd daemon. Requires manual editing by user. 6) images.conf - defines which built-in images should be generated - do NOT place user defined images in this file. This file provides a list of the image files generated by wview which can be used in HTML templates. Requires manual editing by user. 7) images-metric.conf - defines which built-in images should be generated for Metric units and values. Edit this file to translate the English labels, titles and units to any language you prefer - the charts and buckets will be generated using the new language. This file provides a list of the image files generated by wview which can be used in HTML templates. Requires manual editing by user. 8) images-user.conf - defines user-defined images to be generated - note that the corresponding image generator must be provided in the ".../htmlgenerator/images-user.c" source file and listed in the "user_generators" jump table at the bottom of the source file. The index within the jump table should be referenced from the "images-user.conf" file. These files can be saved from the source tree when upgrading and copied back to preserve user image definitions. Requires manual editing by user. 9) html-templates.conf - defines the html templates to be used for html generation. User-defined templates may be listed here so long as they utilize the tags as defined in ".../examples/html/parameterlist.txt". Requires manual editing by user. 10) forecast.conf - defines the icon files and forecast text strings to be associated with the VP forecast icon and forecast rule values. Icon image file examples are found in wview-x.y.z/bin/img and can be copied to your weather web site. If you change the defaults in forecast.conf, you will need to copy your new icon files to your weather web site. See wview-x.y.z/examples/html/parameterlist.txt to find all available html tags including the forecast icon and rule tags. If absent (or renamed), no forecast icon or rule text will be stored or substituted for the corresponding html tags. This is the default and the way to disable the forecast storage and processing. Requires manual editing by user. 11) arcrec-header.conf - allows user configuration of the header written to each day's browser file. The default is English, but any language can be supported by changing the contents of this file. Remember to keep column alignment in mind when changing this file. Total header size is limited to 1024 characters - this is the sum of all lines in arcrec-header.conf. Requires manual editing by user. 12) wvcwop.conf - CWOP daemon configuration file. If absent (or renamed), the wvcwopd daemon will not run. This is the default and a way to disable the wvcwopd daemon. Automatically generated/updated by the wviewconfig script. 13) wvwunder.conf - Weather Underground daemon configuration file. If absent (or renamed), the wvwunderd daemon will not run. This is the default and a way to disable the wvwunderd daemon. Automatically generated/updated by the wviewconfig script. Note: See the example config files for format descriptions.
11.1 Installation and Setup 11.1a MySQL-Specific Setup (MySQL 3.X and 4.X) 11.1a.1 Connect to the MySQL server: mysql -u root -p [password] 11.1a.2 Create the wview database: CREATE DATABASE wviewDB; Note: wviewDB should be the same value specified in wview.conf for SQLDB_DB_NAME. 11.1a.3 Create the user account and password for the new database: GRANT ALL ON wviewDB.* TO wvwuser@localhost IDENTIFIED BY "wvwpasswd"; Note: wvwuser and wvwpasswd should be the same values specified in wview.conf for SQLDB_USERNAME and SQLDB_PASSWORD respectively. 11.1a.4 Make sure mysqlclient libraries are installed: find /usr -name "mysql*" -print If you do not see the files libmysqlclient.a and mysql.h in the output, it isn't installed. Install the version matching your mysql server that is currently installed. 11.1b PostgreSQL-Specific Setup NOTE: The PostgreSQL user created when you setup PostgreSQL will either be pgsql or postgres. pgsql is used for this example. 11.1b.1 Create a PostgreSQL user for a unix login user (dbadmin must be a valid non-root account on the wview server): Login to the PostgreSQL account: root@wview_server:# su pgsql Create an administrative user based on a unix account: pgsql@wview_server:# /usr/local/bin/createuser dbadmin Answer the questions: Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y PostgreSQL acknowledgement: CREATE USER Logout of the PostgreSQL account: pgsql@wview_server:# logout root@wview_server:# 11.1b.2 Create the wview database: Login to the admin account: root@wview_server:# su dbadmin Create the wview database: dbadmin@wview_server:# /usr/local/bin/createdb wviewDB Note: wviewDB should be the same value specified in wview.conf for SQLDB_DB_NAME. PostgreSQL acknowledgement: CREATE DATABASE 11.1b.3 Create the wview user account for the wview database: Connect to the PostgreSQL server: dbadmin@wview_server:# /usr/local/bin/psql dbTestDB Create the user account and password for the wview database: mydb=# create user wvwuser with password 'wvwpasswd'; Note: wvwuser and wvwpasswd should be the same values specified in wview.conf for SQLDB_USERNAME and SQLDB_PASSWORD respectively. PostgreSQL acknowledgement: CREATE USER Disconnect from the server and logout of the admin account: mydb=# \q dbadmin@wview_server:# logout root@wview_server:# 11.1b.4 Make sure the PostgreSQL development library is installed: find /usr -name "libpq.a" -print If you do not see the file libpq.a in the output, it isn't installed. Install the version matching your PostgreSQL server that is installed. 11.1.5 Build radlib with database support: cd [radlib source location] make distclean # if it had been previously built [MySQL] ./configure --enable-mysql make install [PostgreSQL] ./configure --enable-pgresql make install 11.1.6 Build wview with database support: cd [wview source location] make distclean # if it had been previously built [MySQL] ./configure [station_enable_str] --enable-mysql make install [PostgreSQL] ./configure [station_enable_str] --enable-pgresql make install If there are build errors here, it is probably because you do not have the client development library installed. 11.1.7 Add database configuration to /etc/wview/wview.conf: Append the following if it is not already there: [text begin] SQLDB_ENABLE[1]=1 # Set to 1 to enable SQL DB archive storage SQLDB_EXTENDED_INFO[1]=0 # Store extended weather data (VP Plus) SQLDB_STORE_METRIC[1]=0 # Set to 1 if metric values should be stored SQLDB_HOST[1]=localhost # DB server hostname or IP address SQLDB_USERNAME[1]=wvwuser # DB server username to connect with SQLDB_PASSWORD[1]=wvwpasswd # DB server password to connect with SQLDB_TABLE_NAME[1]=archive # DB table name where archive records are stored [text end] If you have a Vantage Pro Plus with the extra sensors for UV, soil moisture, etc., and you want to archive this extra data, set SQLDB_EXTENDED_INFO to 1 (this will more than double your database storage requirements). 11.2 Storage Requirements Each archive record will require 76 bytes plus the database overhead. Bytes/Day = ~100 * (60/ ArchiveInterval) * 24 For a 5 minute archive interval, this is 28,800 bytes ~= 28 KB/day or ~10.5 MB/year. If SQLDB_EXTENDED_INFO is enabled, it will more than double the size of each record, so assume 25-30 MB/year. 11.3 SQL Database Record Format Column Name Format Comment ----------- ------ ------- ---[Standard Values]--- RecordTime DATETIME ArcInt INT Archive Interval (minutes) OutTemp FLOAT HiOutTemp FLOAT LowOutTemp FLOAT InTemp FLOAT Barometer FLOAT OutHumid FLOAT InHumid FLOAT Rain FLOAT HiRainRate FLOAT WindSpeed FLOAT HiWindSpeed FLOAT WindDir INT Value = -1 if undefined in the Archive Record HiWindDir INT Value = -1 if undefined in the Archive Record Dewpoint FLOAT WindChill FLOAT HeatIndex FLOAT ---[Extended Values]--- solarRad INT Value = -1 if undefined in the Archive Record hiSolarRad INT Value = -1 if undefined in the Archive Record UV FLOAT Value = -1 if undefined in the Archive Record hiUV FLOAT Value = -1 if undefined in the Archive Record ET FLOAT Value = -1 if undefined in the Archive Record leafTemp1 INT Value = -1 if undefined in the Archive Record leafTemp2 INT Value = -1 if undefined in the Archive Record leafTemp3 INT Value = -1 if undefined in the Archive Record leafTemp4 INT Value = -1 if undefined in the Archive Record leafWet1 INT Value = -1 if undefined in the Archive Record leafWet2 INT Value = -1 if undefined in the Archive Record leafWet3 INT Value = -1 if undefined in the Archive Record leafWet4 INT Value = -1 if undefined in the Archive Record soilTemp1 INT Value = -1 if undefined in the Archive Record soilTemp2 INT Value = -1 if undefined in the Archive Record soilTemp3 INT Value = -1 if undefined in the Archive Record soilTemp4 INT Value = -1 if undefined in the Archive Record soilTemp5 INT Value = -1 if undefined in the Archive Record soilTemp6 INT Value = -1 if undefined in the Archive Record soilMoist1 INT Value = -1 if undefined in the Archive Record soilMoist2 INT Value = -1 if undefined in the Archive Record soilMoist3 INT Value = -1 if undefined in the Archive Record soilMoist4 INT Value = -1 if undefined in the Archive Record soilMoist5 INT Value = -1 if undefined in the Archive Record soilMoist6 INT Value = -1 if undefined in the Archive Record
12.1 tnftp wview's ftp daemon requires the tnftp utility which is standard for all BSD distributions and some linux distributions such as SuSE. Others, such as RedHat and Fedora Core, have the vanilla FTP client which is almost useless. In this case you are going to have to replace the old FTP client with tnftp. To determine if you have tnftp installed, execute the following: localhost:~> /usr/bin/ftp ftp> status Not connected. No proxy connection. Gate ftp: off, server (none), port ftpgate. Passive mode: on; fallback to active mode: on. Mode: ; Type: ; Form: ; Structure: . Verbose: on; Bell: off; Prompting: on; Globbing: on. Store unique: off; Receive unique: off. Preserve modification times: on. Case: off; CR stripping: on. Ntrans: off. Nmap: off. Hash mark printing: off; Mark count: 1024; Progress bar: on. Get transfer rate throttle: off; maximum: 0; increment 1024. Put transfer rate throttle: off; maximum: 0; increment 1024. Socket buffer sizes: send 32768, receive 65536. Use of PORT cmds: on. Use of EPSV/EPRT cmds for IPv4: on. Command line editing: on. Version: NetBSD-ftp 20040410 -OR- Version: tnftp -OR- Version: lukemftp ftp> quit The key in this output is the Version line: NetBSD-ftp or tnftp or lukemftp is what we are looking for. If you don't get similar output, you need to install tnftp. To install tnftp, do the following: Download from here: ftp://ftp.netbsd.org/pub/NetBSD/misc/lukemftp/tnftp-20050625.tar.gz Extract it: tar zxvf tnftp-20050625.tar.gz cd to the directory: cd tnftp-20050625 Then execute the following as root (you can cut and paste these commands): ./configure make make install mv /usr/bin/ftp /usr/bin/ftp-old ln -s /usr/local/bin/ftp /usr/bin/ftp If /usr/kerberos/bin/ftp exists: mv /usr/kerberos/bin/ftp /usr/kerberos/bin/ftp-old ln -s /usr/local/bin/ftp /usr/kerberos/bin/ftp 12.2 Remote Server Directory Setup wviewftpd will place all files it transfers into the [conf_directory]/img directory under your ftp login directory on the remote server. [conf_directory] is the value of the "directory" configuration value in wviewftp.conf. localhost:~> telnet [remote_host] username: [remote_username] password: [remote_password] [remote_host]:~> mkdir -p [conf_directory]/img [remote_host]:~> logout 12.3 Move Static Files to Server Certain files like background images and other support files are not transferred by wviewftpd to conserve bandwidth, so you should place them on the remote server manually before running wview with FTP enabled but after having executed "make install-env" for new installs. The following command is also of the same format as what wview uses, thus testing your ftp setup. Replace remote_username, remote_password and remote_host with the proper values for your remote ftp host account. Do not add or remove spaces in this command! cd /var/wview /usr/bin/ftp -AiV -u ftp://remote_username:remote_password@remote_host/ img/*.* 12.4 Configure wviewftpd Edit /etc/wview/wviewftp.conf (if it is named wviewftp.conf-no-ftp, rename it wviewftp.conf). This file contains information explaining its contents. 12.5 Start wview [your_distro_start_script_location]/wview start
13.1 Overview To implement wview alarm capability, a new daemon process has been added: wvalarmd. Like the wviewftpd daemon, if the configuration file wvalarm.conf is not found in /etc/wview when wvalarmd starts, it will exit and alarms will be disabled. wvalarmd "registers" with the wviewd daemon to receive LOOP data at an interval determined by the "PUSH_INTERVAL" configuration value for wviewd in wview.conf (the default is every 60 seconds). When a new LOOP data packet is received by wvalarmd, it checks all defined alarms to determine if an alarm has been triggered. If so, the alarm abatement counter is initialized and the alarm binary/script is invoked with the following arguments: argv[0]/$0 full path of binary/script being run argv[1]/$1 alarm type (see definitions below) argv[2]/$2 alarm threshold argv[3]/$3 value which triggered the alarm It is not hard to conclude the following: 1) Multiple alarm scripts may be defined for the same LOOP data value. 2) Multiple LOOP data values may use the same binary/script since the alarm type, threshold and triggering value are all passed to the binary/script. 3) wview alarms could be used as a data feed to another application which requires weather data updates, you could even run an "html-less" wview that does nothing more than archive weather data and feed current values to another application via wvalarmd. 13.1.1 Alarm Abatement - to control the frequency for which an alarm script/binary is invoked while the data type is exceeding the threshold, an alarm configuration parameter called Abatement is provided. This is simply the number of seconds after an alarm triggers to "hold off" or not invoke the alarm binary/script. Once this abatement period expires, a new alarm binary/script invocation will occur if the alarm is triggered. 13.1.2 Alarm Update Frequency - this is controlled by the "PUSH_INTERVAL" parameter in wview.conf. It is given in milliseconds. One should avoid setting it to anything less than 10000 (10 seconds) - I'm sure it would be fine, but you are not going to get new data updates from the VP Console any faster than once every 10 seconds, because that is controlled by the parameter described in the next section. 13.1.3 Weather Data Update Frequency - this is controlled by the "ARCHIVE_INTERVAL" parameter in wview.conf. This determines how often the wviewd daemon polls the VP Console for current conditions. It is given in milliseconds and should not reasonably be set to anything less than 10000 (10 seconds), and must be an even divisor of 60000. 13.1.4 Raw Data Feeds - wvalarmd implements a TCP socket server to accept connections for clients wanting a raw feed of loop packet data. See the section "Socket-Based Data Feeds" below for details. 13.2 Configuration 13.2.1 /etc/wview/wview.conf 13.2.1.1 Edit /etc/wview/wview.conf 13.2.1.2 Configure the PUSH_INTERVAL parameter to your requirements. This value is given in milliseconds, so 60 seconds would be specified by a value of 60000. This determines how often wvalarmd will receive current conditions data. 13.2.1.3 Save and Exit the editor 13.2.2 /etc/wview/wvalarm.conf 13.2.2.1 If upgrading, copy the example file from the distribution: cp .../wview-x.y.z/examples/conf/wvalarm.conf-no-alarms /etc/wview/wvalarm.conf 13.2.2.2 Edit /etc/wview/wvalarm.conf 13.2.2.3 Choose your station units type by indicating "STATION_US" or "STATION_METRIC" in wvalarm.conf. 13.2.2.4 List your alarm definitions in the format indicated in the example wvalarm.conf file. 13.2.2.5 Save and Exit the editor 13.2.3 Scripts: /etc/wview/alarms/*.sh 13.2.3.1 If using notification scripts, they should be placed in /etc/wview/alarms and will receive the arguments described above when invoked. 13.2.3.2 There are a few example scripts in the distribution directory .../wview-x.y.z/examples/alarms - these will be copied to /etc/wview/alarms for new installs which build with the "install-env" target or can be copied there when upgrading an existing installation. 13.2.3.3 If using custom binaries, make note of the arguments passed to the binary above. 13.2.3.4 The example scripts log alarm events to a log file: /var/wview/alarms/alarm.log. This may be a feature you want to keep - even if you are doing other things in your alarm notification scripts. 13.2.4 Update the wview startup script Whether you are upgrading or this is a fresh install, you need to copy the latest wview startup script from the distro to the proper location so that the alarm daemon is started:cp .../wview-x.y.z/examples/FreeBSD/wview /etc/rc.d cp .../wview-x.y.z/examples/SuSE/wview /etc/init.d cp .../wview-x.y.z/examples/RedHat/wview /etc/rc.d/init.d cp .../wview-x.y.z/examples/RedHat/wview /etc/rc.d/init.d 13.3 Alarm Type Definitions Type (wvalarm.conf) Value (passed to script/binary) ---------------------- ------------------------------- Barometer 0 InsideTemp 1 InsideHumidity 2 OutsideTemp 3 WindSpeed 4 TenMinuteAvgWindSpeed 5 WindDirection 6 OutsideHumidity 7 RainRate 8 StormRain 9 DayRain 10 MonthRain 11 YearRain 12 TxBatteryStatus 13 ConsoleBatteryVoltage 14 DewPoint 15 WindChill 16 HeatIndex 17 Radiation 18 UV 19 ET 20 ExtraTemp1 21 ExtraTemp2 22 ExtraTemp3 23 SoilTemp1 24 SoilTemp2 25 SoilTemp3 26 SoilTemp4 27 LeafTemp1 28 LeafTemp2 29 ExtraHumid1 30 ExtraHumid2 31 13.4 Getting a "Warm Fuzzy" To get an idea how it works and to gain familiarity with configuration, do the following: 13.4.1 Stop wview as you normally would: [FreeBSD] /etc/rc.d/wview stop -OR- [SuSE] /etc/init.d/wview stop -OR- [RH/Fedora] /etc/rc.d/init.d/wview stop 13.4.2 Enable Alarms - rename the example config file wvalarm.conf-no-alarms to wvalarm.conf in your /etc/wview configuration directory 13.4.3 Configure the Update Interval - edit /etc/wview/wview.conf and set the update interval to 60 seconds (PUSH_INTERVAL[1]=60000) 13.4.4 Get Example Alarm Scripts New Installs: make install-env Upgrades: mkdir /etc/wview/alarms mkdir /var/wview/alarms cp wview-x.y.z/examples/alarms/* /etc/wview/alarms 13.4.5 Edit the Thresholds - edit wvalarm.conf for thresholds very near (or already "past") your current outside temperature 13.4.6 Copy the new wview start script: [FreeBSD] cp .../wview-x.y.z/examples/FreeBSD/wview /etc/rc.d [SuSE] cp .../wview-x.y.z/examples/SuSE/wview /etc/init.d [RH/Fedora] cp .../wview-x.y.z/examples/RedHat/wview /etc/rc.d/init.d 13.4.7 Start wview as you normally would: [FreeBSD] /etc/rc.d/wview start -OR- [SuSE] /etc/init.d/wview start -OR- [RH/Fedora] /etc/rc.d/init.d/wview start 13.4.8 Watch the magic: tail -f /var/wview/alarms/alarm.log 13.5 Socket-Based Data Feeds 13.5.1 Overview For true data feeds, wvalarmd provides a socket server which listens on port 11011 of the wview server for connections. When a datafeed client connects on that port, wvalarmd adds the client to the datafeed client list. Then when loop data is received from wviewd, wvalarmd will write the loop packet into each datafeed client's socket, preceded by a start frame sequence. It is a one-way interface and the client may disconnect at any time by calling "shutdown" followed by "close" to close the socket. The number of active client connections is only limited by system resources. The datafeed client will receive the full loop packet as defined in common/datadefs.h - see the structure "LOOP_PKT". 13.5.2 Configuration None required for socket data feeds, just the normal PUSH_INTERVAL setup described above. No alarm entries are required in wvalarm.conf for datafeed clients. 13.5.2 Client Requirements The datafeed sockets are regular TCP/stream PF_INET sockets. The general connection steps (in C) are as follows: socket (...) // create the socket descriptor [setup server address and port in socckaddr_in structure] connect (...) The client then may add the socket descriptor to an fdset for select calls, simply block on the socket for reads, however you want to design it. Other programming language procedures may differ, but the general approach should be the same. Normal Processing "Loop": 1) Wait for data on the socket 2) Sync to the start frame sequence: 0xF388, 0xC6A2, 0xDADA, 0xE7CF 3) Read loop packet 4) Process loop packet 5) Goto #1 To disconnect: shutdown (sockfd, 2) close (sockfd) Note: There is a handy new radlib socket API which is illustrated in the sample datafeed client source code which takes care of most of the above procedure for you. 13.5.3 Running the Example Datafeed Client The directory alarms/sample-datafeed-client contains a simple client example including Makefile. It accepts an argument for host but will use "localhost" if none is given. It connects to the wvalarmd server and logs the current temperature when loop packets are received. 13.5.3.1 Build the example client: (radlib-2.1.0 or higher is required) cd alarms/sample-datafeed-client make (or "gmake" for *BSD) 13.5.3.2 Run it: (with wview already running) ./datafeedClient [wview_hostname] 13.5.3.3 Watch the system log for wvalarmd connection messages and update messages from the example client: tail -f /var/log/messages 13.5.3.4 Kill the example client: Either "ctrl-c" if you ran it in the foreground, or "kill -15 [pid]" if you backgrounded it when you started it. 13.5.3.5 Testing multiple clients: Just repeatedly run the datafeed client application - each client will have its own socket connection to wview. Kill them as described above when you are done.
14.1 Overview A new wview daemon has been added to support secure file transfers to remote servers: wviewsshd. It is enabled or disabled in the same way that the wviewftpd and wvalarmd daemons are - by the presence or absence of the respective config files. All three of these utility daemons are disabled in the standard distribution because the config file names are all appended with "-no-[function]", i.e. "wviewssh.conf-no-ssh". The secure updates are performed using rsync over an ssh session. To work properly, the wview server must be able to login and/or execute commands on the destination server via ssh WITHOUT entering a password. This is accomplished by copying the wview server's root account shared ssh key to the remote server's login account. Suggestion: Don't mix hostname with IP address for the remote server during the configuration below. Decide NOW whether you are going to use a hostname or an IP address, and use it consistently for all references to [remote_host] below. ssh does make a distinction when storing and verifying shared keys. Placeholders: [remote_host] - the host we want to update [ssh_login_user] - the user account name on the [remote_host] we want to use for the ssh logins [remote_test_dir] - remote directory to receive files, relative to the [ssh_login_user] login home directory *[ssh_login_user] must have write access to this directory* [wview_server] - the wview host Note: I have included prompts of the form "username@host:# " to help clarify what is being executed on what host. Your actual shell prompts may be different, this is only for clarity in this procedure. Note: This procedure assumes compatible versions of ssh - version 1 and version 2 of openssh have compatability problems as well as with ssh.com versions 1 and 2. If you are having problems with the setup, I strongly suggest going to the following URL for advanced help: http://www.cs.berkeley.edu/~dtliu/sshinterop.html. 14.2 Prerequisites 14.2.1 Verify rsync is installed on the wview server: root@[wview_server]:# whereis rsync If that doesn't produce /usr/bin/rsync or similar, install rsync. 14.2.2 Verify rsync is installed on the remote host: root@[wview_server]:# ssh -l [ssh_login_user] [remote_host] [enter password] [ssh_login_user]@[remote_host]:# whereis rsync If that doesn't produce /usr/bin/rsync or similar, install rsync. Logout: [ssh_login_user]@[remote_host]:# exit 14.3 ssh Shared Key Setup 14.3.1 Generate a public/private key pair for the root user on the wview server (if it does not already exist) (execute as the root user): root@[wview_server]:# mkdir -p ~/.ssh root@[wview_server]:# ssh-keygen -t rsa Just hit enter for default values when asked questions. This will create two files, we are interested in the ~/.ssh/id_rsa.pub file. 14.3.2 Transfer id_rsa.pub to [remote_host]. Use ftp, scp, email, floppy disk, whatever you want to get this file to the remote host. 14.3.3 Login to [remote_host] as [ssh_login_user] and append the contents of id_rsa.pub into ~/.ssh/authorized_keys (if authorized_keys does not exist, just rename id_rsa.pub to authorized_keys). root@[wview_server]:# ssh -l [ssh_login_user] [remote_host] [enter password] [ssh_login_user]@[remote_host]:# mkdir -p ~/.ssh [ssh_login_user]@[remote_host]:# cd ~/.ssh [ssh_login_user]@[remote_host]:# cat id_rsa.pub >> authorized_keys Stay logged in - we need it for the next step. 14.3.4 As [ssh_login_user] on [remote_host], ssh into the wview server as root, answer "yes" if this is the first time, then logout. This sets the wview server up in the remote server login account's "known_hosts" file. [ssh_login_user]@[remote_host]:# ssh -l root [wview_server] [enter password] root@[wview_server]:# exit Now, exit the original ssh session: [ssh_login_user]@[remote_host]:# exit 14.3.5 As root on the wview server, ssh into [remote_host] as [ssh_login_user], answer "yes" if this is the first time, then logout. This sets the [remote_host] up in the wview server root account's "known_hosts" file. root@[wview_server]:# ssh -l [ssh_login_user] [remote_host] [no password should be required!] [ssh_login_user]@[remote_host]:# exit 14.3.6 Finally, we need to set up ssh for the root user so that when [remote_host] is logged into, ssh uses [ssh_login_user] instead of root for the login on [remote_host]. This must be done for every [remote_host] entry in wviewssh.conf. This is what specifies which user account is used for the ssh login to each [remote_host]. Edit /root/.ssh/config and put the following at the top of the file (just create a new file if it does not exist): [text start] Host [remote_host] User [ssh_login_user] [text end] Save and exit that file. 14.3.7 Mandatory Tests - these must succeed before going any further: As root on the wview server execute: root@[wview_server]:# ssh [remote_host] You should be logged in to [remote_host] as [ssh_login_user] without entering a password. Exit the remote host shell: [ssh_login_user]@[remote_host]:# exit You should now be able to remotely execute commands over ssh. Verify this by executing the date command from the wview server as root: root@[wview_server]:# ssh [remote_host] date This MUST execute without requiring a password. If it does not, go back to the beginning of shared key setup and double check your steps. DO NOT proceed if you cannot login/execute commands remotely as [ssh_login_user] without a password. This is critical! There is much online documentation concerning ssh setup, this is only a bare-bones treatment of the subject. 14.4 Confirming rsync Functionality 14.4.1 Place files in /var/wview/img (if it is not already your "IMAGE_PATH" in htmlgen.conf): root@[wview_server]:# cp [some_test_files] /var/wview/img 14.4.2 Create/Verify the destination path on the remote server (as [ssh_login_user]): root@[wview_server]:# ssh [remote_host] [you are now logged in as [ssh_login_user] without a password, right?] [ssh_login_user]@[remote_host]:# cd ~ [this is your ssh login directory - all wviewssh.conf destination paths are relative to this directory] [ssh_login_user]@[remote_host]:# mkdir -p [remote_test_dir] Note: [remote_test_dir] is a relative path from the [ssh_login_user] login directory - it CANNOT contain a leading "slash". Logout: [ssh_login_user]@[remote_host]:# exit 14.4.3 Test rsync over ssh from the wview server: root@[wview_server]:# rsync -aqz --rsh=ssh /var/wview/img/ [remote_host]:[remote_test_dir] This should transfer the files you placed in /var/wview/img to the remote server in the [remote_test_dir] directory without a password being required. *****!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!***** wview ssh file transfer capability will NOT work until you can successfully execute this command from the wview server and verify the file transfers on the remote server. *****!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!***** 14.5 Configuring wview For Secure Transfers 14.5.1 Stop wview as you normally would: [FreeBSD] /etc/rc.d/wview stop -OR- [SuSE] /etc/init.d/wview stop -OR- [RH/Fedora] /etc/rc.d/init.d/wview stop 14.5.2a If updating, copy the wviewssh.conf script to your server: cp .../wview-x.y.z/examples/conf/wviewssh.conf-no-ssh /etc/wview/wviewssh.conf 14.5.2b If a new install, rename the config file: mv /etc/wview/wviewssh.conf-no-ssh /etc/wview/wviewssh.conf 14.5.3 Copy the new wview start script which will start the wviewsshd daemon: [FreeBSD] cp .../wview-x.y.z/examples/FreeBSD/wview /etc/rc.d [SuSE] cp .../wview-x.y.z/examples/SuSE/wview /etc/init.d [RH/Fedora] cp .../wview-x.y.z/examples/Fedora/wview /etc/rc.d/init.d 14.5.4 Edit /etc/wview/wviewssh.conf, adding one or more transfer rules: [snip] #Interval Source Remote Host Remote Destination #-------- ----------------------------- ------------------------- --------------------------- 1 /var/wview/img [remote_host] [remote_test_dir] [snip] The example file contains a full description of the columns. Each [remote_host] entry must have a corresponding "Host" entry in /root/.ssh/config which specifies the login account ([ssh_login_user]) to use for ssh. See section 14.3 above. Further, the procedures outlined in sections 14.2-14.4 MUST be followed for each unique [remote_host] [ssh_login_user] combination. 14.5.5 Start wview as you normally would: [FreeBSD] /etc/rc.d/wview start -OR- [SuSE] /etc/init.d/wview start -OR- [RH/Fedora] /etc/rc.d/init.d/wview start
15.1 Observing wview Operation wview logs quite a bit of information about what is being initialized, daemons started, etc. in the system log file /var/log/messages. This is where to go to try to investigate a startup problem or just observe what wview is "doing". On the other hand, once you get everything set up the way you want, you can disable informational logs if you are concerned about how quickly your /var/log/messages file is rolling over (you are rotating your log files, right?). Set VERBOSE_MSGS=0 in /etc/wview/wview.conf to disable informational log entries. You can always re-enable it if you need the verbosity. 15.2 Notes On Console Poll Timer Settings The ARCHIVE_INTERVAL setting in wview.conf MUST be less than or equal to 60000 (60 seconds), and it must be an even divisor of 60000. If the value found in wview.conf does not meet these criteria, wviewd will default to 30 seconds. 15.3 Notes On Generation Timer Settings The htmlgen.conf variables START_OFFSET and GENERATE_INTERVAL control when and how often the image and HTML generation occurs. Some examples: START_OFFSET[1]=0 GENERATE_INTERVAL[1]=1 Start at 0 minutes past the next 5 minute mark (0, 5, 10, ...) and then generate every 1 minutes - Once it starts, it will generate ~10 seconds past every minute of each hour START_OFFSET[1]=2 GENERATE_INTERVAL[1]=5 Start at 2 minutes past the next 5 minute mark (0, 5, 10, ...) and then generate every 5 minutes - Once it starts, it will generate ~10 seconds past the 5 minute plus 2 mark (2, 7, 12, 17, 22, ...) of each hour START_OFFSET[1]=3 GENERATE_INTERVAL[1]=10 Start at 3 minutes past the next 5 minute mark (0, 5, 10, ...) and then generate every 10 minutes - Once it starts, it will generate ~10 seconds past one of the following: (3, 13, 23, ...) or (8, 18, 28, ...) minutes of each hour Note: Archive records are received within the first minute of the archive interval position in the hour. For 5 minute archive interval: 0, 5, 10, 15, 20, ... For 30 minute archive interval: 0, 30 Thus in order to insure you get the newest archive data in the generation, unless you are using a 1 minute GENERATE_INTERVAL, you should use an offset of 1 or greater. 15.4 Notes on Image Generation The daily historical charts are generated using the archive records from the last 24 hours. The granularity depends upon your archive interval choice. These charts are updated at the same frequency as the archive interval to include the last archive interval. The 28-day historical charts are generated using the hourly average of archive records for the last 28 days. These charts are updated once per hour to include the last hour's averages. The 365-day historical charts are generated using the daily average of archive records for the last 365 days. These charts are updated once per day (12:01AM) to include the last day's averages. 15.5 Tweaking Your Barometric Pressure Sometimes it is necessary to calibrate your VP console barometer. To do this we use the vpconfig utility. 15.5.1 Stop wview. /etc/rc.d/init.d/wview stop (or where your wview start script is located) 15.5.2 Change your elevation. /usr/local/bin/vpconfig /dev/ttyS0 setelevation [new value in feet] (this assumes a prefix of /usr/local and serial device being /dev/ttyS0) 15.5.3 Restart wview. /etc/rc.d/init.d/wview start Note: the VP console takes a few minutes to "digest" the new elevation and barometric pressure values my be skewed until it normalizes. 15.6 vpconfig Usage Note 1: It is not advisable to use vpconfig to change the archive interval or rain season start after the initial configuration (using vpinstall). This will skew your rain season totals or render your archived data unusable. If you do change the archive interval after records have been stored by wview, you will need to delete all archive data in /var/wview/archive/*.wlk before restarting wview. Note 2: You MUST stop wview before using vpconfig to view or change settings! Usage: vpconfig [station_dev] [command] [cmnd_args] station_dev serial device the VP console is connected to: FreeBSD: /dev/cuaa0 - /dev/cuaa4 Linux: /dev/ttyS0 - /dev/ttyS4 command command to execute, one of: show - retrieve and display VP console config cleararchive - clear the archive memory without changing the interval setinterval [interval in minutes] - set the archive interval (this clears the archive memory) setelevation [elevation in feet] - set the station elevation (feet) - use this to adjust barometer setgain [0 for off, 1 for on] - sets the gain of the radio receiver setlatlong [latitude (negative for S)] [longitude (negative for W)] - set the station latitude and longitude in tenths of a degree setrainseasonstart [month (1-12)] - set the month that the yearly rain total begins 15.7 Ethernet Setup for the GW21E Serial Server 15.7.1 Configure your GW21E IP address as described in the GW21E Quickstart Guide. 15.7.2 Telnet into the GW21E (admin,NULL) 15.7.3 Set Serial Server parameters and Packet Delimiter so that your config looks like: [snip] root@localhost:/root/dev# telnet 10.10.10.22 Trying 10.10.10.22... Connected to 10.10.10.22. Escape character is '^]'. ABLELink Ethernet-Serial Server User name:admin Password: Login ok 0.Exit 1.Overview 2.Networking 3.Security 4.COM1 Input choice and enter(0~4): 4 4 COM0: 1. Link Mode (TCP Server/Virtual COM Disabled/Pair Connection Disabled/Filter disabled/3001 /Alive=10*10 sec) 2. COM Port (VP/RS-232/19200,None,8,1/RTS/CTS) 3. Keep Serial Buffer's Data While Connecting(Disabled) 4. Packet Delimiter (1 ms) 5. Accept Control Command from COM port (Disabled) Input choice and enter(1~5): [snip] Remember to use "CTRL-]" to get to the telnet prompt and type "quit" to exit - their utility does not have an exit path in the menu! I had to quit and re-login multiple times while configuring it. Given the above configuration, your wview ethernet configuration should be: Host: 10.10.10.22 (whatever the IP address is that you assigned it) Port: 3001 (set in section 4 of the GW21E config utility) 15.8 Ethernet Setup for the Lantronix MSS1-T 15.8.1 Connect to the MSS1-T via the serial port - factory defaults are 9600, 8N1. Login as admin, then enter "set privileged" with password "system". 15.8.2 Configure the MSS1-T so that your "show server" command displays: Lantronix MSS1 Version V3.5/5(980529) Type HELP at the 'Local_2> ' prompt for assistance. Username> admin Local_2> show server MSS1 Version V3.5/5(980529) Uptime: 0:06:16 Hardware Addr: 00-80-a3-0f-f3-e2 Name/Nodenum: MSS_0FF3E2/ 0 Ident String: Micro Serial Server Inactive Timer (min): 30 Serial Delay (msec): 10 Password Limit: 3 Session Limit: 4 Queue Limit: 32 Node/Host Limits: 50/20 LAT Circuit Timer (msec): 80 Keepalive Timer (sec): 20 Multicast Timer (sec): 30 Retrans Limit: 10 TCP/IP Address: 10.10.10.22 Subnet Mask: 255.255.255.0 Nameserver: (undefined) Backup Nameserver: (undefined) TCP/IP Gateway: 10.10.10.1 Backup Gateway: (undefined) Domain Name: (undefined) Daytime Queries: Enabled TCP Keepalives: Enabled DHCP Server: None Lease Time: 0:00 Load Address: 00-00-00-00-00-00 Prompt: Local_%n%P> Characteristics: Incoming Logins: Telnet (No Passwords Required) LAT Groups: 0 Local_2> The port to use on the MSS1-T is the raw mode port 3001. Given the above configuration, your wview ethernet configuration should be: Host: 10.10.10.22 (whatever the IP address is that you assigned it) Port: 3001 (not configurable) 15.9 Endian Conversion Utilities wview provides two command-line utilities to convert wview archive directories from Big Endian-to-Little Endian or Little Endian-to-Big Endian. These are necessary if you want to change your wview host from a Mac/NSLU2 to a PC or vice versa. 15.9.1 arc_be2le Usage: arc-be2le [source_directory] [dest_directory] Convert wview archive data in [source_directory] from big endian to little endian then store the result in [dest_directory] 15.9.2 arc_le2be Usage: arc_le2be [source_directory] [dest_directory] Convert wview archive data in [source_directory] from little endian to big endian then store the result in [dest_directory]
16.1 Overview CWOP (Citizen Weather Observer Program, http://www.wxqa.com/) is a system by which individuals with weather stations and the proper software can submit their weather data to an APRS-based data storage system so that anyone, including NOAA, can use the data however they see fit. There are some really neat station display web sites including some java apps to look up station data, position, maps, etc. As an example, see http://www.findu.com/cgi-bin/wxpage.cgi?call=CW4097 for my weather station. CWOP participation requires registering for an APRS "Call Sign". Once you have configured wview for CWOP properly and confirmed your data online, you must contact the maintainers via email to confirm your registration. Then your data will be available for anyone to see and possibly be used in NOAA forecast models, etc. Pretty cool, eh? When CWOP support is enabled and configured properly, wview will transmit a new WX packet to the APRS server each time a new archive record is generated. Thus archive interval drives the frequency that your CWOP data will be updated. Supports the APRS-IS Rollover functionality by enforcing the definition of 3 APRS-IS server:port pairs - the goal is to avoid data loss to the CWOP system caused by connection errors. Select 3 different servers from the list at http://www.wxqa.com/activecwd.html - be advised, the arizona server is heavily burdened and often refuses connections. 16.2 Prerequisites - Internet connection/firewall which allows TCP port 23 connections out - Accurate Latitude and Longitude values in the proper format (this is not the same location info used for general station configuration, higher precision is required by CWOP) - 3 APRS Servers (see http://www.wxqa.com/activecwd.html for the list) - 3 APRS Port Numbers, one for each server (usually 23) - APRS Call Sign (CWnnnn) 16.3 Register for an APRS Call Sign (unless you already have one): http://www.findu.com/citizenweather/signup.html 16.4 Determine your accurate latitude and longitude: http://www.topozone.com/viewmaps.asp 16.4 Enable CWOP support in wview: 16.4.1 You must have wview version 1.6.0 or later 16.4.2 Execute the wviewconfig script: /usr/local/bin/wviewconfig [just hit return to keep your current settings when prompted] > Enable CWOP (Citizen Weather Observer Program) support?" > (0): Answer with a "1" to this question - then specify the CWOP parameters as prompted. Note: You must specify all 3 APRS servers - the goal is to avoid data loss 16.5 If you are upgrading from a version prior to 1.6.0, copy the new wview run script including CWOP daemon support: cp wview-x.y.z/examples/[your_distro]/wview [your_distro_start_script_location] 16.6 Start wview [your_distro_start_script_location]/wview start 16.7 Check the wview logs for wvcwopd activity As said before, your archive interval determines how often wview will update your weather data to the CWOP system. The first record should be generated at the next archive record generation after wview has started. Confirm that wvcwop logs are indicating successful connections to the APRS server. Look in /var/log/messages for something similar to: "CWOP: configured to submit station CW4097 data to:" "CWOP: Primary: socal.aprs2.net:23" "CWOP: Secondary: indiana.aprs2.net:23" "CWOP: Tertiary: aprsfl.net:14580" during initialization, and: "CWOP-sending: CW4097>APRS,TCPXX*,qAX,CW4097:@132235z3334.14N/09654.66W_284/002g005t093P002h40b10131.wview160" at the arrival of each new archive record. 16.8 Confirm your data in the CWOP stream: Goto http://www.findu.com/cgi-bin/wxpage.cgi?call=CWxxxx where CWxxxx is your Call Sign. This should start displaying your weather data graphically with links on the left for looking at your raw data. Make sure it is all good - there is much information and many sites to visit to help you verify your data. Just start at http://www.wxqa.com/activecwd.html. 16.9 When all is good, send an email to the CWOP maintainers. Congratulations, you are now contributing data for the greater good!
17. Wunderground - Submitting Your Data to Weather Underground
17.1 Overview The Weather Underground (www.wunderground.com/) (Wunderground) is a privately held organization which provides many weather services - some free and some not. Among the free services is the ability to register your weather station and submit your data to them so that you can access your data and some nice graphs from their site. 17.2 Prerequisites - Internet connection/firewall which allows HTTP connections out - Accurate Latitude and Longitude values in the proper format - libcurl, a "C" URL library distributed with the command line "curl" utility (see the Prerequisites section above for details) - A registered Weather Underground Station ID 17.3 Register for a Weather Underground Station ID (unless you already have one): http://www.wunderground.com/weatherstation/usersignup.asp 17.4 Determine your accurate latitude and longitude: http://www.topozone.com/viewmaps.asp 17.4 Enable Wunderground support in wview: 17.4.1 You must have wview version 1.7.0 or later 17.4.2 Configure wview to include Wunderground support (libcurl required): ./configure [station_enable_str] --enable-wunderground make install 17.4.3 Execute the wviewconfig script: /usr/local/bin/wviewconfig [just hit return to keep your current settings when prompted] > Enable WUNDERGROUND support? > (0): Answer with a "1" to this question - then specify the Wunderground parameters as prompted. 17.5 If you are upgrading from a version prior to 1.7.0, copy the new wview run script including Wunderground daemon support: cp wview-x.y.z/examples/[your_distro]/wview [your_distro_start_script_location] 17.6 Start wview [your_distro_start_script_location]/wview start 17.7 Check the wview logs for wvwunderd activity Your archive interval determines how often wview will update your weather data to the Wunderground system. The first record should be generated at the next archive record generation after wview has started. Look in /var/log/messages for something similar to: "WUNDERGROUND: configured to submit station KTXCOLLI1 data to wunderground.com" 17.8 Confirm your data at the Wunderground server: Goto http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=XXXXXXX where XXXXXXX is your Wunderground Station ID. This should start displaying your weather data graphically and as a packet list.
18. AWEKAS - Providing Your Data to Awekas
18.1 Overview From the AWEKAS site (http://www.awekas.at/en/index.php): "AWEKAS is an acronym for "Automatisches WEtterKArten System" (= automatic weather map system) and is, as the name already states, a system which produces overview maps from the data from private weather stations. The values are made available by the participants on their websites as Text or CSV files and are collected by the programme. The process is fully automatic and always provides maps with up to date weather situations." Simply put, if we provide the properly formatted HTML template to wview, AWEKAS will periodically poll the resulting HTML file for data and store it in their database for online retrieval. 18.2 Configure wview to Generate the AWEKAS File Copy the appropriate template file (this assumes you have the latest distro HTML templates installed in /etc/wview/html): If you have a metric setup do the following: cp /etc/wview/html/awekas_wl.htx-metric /etc/wview/html/awekas_wl.htx Else if you have a US (Imperial) setup do the following: cp /etc/wview/html/awekas_wl.htx-us /etc/wview/html/awekas_wl.htx Add (or uncomment if already there) this template in /etc/wview/html-templates.conf: vi /etc/wview/html-templates.conf [Add the following lines or just remove the '#' from awekas_wl.htx if already there] [snip] ############################################################################### ### AWEKAS Data Submission Template ############################################################################### awekas_wl.htx [/snip] Restart wview: [your_start_script_location]/wview restart That's it! Once you have registered with AWEKAS this file should be polled by them periodically to update your station data.
19. Using a Linksys NSLU2 as the wview Host
19.1 Overview The Linksys NSLU2 is a network storage link which uses USB external hard drives and an ethernet interface to provide Network Attached Storage (NAS) to the masses. This is a perfect embedded platform to use as a wview host. It is small, inexpensive (~$70) and uses little power. In addition, there exists a mature linux hacking community which has developed an entire open source distribution including a simple package management system. We will use one USB port for our boot disk and root partition hard drive and the other USB port for the USB-to-serial interface to the VP console. One could also use one of the wview-approved terminal servers to interface the VP console via ethernet. The distribution we will use is openslug: (http://www.nslu2-linux.org/wiki/OpenSlug/HomePage). 19.2 Install Openslug Download the openslug 2.7-beta binary: http://www.openslug.org/ Flash the NSLU2 with the openslug binary: http://www.nslu2-linux.org/wiki/OpenSlug/UsingTheBinary Initialize your hard disk and transfer the root filesystem: http://www.nslu2-linux.org/wiki/OpenSlug/InitialisingOpenSlug 19.3 Prepare ipkg to Use the wview Repository Once you have your slug (NSLU2) booting from the USB hard drive, do the following to enable the wview ipkg repository: Obtain the wview ipkg config file: cd /etc/ipkg wget http://www.wviewweather.com/ipkg/wview.conf Configure ipkg: ipkg update 19.4 Install a USB-to-Serial Adapter Driver Note: If you are using a terminal server via ethernet, you can skip this step. The following is a list of supported USB Serial devices: Module Name ipkg Name ----------- ------------------------------- BELKIN kernel-module-belkin-sa CP2101 kernel-module-cp2101 CYPRESS_M8 kernel-module-cypress-m8 DIGI_ACCELEPORT kernel-module-digi-acceleport EDGEPORT kernel-module-io-edgeport EDGEPORT-TI kernel-module-io-ti EMPEG kernel-module-empeg FTDI_SIO kernel-module-ftdi-sio KEYSPAN kernel-module-keyspan MCT_U232 kernel-module-mct-u232 PL2303 kernel-module-pl2303 SAFE kernel-module-safe-serial TI kernel-module-ti-usb-3410-5052 WHITEHEAT kernel-module-whiteheat Choose the ipkg name corresponding to your USB-to-Serial adapter - to generalize we'll refer to it as [usb-pkg-name]. Use "ipkg list" to see descriptions of the individual packages if unsure which one is right for your adapter. You will have to look in the "/dev" directory of your slug to determine the proper device name for your adapter/driver to give the wviewconfig script (after the driver is installed and the USB-to-serial adapter is connected). USB adapters are considered serial devices by wview. Install the kernel module driver: # ipkg install [usb-pkg-name] Setup the module to be loaded at boot: (Note: [module name] is the ipkg Name above without the leading "kernel-module-") # echo [module name] > /etc/modutils/[module name] # /usr/sbin/update-modules # ln -s /etc/init.d/modutils.sh /etc/rc3.d/S90modutils 19.5 Installing wview and All Prerequisites Install NTP and set your timezone: # ipkg install ntpdate # ntpdate ntppub.tamu.edu (or closer ntp server you know) # ipkg install ntp # ipkg install timezones-[your continent] # ln -s /usr/share/zoneinfo/[your continent]/[Your timezone] /etc/localtime (Add local NTP servers to /etc/ntp.conf) Reboot the slug: # reboot Determine the type of wview to install: # ipkg list | grep wview wview-sim - 3.1.2-r0 - Version 3.1.2 of package wview wview-sim-mysql - 3.1.2-r0 - Version 3.1.2 of package wview wview-vpro - 3.1.2-r0 - Version 3.1.2 of package wview wview-vpro-mysql - 3.1.2-r0 - Version 3.1.2 of package wview wview-wxt510 - 3.1.2-r0 - Version 3.1.2 of package wview wview-wxt510-mysql - 3.1.2-r0 - Version 3.1.2 of package wview Install wview and dependencies: # ipkg install wview-[type] This will install radlib, gd, libpng, libjpeg, libz, libcurl and a few other necessities. It will install an appropriate wview start/stop script in /etc/init.d and configure it to run at boot. It will install default config files in /etc/wview and a default run environment in /var/wview. Note that wview binaries are installed in /usr/bin on the slug. Optional: If you plan to ftp your files off the slug to your webserver, you will need to download the tnftp binary built for openslug 2.7-beta: # cd /usr/bin # mv /usr/bin/ftp /usr/bin/ftp-old # wget http://www.wviewweather.com/ipkg/tnftp # chmod +x tnftp # ln -s /usr/bin/tnftp /usr/bin/ftp You can also download the tnftp tarball at: http://www.wviewweather.com/ipkg/tnftp-20050625.tar.gz and build tnftp natively on the slug (development setup on the slug required). 19.6 Finishing Up Now you should proceed to the Configuration section of this manual (skipping the first two sections) and configure your wview installation. When you are done, reboot the slug and confirm proper operation. You will probably want to install the nfs-utils package and/or samba so you can transfer files to/from your slug. These are described on the openslug Wiki - look around and have fun with your slug! 19.7 Upgrading If upgrading a previous version of wview: # /etc/init.d/wview stop # mv /etc/wview /etc/wview-OLD # mv /var/wview/img /var/wview/img-OLD # cd /etc/ipkg # wget http://www.wviewweather.com/ipkg/wview.conf # ipkg update # ipkg install wview (merge your old configuration files into the new directories) # wviewconfig
20. Porting New Stations To wview
20.1 Station API The wview station API is prototyped in ../stations/common/station.h. For full details of the functional requirements please refer to station.h and existing station interfaces. The required functions of any station interface are (from station.h): // station-supplied init function // -- Can Be Asynchronous - event indication required -- // // MUST (in this order): // - set the 'stationGeneratesArchives' flag in WVIEWD_WORK: // if the station generates archive records (TRUE) or they should be // generated automatically by the daemon from the sensor readings (FALSE) // - Initialize the 'stationData' store for station work area // - Initialize the interface medium // - determine the station archive interval - either from the station itself // or from user configuration in wview.conf - and set the // 'work->archiveInterval' variable (in minutes) in WVIEWD_WORK // - VERIFY the archive interval by calling 'stationVerifyArchiveInterval' - // If they don't match, indicate an errant start via the call: // radProcessEventsSend (NULL, STATION_INIT_COMPLETE_EVENT, 1) // and stopping further init activities here! // - do any catch-up on archive records if there is a data logger (can be // asynchronous) - the 'work->runningFlag' can be used for start up // synchronization but should not be modified by the station interface code // - do initial LOOP acquisition // - indicate successful initialization is done via the call: // radProcessEventsSend (NULL, STATION_INIT_COMPLETE_EVENT, 0) // // OPTIONAL: // - Initialize a state machine or any other construct required for the // station interface - these should be stored in the 'stationData' store // // 'archiveIndication' - indication callback used to pass back an archive record // generated as a result of 'stationGetArchive' being called; should receive a // NULL pointer for 'newRecord' if no record available; only used if // 'stationGeneratesArchives' flag is set to TRUE by the station interface // // Returns: OK or ERROR // extern int stationInit ( WVIEWD_WORK *work, void (*archiveIndication)(ARCHIVE_RECORD *newRecord) ); // station-supplied exit function // // Returns: N/A // extern void stationExit (WVIEWD_WORK *work); // station-supplied function to retrieve positional info (lat, long, elev) - // should populate WVIEWD_WORK fields: latitude, longitude, elevation // -- Synchronous -- // // - If station does not store these parameters, they can be retrieved from the // wview.conf file (see the 'stationGetConfigValue' utilities below) - user // must choose station type "Generic" when running the wviewconfig script // // Returns: OK or ERROR // extern int stationGetPosition (WVIEWD_WORK *work); // station-supplied function to indicate a time sync should be performed if the // station maintains time, otherwise may be safely ignored // -- Can Be Asynchronous -- // // Returns: OK or ERROR // extern int stationSyncTime (WVIEWD_WORK *work); // station-supplied function to indicate sensor readings should be performed - // should populate 'work' struct: loopPkt (see datadefs.h for minimum field reqs) // -- Can Be Asynchronous -- // // - indicate readings are complete by sending the STATION_LOOP_COMPLETE_EVENT // event to this process (radProcessEventsSend (NULL, STATION_LOOP_COMPLETE_EVENT, 0)) // // Returns: OK or ERROR // extern int stationGetReadings (WVIEWD_WORK *work); // station-supplied function to indicate an archive record should be generated - // MUST populate an ARCHIVE_RECORD struct and indicate it to 'archiveIndication' // function passed into 'stationInit' // -- Asynchronous - callback indication required -- // // Returns: OK or ERROR // // Note: 'archiveIndication' should receive a NULL pointer for the newRecord if // no record is available // Note: This function will only be invoked by the wview daemon if the // 'stationInit' function set the 'stationGeneratesArchives' to TRUE // extern int stationGetArchive (WVIEWD_WORK *work); // station-supplied function to indicate data is available on the station // interface medium (serial or ethernet) - // It is the responsibility of the station interface to read the data from the // medium and process appropriately. The data does not have to be read within // the context of this function, but may be used to stimulate a state machine. // -- Can Be Asynchronous -- // // Returns: N/A // extern void stationDataIndicate (WVIEWD_WORK *work); // station-supplied function to indicate the interface timer has expired - // It is the responsibility of the station interface to start/stop the interface // timer as needed for the particular station requirements. // The station interface timer is specified by the 'ifTimer' member of the // WVIEWD_WORK structure. No other timers in that structure should be manipulated // in any way by the station interface code. // -- Can Be Asynchronous -- // // Returns: N/A // extern void stationIFTimerExpiry (WVIEWD_WORK *work); 20.2 Notes - Two events are used for notification to the generic wviewd daemon: STATION_INIT_COMPLETE_EVENT used to asynchronously indicate station- specific initialization is complete STATION_LOOP_COMPLETE_EVENT used to asynchronously indicate that a current readings acquisition is complete - If the station does not include a data logger, the generic wviewd daemon will generate archive records based on the current readings samples for the archive interval. See the WXT510 implementation for an example of a straightforward synchronous station interface. It does not include a data logger and requires the wview daemon to generate archive records. The Simulator station implementation also demonstrates a synchronous interface. - If the station does include a data logger, the archiveIndication function allows an asynchronous way to indicate the archive record to the wview daemon. See the VantagePro station implementation for an asynchronous, state-machine driven station interface. - A station-specific work data store pointer is provided in the WVIEWD_WORK structure to allow the definition and reference of station-specific data (including state machines, etc.). - If the station does not configure/store location data, the station config parameter utility can be used to extract them from wview.conf (see stations/Simulator/simulator.c for example usage).
21. Troubleshooting
21.1 wview Processes Please note there are two unix processes for each wview daemon: this is normal radlib operation. One is the actual daemon and the other is a "reflector" process which allows the daemon to send events to itself and to open the message queue FIFO properly. Don't let that bother you. Here are the processes running on my server (no ssh/ftp because I don't need it): root@localhost:/root# ps aux | grep wv root 73863 0.0 0.2 2320 1808 ?? Ss 7:08AM 0:00.02 /usr/local/bin/radmrouted 1 /var/wview root 73865 0.0 0.2 2300 1780 ?? I 7:08AM 0:00.00 /usr/local/bin/radmrouted 1 /var/wview root 73868 0.0 0.1 2380 1472 ?? Ss 7:08AM 0:00.36 /usr/local/bin/wviewd root 73870 0.0 0.1 2356 1196 ?? I 7:08AM 0:00.00 /usr/local/bin/wviewd root 73873 0.0 0.1 2376 1524 ?? Is 7:08AM 0:35.43 /usr/local/bin/wviewsqld root 73875 0.0 0.1 2324 1140 ?? I 7:08AM 0:00.00 /usr/local/bin/wviewsqld root 73879 0.0 0.1 2336 1468 ?? Ss 7:08AM 0:00.01 /usr/local/bin/wvalarmd root 73881 0.0 0.1 2312 1136 ?? I 7:08AM 0:00.00 /usr/local/bin/wvalarmd root 73882 0.0 0.1 2392 1504 ?? Is 7:08AM 0:00.01 /usr/local/bin/wvcwopd root 73884 0.0 0.1 2304 1136 ?? I 7:08AM 0:00.00 /usr/local/bin/wvcwopd root 73885 0.0 0.3 4944 3100 ?? Is 7:08AM 0:00.03 /usr/local/bin/wvwunderd root 73886 0.0 0.2 4788 2216 ?? I 7:08AM 0:00.00 /usr/local/bin/wvwunderd root@localhost:/root# ps aux | grep htmlgen root 73876 0.0 0.3 3960 2800 ?? Is 7:08AM 0:05.82 /usr/local/bin/htmlgend root 73878 0.0 0.2 3860 1964 ?? I 7:08AM 0:00.00 /usr/local/bin/htmlgend root@localhost:/root# This indicates I have 6 wview daemons running: wviewd, htmlgend, wviewsqld, wvalarmd, wvcwopd and wvwunderd. It also displays the radlib message router process radmrouted. 21.2 SYS V IPC (Interprocess Communication) wview uses many radlib facilities which are based on the system V IPC concepts of shared memory and semaphores. Here is a listing of IPC objects while wview is running (FreeBSD): root@localhost:/root# ipcs Message Queues: T ID KEY MODE OWNER GROUP Shared Memory: T ID KEY MODE OWNER GROUP m 4128768 126979 --rw-rw-r-- root wheel m 4128769 126977 --rw-rw-r-- root wheel m 4128770 267386882 --rw-rw-r-- root wheel Semaphores: T ID KEY MODE OWNER GROUP s 4128768 267386881 --rw-r--r-- root wheel s 4128769 126978 --rw-r--r-- root wheel root@localhost:/root# And, after running /etc/rc.d/wview stop: root@localhost:/root# /etc/rc.d/wview stop Shutting down weather daemons... root@localhost:/root# ipcs Message Queues: T ID KEY MODE OWNER GROUP Shared Memory: T ID KEY MODE OWNER GROUP Semaphores: T ID KEY MODE OWNER GROUP root@localhost:/root# Linux systems tend to have other IPC objects defined - you do not want to disturb those. The wview objects are discernable by the "KEY" values: 126977 (0x1F001) - 126979 (0x1F003) (wview-specific) 267386881 (0xFF00001) - 267386882 (0xFF00002) (radlib general) If, after shutting down wview, any of the IPC objects associated with wview (or radlib) still remain, you will need to remove them manually using the "ipcrm" command. This is normally caused by failed wview starts when initially installing wview with improper configuration or by a faulty wview start/stop script which is leaving wview processes running. 21.3 wview Startup wview generates a number of log messages, in particular during initialization. The system log file is normally /var/log/messages. I typically run "tail -f /var/log/messages" in a separate console when starting up wview. You should also when you first install it. Informational logs can later be disabled by editing wview.conf then sending a HUP signal to wviewd and htmlgend: (kill -s HUP `cat /var/wview/wviewd.pid`) and (kill -s HUP `cat /var/wview/htmlgend.pid`) respectively. If you have errors in your startup log, you will need to stop all wview daemons using the wview start script (/etc/init.d/wview stop). These are independent processes which will not shut down automatically if there is an error in one of them. You must use the wview script. Here is what the log file looks like on my server when wview starts up, so you know what a good start looks like: Jan 25 11:33:06 radmrouted[60244]: <44053403> : radlib: radmrouted started as a daemon ... Jan 25 11:33:06 radmrouted[60244]: <44053404> : started on radlib system 1, workdir /var/wview Jan 25 11:33:06 radmrouted[60244]: <44053404> : running... Jan 25 11:33:07 wviewd[60248]: <44054418> : radlib: wviewd started as a daemon ... Jan 25 11:33:07 wviewd[60248]: <44054420> : wview 3.1.0p42 starting ... Jan 25 11:33:07 wviewd[60248]: <44054420> : station interface: serial ... Jan 25 11:33:07 wviewd[60248]: <44054420> : Rain Season Start Month set to 1 Jan 25 11:33:07 wviewd[60248]: <44054420> : no rain storm start trigger given, defaulting to 0.05 in/hr... Jan 25 11:33:07 wviewd[60248]: <44054420> : no rain storm idle stop time given, defaulting to 12 hours... Jan 25 11:33:07 wviewd[60248]: <44054420> : station polling interval set to 15 seconds Jan 25 11:33:07 wviewd[60248]: <44054456> : -- Station Init Start -- Jan 25 11:33:08 wviewsqld[60252]: <44055445> : radlib: wviewsqld started as a daemon ... Jan 25 11:33:08 wviewsqld[60252]: <44055454> : SQLDB: extended US archiving enabled - Jan 25 11:33:08 wviewsqld[60252]: <44055454> : SQLDB: to localhost table wviewDB.archive Jan 25 11:33:08 wvalarmd[60257]: <44055477> : radlib: wvalarmd started as a daemon ... Jan 25 11:33:08 wvcwopd[60260]: <44055478> : radlib: wvcwopd started as a daemon ... Jan 25 11:33:08 wvcwopd[60260]: <44055479> : CWOP: configured to submit station CW4097 data to: Jan 25 11:33:08 wvcwopd[60260]: <44055479> : CWOP: Primary: aprsfl.net:14580 Jan 25 11:33:08 wvcwopd[60260]: <44055479> : CWOP: Secondary: indiana.aprs2.net:23 Jan 25 11:33:08 wvcwopd[60260]: <44055479> : CWOP: Tertiary: socal.aprs2.net:23 Jan 25 11:33:08 htmlgend[60255]: <44055484> : radlib: htmlgend started as a daemon ... Jan 25 11:33:08 wvalarmd[60257]: <44055488> : alarms: added 2 alarm definitions from wvalarm.conf Jan 25 11:33:08 wviewftpd[60266]: <44055492> : /etc/wview/wviewftp.conf does not exist - exiting... Jan 25 11:33:08 htmlgend[60255]: <44055495> : generating to /usr/local/www/vhosts/weather Jan 25 11:33:08 wviewsshd[60267]: <44055500> : /etc/wview/wviewssh.conf does not exist - exiting... Jan 25 11:33:08 wvwunderd[60264]: <44055495> : radlib: wvwunderd started as a daemon ... Jan 25 11:33:08 wvwunderd[60264]: <44055504> : WUNDERGROUND: configured to submit station KTXCOLLI1 data to wunderground.com Jan 25 11:33:09 wviewd[60248]: <44055596> : Vantage Pro on /dev/cuaa0 opened ... Jan 25 11:33:09 wviewd[60248]: <44055639> : station archive interval: 5 minutes Jan 25 11:33:09 wviewd[60248]: <44055656> : running... Jan 25 11:33:09 wviewd[60248]: <44055956> : station location: elevation: 751 feet Jan 25 11:33:09 wviewd[60248]: <44055956> : station location: latitude: 33.6 N longitude: 96.9 W Jan 25 11:33:09 wviewd[60248]: <44055956> : initializing computed data values... Jan 25 11:33:09 htmlgend[60255]: <44056196> : running... Jan 25 11:33:10 wviewd[60248]: <44057111> : -- Station Init Complete -- Jan 25 11:33:10 wviewd[60248]: <44057115> : newest archive record: 2006-01-25 11:30 Jan 25 11:33:10 wviewsqld[60252]: <44057115> : SQLDB: beginning initial database sync (this may take some time)... Jan 25 11:33:10 wvwunderd[60264]: <44057116> : running... Jan 25 11:33:10 wviewsqld[60252]: <44057116> : running... Jan 25 11:33:10 htmlgend[60255]: <44057118> : received archive path /var/wview/archive from wviewd: 20060125 11:33:10 Jan 25 11:33:10 htmlgend[60255]: <44057120> : htmlmgrInit: 54 built-in image definitions added Jan 25 11:33:10 htmlgend[60255]: <44057120> : htmlmgrInit: 0 user image definitions added Jan 25 11:33:10 htmlgend[60255]: <44057120> : htmlmgrInit: 9 html/xml templates added Jan 25 11:33:10 htmlgend[60255]: <44057120> : htmlmgrInit: forecast html tags are disabled - /etc/wview/forecast.conf not found... Jan 25 11:33:10 wvalarmd[60257]: <44057126> : running... Jan 25 11:33:10 wvcwopd[60260]: <44057136> : running... Jan 25 11:33:11 htmlgend[60255]: <44057842> : NOAA Generate: creating monthly NOAA reports starting 12-2004 Jan 25 11:33:11 htmlgend[60255]: <44057852> : NOAA Generate: creating yearly NOAA reports starting 2004 Jan 25 11:33:11 htmlgend[60255]: <44057875> : ARCREC: using header file /etc/wview/arcrec-header.conf ... Jan 25 11:33:11 htmlgend[60255]: <44057877> : ARCREC: saving ALL daily archive reports ... Jan 25 11:33:11 htmlgend[60255]: <44058041> : ARCREC: 416 daily archive reports available Jan 25 11:33:12 htmlgend[60255]: <44058560> : starting html generation in 1 mins 58 secs Jan 25 11:33:12 htmlgend[60255]: <44058560> : doing initial html generation now... Jan 25 11:33:12 htmlgend[60255]: <44059158> : Generated: 596 ms: 54 images, 9 html/xml files Jan 25 11:33:31 wviewd[60248]: <44077576> : station time synchronized to: 01-25-2006 11:33:30 Jan 25 11:33:31 wviewd[60248]: <44077576> : station GMT offset synchronized to: -6 hours, 0 minutes Jan 25 11:34:25 wviewsqld[60252]: <44131627> : SQLDB: initial database sync complete: Jan 25 11:34:25 wviewsqld[60252]: <44131628> : SQLDB: 0 inserts, 119562 duplicates, 0 errors Jan 25 11:35:04 wviewd[60248]: <44171329> : storing record for 2006-01-25 11:35 Jan 25 11:35:04 htmlgend[60255]: <44171341> : Adding 5 minute sample... Jan 25 11:35:10 htmlgend[60255]: <44176951> : Generated: 131 ms: 31 images, 9 html/xml files Jan 25 11:36:10 htmlgend[60255]: <44236904> : Generated: 73 ms: 19 images, 9 html/xml files Jan 25 11:37:10 htmlgend[60255]: <44296896> : Generated: 73 ms: 19 images, 9 html/xml files Jan 25 11:38:10 htmlgend[60255]: <44356897> : Generated: 72 ms: 19 images, 9 html/xml files 21.4 Log Verbosity During Normal Operation Configuration Parameter: VERBOSE_MSGS in wview.conf Log Verbosity refers to status level logs - "normal" operation informational messages. These can be quite interesting when first starting wview or after an upgrade. But when enabled it can generate a bit of log file volume. VERBOSE_MSGS controls the default state for all wview daemons at startup. While wview is running, you can toggle the log verbosity for a given wview daemon by sending a HUP signal to that process (this also causes a reload of image/html configuration for htmlgend). Below are the suitable shell commands for each daemon: kill -s HUP `cat /var/wview/wviewd.pid` kill -s HUP `cat /var/wview/htmlgend.pid` kill -s HUP `cat /var/wview/wviewftpd.pid` kill -s HUP `cat /var/wview/wviewsshd.pid` kill -s HUP `cat /var/wview/wvalarmd.pid` kill -s HUP `cat /var/wview/wvcwopd.pid` kill -s HUP `cat /var/wview/wvwunderd.pid` 21.5 Vantage Pro 21.5.1 Wireless Reception If you are missing archive records, receiving bad archive records, or your current conditions values don't update as expected, you may have problems with the wireless reception from the Vantage Pro Integrated Sensor Suite (ISS). If you have version 1.7.2 or later of wview, you can access a chart which displays the percentage of successful packets received at: http://[your_weather_site_url]/rxcheck.png. If the graph displays points equal to zero or at very low values, you should investigate why your wireless reception is so poor. Possible solutions include: changing the gain on your VP Console, moving your VP Console to improve reception or perhaps moving your ISS for better reception. 21.5.2 Serial Interface Problems If you see a log message similar to: daemonStartProcState: lat and long failed or periodic logs similar to: wakeupConsole: Read ERROR! or: wakeupConsole: Invalid data: FE 13 (data values "FE 13" will vary) you have a serial interface problem. The best test is to stop wview if it is running and use vpconfig to verify your serial interface. You should be able to run "vpconfig [device] show" repeatedly without any failures being reported (see section 15.6 for vpconfig usage). Possible culprits are: Bad serial cable Bad serial port on your PC Incorrect terminal server settings (when using a terminal server) Improper USB driver installation or operation (if using USB and driver) wview will not work properly without a reliable serial interface. 21.6 WXT-510 21.6.1 Comm Problems If you see error messages like "NMEA: nmea0183Init: XXX failed!" when starting wview, it is a good indication that the comm settings on the WXT-510 have not been set correctly. Be sure you run wxt510config BEFORE your first wview start. wxt510config searches through all possible comm setting combinations until it "fimds" the WXT-510, then it sets the comm parameters properly for wview. 21.6.2 Sensor Problems If you see an error similar to: "NMEA: nmea0183GetReadings: 0x7FC1: not all sensors updated..." then there is the possibility that the THP sensor connector header under the very top of the WXT-510 is not making good contact. You can remove the long screws which hold the entire station together then remove the 3 very small screws which retain the upper PCB cover. Take care to mate the small header in the middle well then hold the cover in place while screwing the retaining screws back in. Make sure you do not dislodge the ribbon cable connections. 21.7 Using raddebug raddebug is a general debug utility which is installed when you install radlib. It can be used to display semaphore usage, buffer usage and radmrouted statisitics: # raddebug 1 /var/wview It will output something like: Attached to radlib system 1: UP 0 years, 0 months, 0 days, 5 hours, 17 minutes, 26 seconds Buffer Allocation by Size: Dumping index 0: size 64: Free/Total 64/64 Dumping index 1: size 128: Free/Total 128/128 Dumping index 2: size 256: Free/Total 244/256 Dumping index 3: size 512: Free/Total 256/256 Dumping index 4: size 1024: Free/Total 128/128 Dumping index 5: size 2048: Free/Total 64/64 Dumping index 6: size 4096: Free/Total 32/32 Buffer Summary: Total Free: 916 Total Allocated: 12 Total Allocations Since Started: 121628 Semaphore Info: INDEX COUNT WAITERS ZCNT PID 0 0 0 0 0 1 0 0 0 0 2 1 0 0 63615 3 0 0 0 0 4 1 0 0 61597 5 0 0 0 0 6 0 0 0 0 7 0 0 0 0 8 0 0 0 0 9 0 0 0 0 10 0 0 0 0 11 0 0 0 0 12 0 0 0 0 13 0 0 0 0 14 0 0 0 0 15 0 0 0 0 raddebug[63615]: <3310611880> : radlib: raddebug started ... Dumping message router stats to the system log file... Then view the message router (radmrouted) statistics: # tail -n 40 -f /var/log/messages With output like: raddebug[63615]: <3310611880> : radlib: raddebug started ... radmrouted[61576]: <3310611917> : ---------- Message Router Totals: TX:0000001851 RX:0000001662 ---------- radmrouted[61576]: <3310611917> : Name MSGS TX MSGS RX TXERRS RXERRS radmrouted[61576]: <3310611917> : -------------- ---------- ---------- ---------- ---------- radmrouted[61576]: <3310611917> : wviewd 1021 641 0 0 radmrouted[61576]: <3310611917> : wviewsqld 1 64 0 0 radmrouted[61576]: <3310611917> : wvalarmd 1 318 0 0 radmrouted[61576]: <3310611917> : htmlgend 637 700 0 0 radmrouted[61576]: <3310611917> : wvcwopd 1 64 0 0 radmrouted[61576]: <3310611917> : wvwunderd 1 64 0 0 radmrouted[61576]: <3310611917> : raddebug 0 0 0 0 radmrouted[61576]: <3310611917> : --------------------------------------------------------------------------