Featured Whitepapers
Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

An instrumentation network for weather data on the Web

Use Java to display data from realtime devices to Web browser clients

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
This is the first installment in a series of Java Developer columns devoted to the concept of instrumentation over the Web. This month we'll build a low-cost weather station and interface it to the Web. First, we'll introduce the concepts of building Web-based data collection, monitoring, and control systems. Next, we'll present an application, the 1-wire weather station, that uses Java servlet technology to post weather data to a Web server. This will be followed by a discussion of how to use Java to build systems with similar and/or different requirements. We'll point you to established and recognized sources of expertise on the Web that are already running weather data but that don't use Java. You can judge for yourself whether using Java technology could improve the current status quo.

In this article we'll also lay the groundwork for new combinations of Java technology -- for example, XML and object stores -- so that low-cost, easy-to-maintain systems for storing large amounts of time-varying data can be understood and prototyped. We'll cover this theme in greater detail in future articles in this series, introducing Jini implementations and embedded-server versions, as well as introducing an authenticated interface to home-automation devices, which you will actually be able to build yourself. So, if you forget to turn the air conditioner on or want to change the thermostat, with just a few bucks and the information in these upcoming articles, you'll be able to do these things securely with Java technology.

Enabling devices for the Web really does create new services. We aren't talking about making your printer Internet-aware or using your PalmPilot to browse the Web; we're talking about smaller things, like pool temperatures, door locks, weather data -- actually, more data than we can list here -- that could be used by factories and business offices with geographically dispersed locations. The most common example of this is a WebCam. If you've never seen a WebCam, we've included a URL for one in the Resources section. Cameras are easy to interface because well-defined interfaces already exist for them. What if you were asked to make the services or data from some other device available on the Web? Common wisdom in the past has been to connect instrumentation to private networks. This article explores this huge new growth area for Web-based interfaces using Java and Jini. How would you do it? That's the question we'll start to answer in this series. To bring this home, we'll provide code examples that can be used with a real device. This article demonstrates how to interface Dallas Semiconductor's low-cost weather station to the Internet so that data from this weather station is available around the clock to interested Web users.

The article is divided into five parts:

  • An introduction to the weather station

  • Building the weather station

  • Posting realtime weather observations to a weather servlet (a Dallas Semiconductor example of an application using servlets)

  • A code example for a simple Swing application using the Dallas Semiconductor weather station API

  • Going forward


Before we launch into a discussion of these four issues, it's important to provide an explanation of realtime data collection and how Java enables this -- a central concept behind the weather station application presented in this article.

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources
  • For the weather station sample code, just go to the following URL and click on "Attention Programmers!" http://www.ibutton.com/weather
  • Or you can go to ftp://ftp.dalsemi.com/pub/auto_id/public/iButtonTMEXJava0-01.zip
  • "The 1-Wire Weather Station," Dan Awtrey (Sensors, June 1998) In-depth technical breakdown of the 1-wire weather station http://www.sensorsmag.com/articles/wir0698.htm
  • Rinaldo has installed the weather station at his home. You can link to it at http://www.digiorgio.com:8090
  • For more information on building the weather station, see http://www.ibutton.com/weather/assembly.html
  • The chips used to build the weather station are described here http://www.javaworld.com/jw-05-1999/javadev/Chips.html
  • General reference for all weather station issues, source code for the Java command line and Swing interface version, and source code for the Java servlet version http://www.ibutton.com/weather/index.html
  • Pushing weather products over an HTTP pipe http://zowie.metnet.navy.mil/~spawar/JMV-TNG/
  • Sun Labs. Creator of the small embeddable Web server for research http://www.sunlabs.com/
  • Making money on the weather http://biz.yahoo.com/apf/990310/farm_scene_1.html
  • "Delivering Weather Up to the Second," Associated Press (Salt Lake Tribune, March 1999) This article discusses the concept of weather for sale http://www.sltrib.com/1999/mar/03201999/business/91771.htm
  • "A Conversation with Bill Joy" (Sun Journal) Bill Joy provides an excellent introduction to the Jini technology philosophy with a good list of books at the end http://www.sun.com/SunJournal/v2n3/EmergingTech.html
  • "Java gets serial support with the new javax.comm package," Rinaldo Di Giorgio (JavaWorld, May 1998) The weather station software above uses javax.comm, which Rinaldo discussed in May 1998 http://www.javaworld.com/jw-05-1998/jw-05-javadev.html
  • "Java and the real-time industry," Rinaldo Di Giorgio (JavaWorld, August 1996) Rinaldo's Java Developer column on realtime embedded systems and TRON gives you an idea of how far things have come with Jini. It applies applications of Jini to the problems currently being solved with custom solutions http://www.javaworld.com/jw-08-1996/jw-08-javadev.html
  • Realtime devices really do have constraints that Java needs to address. Sun has helped create a group to do this http://www.javasoft.com/features/1998/11/realtime.html
  • "XML for the absolute beginner," Mark Johnson (JavaWorld, April 1999) A head-to-toes look at XML http://www.javaworld.com/javaworld/jw-04-1999/jw-04-xml.html
  • Read the previous Java Developer columns http://www.javaworld.com/topicalindex/jw-ti-javadev.html