Building a Web Weather Station
Last fall, my family and I moved from central Iowa to the little mountain resort town of Estes Park, Colorado. Estes Park is a beautiful town at the east entrance of Rocky Mountain National Park. More than three million tourists visit the park each summer.
When we moved here, I brought along my fledgling consulting business, Daylight Software, and set up web pages to drum up a little work. In a flash of inspiration, I decided I would either buy or build weather station equipment and offer weather data on the Web. Visitors from around the nation—and the globe—would see my web pages, and Daylight Software would be established as a Linux consulting powerhouse. Well, maybe it wouldn't lead to global domination, but it would surely be a good thing. I saw it as a community service, since no public weather reporting service was available, other than the time and temperature sign on one of the local banks.
After some investigation, I decided that my hardware development skills were not sufficient to design and build weather sensors. I shopped around and eventually purchased a Texas Weather Instruments “Weather Report” WRL-25 system from American Weather Enterprises of Media, PA (http://www.americanweather.com/).
The WRL-25 is like many weather stations in that it includes an RS-232 connection and comes with DOS/Windows software for downloading and viewing the gathered data. It has sensors for wind speed, wind direction, temperature, humidity, atmospheric pressure and rainfall. Using a regular television antenna mast and fittings, I mounted the weather station sensors on the roof of my house, snaking the sensor cables through the attic space and down to my office in the basement. I mounted the handsome display unit on a shelf in the office.
Across the room from the weather display is my array of computers, including my Linux workstation. I am running the Red Hat 4.0 Colgate release, 2.0.18 kernel, on my AMD 486DX-4 120MHz ISA server. I built a cable and attached the weather display to the Boca AT-66 serial card in the server. I then wrote some Perl scripts to build HTML and GIF files and upload them to my ISP, and to manage the data readings put out by the weather station.
The sensors are mounted on two ten-foot sections of steel TV antenna mast, available in the U.S. from stores such as Radio Shack. Approximately four feet are buried in the ground, and the rest of the mast is vertical at the gable end of our single-story house. The mast is attached with a TV mast bracket at the roof line of the house. About six feet of mast projects above the roof line.
The sensors came supplied with clamps and hardware to attach them to the mast. (See Figure 1.) I followed the installation instructions and mounted the wind direction/speed sensor module pointed north at the top of the mast. The temperature and humidity sensors are in a “pagoda” enclosure to protect them from direct sunlight, and the pagoda is mounted about three feet above the roof line. The rain collector is mounted at the roof line; I used a carpenter's level to mount it properly.
Multi-wire cables from the sensor modules go into the bottom of the junction box, where they are plugged into matching connectors from 100-foot cables which run to the weather display unit. (See Figure 2.) All excess cable is coiled up and attached securely under the eave. Cables going into the junction box were left drooping slightly, to encourage rain to drip off instead of flowing into the junction box.
The 100-foot cables run through the attic and out through a hole at the peak of the eave. The hole was later filled with caulking to discourage squirrels and other pests from getting in. From the attic, I drilled a hole in the top plate of an interior wall and snaked the cables down to the basement. A fancy wooden switchplate made for cable TV installations serves to mask the hole where the cables come through the wall into my office/computer area. The cables connect to the back of the WRL-25 display unit.
I ended up crawling through the blown-in fiberglass insulation in the attic more times than I care to remember. If you do this, be careful—wear a dust mask or respirator and long sleeves and trousers. The attic was hot. I considered this to be the most difficult part of the installation.
I had to set the current time on the display unit and change some of the option settings. Other than that, the sensors and other features of the WRL-25 were all calibrated and ready to run.
On the back of the display unit is a 9-pin serial pigtail. The WRL-25 came with a mix-and-match 4-ended 25 and 9 pin serial cable for adapting to whatever connectors are available. I did not use that particular cable. My Boca Io-AT-66 six-port serial card uses RJ-45 sockets for its connections. So, I made a cable from a ten-foot scrap of eight-wire twisted pair that already had an RJ-45 connector crimped on one end. Pin assignments and wiring information were included in the Io-AT-66 documentation.
The WRL-25 can be programmed to periodically send a status report over the serial line. This can be used to print directly on a serial printer. I programmed my unit to send a reading every 5 minutes. I also changed an optional setting to allow the rainfall rate report and to print a daily Max/Min report at the end of each day. I set the serial line data rate to 9600bps.
The unit can also be directed using single-character commands through the serial connection. I rarely use this feature. The PC software that came with the unit can be used to set various options and settings, as can the buttons on the display panel. So, more sophisticated programming could be used to query the unit on demand or change various features. I elected to use the simple logging feature to gather my data.
I was able to run a quick test on my setup by using the following command:
cat < /dev/ttyS19
This command takes any input appearing on the /dev/ttyS19 serial line and echoes it to the screen. Pushing the manual report button on the WRL-25 produced a one-line report on the screen. I was a happy camper!
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Stunnel Security for Oracle
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- SUSE LLC's SUSE Manager
- SourceClear Open
- Managing Linux Using Puppet
- My +1 Sword of Productivity
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide