Projects

Weather on the boat via weeWX and Ambient

Being a weather nerd for years, having one on the boat has always been a dream. I helped a friend install one on his boat, and had to hack some things together software-wise to make it work.
Steve Mitchell 9 min read
Weather on the boat via weeWX and Ambient

I have been an avid weather geek since 1996 when I got my first crappy weather station with a mediocre outdoor sensor which ate batteries constantly, had a lame indoor LCD panel that showed a few metrics, but no long term history. Over the years, I’ve tried a bunch of different hardware and software combos. The most reliable have been Linux-based software packages with the Davis Vantage Pro series of stations. Recently, I had the chance to visit Steve @ Datawake and he had an Ambient Weather station he was setting up – I found some interesting new information about what used to be a $500+ hobby, and ways to leverage it on the boat. Steve has even more information about the actual installation in his article on microship.com.

Some History

NileWeather.com website

I have a station I have run for ~7 years at our family cabin in Nile, WA at NileWeather.com which I’ve documented on my Weather page. This station is a Davis Vantage Pro 2 unit and started life running wview weather, a fantastic piece of software that has a history back to 2003. I used this software for another Davis Vantage Pro station I ran at my house on Vashon Island, WA for many years. Unfortunately the last release was in 2014, and it stopped active development at that point.

wview required that you compile it from source in most cases, which was a barrier to many people. It was very complex, and difficult to customize. Davis released an Ethernet version of their console sometime in that mix, trying to entice people to post data from their weather stations to a Davis-proprietary website that was ugly and too simple.

Other packages and software out there required a dedicated Mac or PC with crazy esoteric libraries or other funky compromises that I didn’t want to make. Another popular solution is Weather Display which runs best on a PC, and has a hack-y version for Linux. I tried this for a while as well, but the crashes and weird Windows issues were just too much. Plus, the places I ran these stations didn’t have the power or room for a full fledged Windows machine, and administering that remotely was a nightmare.

Outside temp and dewpoint from nileweather.com

Back in 2014, I stumbled across weeWX, weather station software written in Python and very similar to wview, but with a lot more customization, and simpler to run. I converted NileWeather.com over to that system, and haven’t had any major issues since. I was originally using the Davis Vantage Pro Ethernet add-on which started causing connection problems, so I switched back to the factory provided USB cable and have it directly connected to a Linux machine running weeWX.

Wind speed and gust speed from nileweather.com

weeWX is very easy to setup, and has a great set of documentation and support – the user forum is especially helpful. The default weeWX skin didn’t really excite me, but I found a better one called Sofaskin which was a bit more modern. Good quality modern website skins is a huge gap in all of the weather software I’ve ever used, but Sofaskin gets as close as possible.

You can see my data from Nile at the following sites:

Station

I love the Davis Vantage Pro series of stations, but they are nearly $500 for the base hardware. Adding an Envoy ($140) so you can plug it into your computer away from the display panel, or the full solar and heat solution can get you nearer to $1000 for the whole solution. While the station is built to last (I had one for 6+ years in pretty bad conditions without a problem) it makes it hard for many people to afford.

While it is a great station, it is a bit dated. As far as I can tell, they haven’t done any upgrades in at least 8 years, and the control panel above doesn’t get close to the plethora of sleek solutions out there from other vendors.

If you want to choose something less expensive from Davis, you could go with the Vantage Vue, but the display panel is positively ugly.

Steve had done a bunch of research, and ordered the Ambient Weather WS-1001-WIFI  (note: this item is only available from 3rd party sellers as of the writing of this article – see below for an alternative) for around $230.  I ordered a similar package, the Ambient Weather WS-1200 for $249.99. My package includes an additional box that receives weather from the station and has a mini TCP stack to fiddle with.

The station hardware is really nice for the price – it has the outdoor piece with all of the requisite things you’d expect such as anemometer, rain gauge, temperature, and solar and UV sensors (an extra purchase with the Davis), indoor humidity and temperature sensor (nice that it is separate so you don’t have to have it with the panel) and an amazingly beautiful panel running Windows CE!

Datawake’s Ambient Display weather station main panel

Steve has some great photos in his article showing the install and hardware – mine is still in the box waiting for a permanent location. I also am looking at putting one of these at home given how inexpensive and elegant they are.

The Ambient is a version of the Fine Offset stations that many folks like, and they have a built in ability to submit their data to Weather Underground. I recommended that Steve use weeWX instead, which would provide more archival data options, as well as allow him to send data to many other places. However, there were some challenges…

Software

weeWX does not have a native driver for the Ambient Weather stations. After poking around a bunch, I found a few different approaches, but the most reliable seemed to center around intercepting the HTTP GET request from the station and capturing the data locally.

Pat wrote up a great tutorial about Redirecting Weather Station Data from ObserverIPwhich I used as the basis for our solution.

Steve’s station did not include the ObserverIP component (the little black box with the antenna and ports) but that didn’t matter. Here are the basic steps I used:

  1. Configure Ambient Weather panel to send data to Weather Underground. Their manual covers this in pretty good detail. I input the station name and password in their panel even though I knew we would be intercepting the traffic.
  2. Add a DNS entry on Steve’s main router for rtupdate.wunderground.com to point to our local Linux system (192.168.xx.20)
  3. Created a directory and alias on the 192.168.xx.20 webserver for /weatherstation
  4. Placed Pat’s updateweatherstation.php page in /weatherstation, made some changes

