1-Wire Weather Service for Java

Weather Service and Real-Time Monitoring

Overview
The 1-Wire Weather Service for Java collects data from the Dallas 1-Wire weather instrument and related 1-Wire sensors using the Dallas 1-Wire API for Java SDK. The WxMonitor allows you to view and control the 1-Wire Weather Service for Java. It displays wind speed and direction, temperature, dew point, humidity, air pressure and rainfall.

The WxMonitor Splash Screen

This is the most reliable 1-Wire Weather software available, featuring extreme fault tolerance on the 1-Wire MicroLan -- even in high RF environments. Also features laboratory grade precision, with extensive configuration capability, to support a wide variety of data recording and reporting modes. A modular architecture provides the ability to support new sensor types as they become available, or on request as the need arises. With a fully documented API, you can even code support for new devices yourself if you have Java coding skills.

Since this software is written in the cross-platform Java language, it should run on any platform for which 1-Wire drivers are available -- now with 64-bit support. It is known to run on Windows XP, Windows Vista, Windows 7, 8, 10 & 11, and Linux. Please contact me if you would be interested in testing on other platforms.

I have been working on this project as a hobby in my spare time over the past couple of years. I have been interested in the weather ever since I built my first weather station for a science fair in the seventh grade. This project integrates my interest in weather with my interests in electronics and software.

Download
This software is provided for free, as-is, no warranty. Please refer to the specifications below for compatibility requirements before you download the latest version (zip file), and you can view the documentation.

To install on Windows systems, extract the file into the Program Files directory. On non-Windows systems, extract the file into the directory you want to use as the root for the application. After extracting the software, please refer to the readme.html file contained in the wxservice directory for detailed setup and operating instructions.

On Windows Vista and Windows 7, you might have problems unpacking with zero length files using Windows compressed folders. You might try WinZip. You need to have administrator rights to install into the Program Files directory. WxServer writes logs to "user.home" for the default user, unless you create a user for running the service, and tell Windows Service Control Manager to start WxServer as that user (recommended). WxMonitor stores user data, e.g., rainfall data in "user.home" for each individual user who runs it.

Latest Updates
I post update notices on the site blog along with the latest news and tech notes about the 1-Wire Weather Service for Java. You can subscribe to the RSS feed for automatic update notifications.

Specifications
The 1-Wire Weather Service for Java works with the following sensors, technologies and platforms:

Weather Instrument Cluster TAI8515 1-Wire Weather Instrument Kit V3.0
WS603 1-Wire Weather Instrument Kit
Hygrometer & Thermometer TAI8540A 1-Wire Humidity Module
Hobby Boards HTS3-R1-A Humidity/Temp/Solar
Barometer & Thermometer TAI18570 1-Wire Pressure Sensor
Hobby Boards B1-R1-A Barometer
Rain Gauge TAI8575B 1-Wire Rain Gauge or any other tipping bucket device based on the DS2423 counter IC.
Technology Dallas 1-Wire MicroLAN
Platform Any platform supporting Java 1.6 or higher with Dallas 1-Wire TMEX drivers
Publishing Weather History Weather Underground, CWOP, CSV file, Web Service (see below)
Graphical User Interface WxMonitor, local or remote real-time display (see below)

The WxService
The 1-Wire Weather Service for Java collects data from the Dallas 1-Wire weather instrument and related 1-Wire sensors using the Dallas 1-Wire API for Java SDK. WxService can run in two modes: As a Windows service or Unix daemon, or embedded in an application.

WxService can post the following data to Weather Underground Data Exchange (rapid fire every five seconds, or regular every ten minutes). Units, posting interval and averaging window are all separately configurable. These are the standard defaults:
  • Wind Speed -- Average value over the previous two minutes (regular), or current value (rapid fire)
  • Wind Gust -- Peak value over the previous ten minutes
  • Wind Direction -- Vector averaging over the previous two minutes
  • Temperature -- Average value over the previous two minutes
  • Dew Point -- Average value over the previous two minutes
  • Humidity -- Average value over the previous two minutes
  • Barometer -- Average value over the previous two minutes
  • Rainfall -- Rate per hour and accumulated since midnight
WxService can post the following data to APRS Citizen Weather Observer Program (CWOP) every thirteen minutes. Units, posting interval and averaging window are all separately configurable. These are the standard defaults:
  • Wind Speed -- Average value over the previous two minutes
  • Wind Gust -- Peak value over the previous ten minutes
  • Wind Direction -- Vector averaging over the previous two minutes
  • Temperature -- Average value over the previous two minutes
  • Humidity -- Average value over the previous two minutes
  • Barometer -- Average value over the previous two minutes
  • Rainfall -- Rate per hour and accumulated since midnight
WxService can post the following data to a local history text file in comma separated values (CSV) format every ten minutes. Units, posting interval and averaging window are all separately configurable. These are the standard defaults:
  • Wind Speed -- Average value over the previous two minutes
  • Wind Gust -- Peak value over the previous ten minutes
  • Wind Direction -- Vector averaging over the previous two minutes
  • Temperature -- Average value over the previous two minutes
  • Temperature 1 -- Average value over the previous two minutes
  • Temperature 2 -- Average value over the previous two minutes
  • Humidity -- Average value over the previous two minutes
  • Dew Point -- Average value over the previous two minutes
  • Barometer -- Average value over the previous two minutes
  • Rainfall -- Rate per hour and accumulated since midnight
