Weather.py

Weather.py listens to a KOB wire (currently wire 106), and waits for a user to send a request message on that wire. The program responds by sending the current weather conditions and the short range forecast for the location requested by the user.

How to use the KOB weather service

Connect to wire 106, open your key, send your request, and close your key. The format of the request message is as follows:

I xx WX ssss

where xx is your office call, and ssss is the 4- or 5-character station ID code for your nearest National Weather Service observation station (often, but not always, an airport). For example, if I wanted the weather report for Seattle, I would send

I AC WX KSEA

After you close your key, the KOB weather service responds with the current weather conditions at that location, followed by the forecast for the next two time periods (e.g. today and tonight, or tonight and tomorrow). The weather service replies at the same code speed that you send your request message. Here's a typical reply:

WX FOR SEATTLE = NOW MOSTLY CLOUDY AND 67 DEG = THIS AFTERNOON. SUNNY, WITH A HIGH NEAR 80. NORTHWEST WIND AROUND 7 MPH. = TONIGHT. MOSTLY CLEAR, WITH A LOW AROUND 59. NORTH WIND 2 TO 7 MPH. = 30

To determine the station code for a particular location, go to http://www.weather.gov/ and enter the location in the search box in upper left part of the page. The station code appears within parentheses below the line reading "Current conditions at" in the upper left part of the page.

Helpful hints

  1. Make sure that the KOB weather service is connected to the weather wire before sending your request. If it isn't in the list of connected stations, it means the service is not in operation and you won't receive a reply.

  2. The program is designed to handle code speeds from 15 to 30 wpm.

  3. Send all the letters in your request message at roughly the same speed, without excessive space between the dots and dashes. You can leave as much space as you like between letters, however. So, IAC WX K S E A will be interpreted exactly the same as I AC WX KSEA.

  4. If you make your L's too long, the program may misinterpret them as key closures and assume that it's the end of your message. Make your L's long enough to distinguish them from T's, but not so long as to trigger a reply.

  5. If you make a mistake, don't close your key but simply send a question mark and start over (either from the I or from the WX). When you do close your key, the program checks to see if the last six or seven characters of your message are WX followed by a valid ID code for a weather observation station.

  6. If the KOB weather service doesn't understand your request, it will reply with a question mark, followed by what it thinks you sent, followed by another question mark. Note: this reply is sent without spaces between the letters. This is normal.

  7. When the weather service receives a Morse character that it doesn't recognize—something that would normally display in the MorseKOB reader window as periods and hyphens within square brackets—it returns E's for dots and T's for dashes, all within Morse quote signs (QN, QJ).

  8. If the weather service sees that one or more packets were dropped somewhere in the network, the missing character(s) are flagged in the error message by a question mark within quote signs (QN ? QJ).

  9. To make it easier for the weather service to correctly interpret your request, try adding a little extra space between the letters.

How it works

If you're interested in the gory details, see Weather.py: How it works.