This essentially intercepted the HTTP GETs that the Ambient was sending and captured them on the Linux machine via the Apache webserver. Using Pat’s script, I was able to then send the resulting data on to the ncat server he covers in his tutorial, and configure weeWX to pick that data up.

Here’s what I changed in Pat’s script:

if ( ($_GET["ID"] == "YOUR_WUNDERGROUND_USERNAME") && ($_GET["PASSWORD"] == "YOUR_WUNDERGROUND_PASSWORD") ) { //============================================// // Auto send data query right to wunderground // //============================================// $wunderground = file_get_contents("http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?" . $_SERVER['QUERY_STRING']); echo $wunderground;

I removed the above section that provided a level of authentication based on the station ID and password being provided from Ambient. This was causing endless loops and forked processes with my version of PHP and crashed the webserver. I’m not sure why, but will go back and investigate at some point in the future. Instead, I put IP based security on this particular directory so that only the Ambient station could hit this URL.

I also changed this:

$socket .= "txBatteryStatus=".$_GET['lowbatt']; // Last item, no comma

To this:

$socket .= "txBatteryStatus=0"; // Last item, no comma

As the Ambient does not report any sort of battery status, and this was barfing.

For the Apache webserver, you need to create a configuration file to allow the PHP script to run. In my case, we are using apache2 on an Ubuntu distribution, and adding this to /etc/apache2/conf-available as weather.conf, and then running a2enconf weather and restarting the apache server got us up and running.

ScriptAlias /weatherstation/ "/var/www/weatherstation/" <Directory "/var/www/weatherstation/">   AllowOverride None Options None Order   allow,deny   Allow from 192.168.xx.20 </Directory>

Once this was done, and the rest of Pat’s guide followed, we had data flowing into the ncat server and weeWX itself.

weeWX data stream on ncat port

Website

Setting up a website for Steve’s data was easy, and the same as what I did for NileWeather.com, but is still underutilized by many people for sites that don’t have a ton of static content – Amazon S3 buckets.

You can create an Amazon S3 bucket, or file storage repository, and turn the content in that repository into a website with a few simple steps:

  1. Create S3 bucket
  2. Assign appropriate permissions
  3. Buy a domain name
  4. Add domain name to Route 53 (Amazon’s DNS service)
  5. Create records in Route 53 to point to the S3 bucket for the websites addresses

You have a website for a fraction of the cost of running a real server, as long as your content doesn’t require fancy back end processing (like this site using WordPress, etc.).

Amazon has a great tutorial on how to do this.

Now that you have the site setup, you have to get the content there, which is very easy. weeWX has a few different ways of replicating websites to remote servers, but nothing yet for Amazon S3. I hope to suggest or submit code to help add this in the future.

To get started with this piece, you will need the AWS command line tools installed, and then a user who has access to write to the S3 bucket you created above. Once you create the user, you’ll get a user ID and secret key which you can setup on the Linux server by running “aws setup” and choosing the region and other details about your S3 bucket.

Once this is done, you’re ready to replicate your content. You can test it out by running:

aws s3 sync /var/www/html/weewx/ s3://fridayharborweather.com/ --only-show-errors

This is using the AWS command line tools to replicate /var/www/html/weewx/, where the static website is generated by weeWX, to an S3 bucket called fridayharborweather.com and only report if there are errors.

Once that worked, time to add it to cron:

# m h dom mon dow command 7,12,17,22,27,32,37,42,47,52,57 * * * * /usr/bin/aws s3 sync /var/www/html/weewx/ s3://fridayharborweather.com/ --only-show-errors

At this point we have created FridayHarborWeather.com and have weather data updating every 5 minutes a few minutes after weeWX’s scheduled 5 minute update.

Sharing

In addition to creating your own website, weeWX allows you to submit it to a ton of other services. I setup a number of them for Steve’s data, all of which help others find the weather data with the site/app/tools of their choice.

Here are links to Steve’s data:

Conclusions

Weather data is super fun to have, but also useful for many other reasons. We consider the station at our family cabin to be critical to knowing whether things are safe, especially during the winter and power outages.

Having a weather station on a boat might seem like a bad idea – what happens when I leave the dock and the orientation of the wind sensor changes? The data is going to be wrong! Yes, you’re right about that, but you probably leave your boat in the same position moored at your home dock for a large portion of time. The Ambient station consumes hardly any power, and looks really sexy with the color panel while at the dock. Having that data available remotely allows you to check on wind conditions and general temperatures, including inside the cabin, when you’re away. Plus you’re submitting useful data when at the dock that others can rely on. When you’re away from the dock, turn it off to prevent bad data – and when you get to your destination, reorient your sensor and continue.

The Ambient stations make having a weather station super affordable, which is not unique – but the quality of the hardware and the display panel alone are worth far more. I will be installing one on Grace and at home using the same process above within the next week. Having access to real-time weather data at both places will help me plan my activities and make sure things are safe and sound!

Share
Comments
More from SeaBits

Sign up for my newsletter

Get all of the latest delivered directly to your inbox

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to SeaBits.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.