WxService provides access to real time weather data by publishing a SOAP web service. WxMonitor can connect to this web service to display the data in real time from anywhere on the Internet.

The WxMonitor
The monitor allows you to view and control the 1-Wire Weather Service for Java. It displays wind speed and direction, temperature, dew point, humidity, air pressure and rainfall.

Monitor for the 1-Wire Weather Service for Java
WxMonitor Application Screen Shot

The Wind Vector display, instead of the usual dials, dominates this program's user interface. There is a lot of information at a glance here. The outer ring shows wind direction, the line emanating from the center of the chart graphically indicates current speed and direction. The longer the line, the higher the wind. The blue lines represent the 10-minute average wind speed (configurable). They remain on the chart for 24 hours (configurable), so by default you can see a 1-day history of the wind activity.

I plot the wind speed on a logarithmic scale, so that it isn't necessary to rescale the chart when the wind changes. The logarithmic characteristic magnifies light air, but has enough dynamic range to show strong winds in excess of 200 mph.

Below the wind vector chart, I placed a table containing miscellaneous wind data, including average speed in numerical format, the maximum peak wind since the last reset, Beaufort wind index, the direction in degrees and the compass heading. The reset button at the bottom sets the gust and lull values to the current value.

The rest of the indicators are standard linear sliders, calibrated to show the full range of data, like a "real" thermometer. The table at the bottom contains a summary of the data in numerical format. The reset button at the bottom sets the maximum and minimum data to the current value for each associated sensor.

The sampling and averaging intervals are configurable. The defaults are typical for METAR style observations:

  • Wind Speed -- Average value over the previous two minutes
  • Wind Gust -- Peak value over the previous ten minutes
  • Wind Direction -- Vector averaging over the previous two minutes
  • Temperature -- Average value over the previous two minutes
  • Dew Point -- Average value over the previous two minutes
  • Humidity -- Average value over the previous two minutes
  • Barometer -- Average value over the previous two minutes
  • Rainfall -- Rate per hour and accumulated since midnight

WxService Operational Configurations
WxService can run in two modes:

  • Web Service – publish WxService on the Internet. Uses JAX-WS. The Web Service Description Language (WSDL) file describes this web service. The schema describes data structures referenced in the WSDL.
  • Embedded in a stand-alone application (inproc) – this very simple configuration allows everything to run on a single computer.

WxMonitor Operational Configurations
WxMonitor can run in two modes:

  • A web service client of WxService - Connect to WxService via the web service anywhere on your local network or on the Internet.
  • A stand-alone application - WxMonitor can directly instantiate WxService without remoting, but requires local access to the 1-Wire MicroLan and TMEX drivers.

Extreme Fault Tolerance
Although one would like a 1-Wire network to be relatively error free, that is often not the case. Even implementing all of the recommendations in Guidelines for Reliable 1-Wire Networks, I have found my 1-Wire network to be extremely unreliable. It is very susceptible to slight configuration changes. Reliability seems to change with the phase of the moon. You might expect that a 50KW AM station within a mile of my network would cause problems, and it does. During the day when they’re on full power, several sensors fail more often than not. Even at night, when interference is less, 1-Wire network error rates are still very high.

The 1-Wire protocol was originally designed to extend a few inches. People stretched it to hundreds of feet – far beyond the original design parameters. To expect this thing to be unconditionally reliable is simply not reasonable. The only way to make a reliable system is to compensate, in software, for failures in the hardware. Fortunately, the 1-Wire Network devices provide fairly good error detection using Cyclic Redundancy Checking (CRC). This is where extreme fault tolerance comes in.

WxService retries every sensor access operation for up to ten seconds before giving up and reporting an error. If the first few attempts are successful, then that's great – the system will have excellent performance. On the other hand, if it takes dozens of retries to obtain a reading, the weather conditions will be recorded on schedule, and no readings will be missed. The system will have poor performance, but it will keep working (degrade gracefully). The design is thread-friendly, so if one sensor requires many retries, it will allow other sensors to run between retries. It will not hog the 1-Wire network during the retries.

For optimal performance, the goal is to tune the network to keep retries to a minimum. To allow you to evaluate 1-Wire network health, WxService logs 1-Wire network errors at different verbosity levels. WxService logs sensor initialization failures at the “severe” logging level to indicate that a sensor failed to initialize within the timeout period. WxService logs retry timeouts at the “warning” logging level. Sensors that fail to read will run again at the next scheduled time. WxService logs individual retries at the “fine” logging level, to indicate whether a sensor is having trouble initializing or running.

Event Logging
WxService writes logs to daily log files. There are seven logging "severity" levels: FINEST, FINER, FINE, CONFIG, INFO, WARNING and SEVERE.

As you might expect, FINEST, FINER, and FINE are for detailed tracing and debugging, and may be very verbose. CONFIG is for tracking configuration changes. WxService uses INFO to log informational events, such as starting and stopping the Service and its tasks. WARNING is used to track events that might result in data loss or failure to post to a weather logging service. 1-Wire retry failures, value errors, connection refused to a URL are all WARNINGs. SEVERE is reserved for sensor initialization failures, or situations that would result in termination of the Service, such as out of memory, stack overflow, division by zero or null pointer errors. These are either unexpected or unrecoverable errors.

Software Status
The software is code complete. I make occasional improvements and publish them to the FTP site. Check the blog on the home page for breaking news of updates.

For More Information
You can email me to request additional information about WxService.