Tuesday, September 25, 2018

Building a Weather Station - Part 1

I have wanted to build a weather station for a while but have never had a location to put one. I still don't, in fact where we are now is the worst possible location due to the surroundings, but I'm hoping that I can build one for one of the local boating places.  Actually I hope I can find a home for the one I've already built!

 Here is a diagram of what I have built.
  1. Instruments include (wind speed, wind direction), (rainfall), (temperature, humidity), and (barometric pressure).  Wiring = (4 wire RJ11), (2 wire RJ11), (Grove Cable), (Onboard)
  2. Instruments are connected to a board from SwitchDoc called the Weather Plus that has a microprocessor with a Wifi adapter (programmed using the Arduino IDE).
  3. Weather data is available either via an Http interface or via a stream from the onboard serial port.  I elected to integrate with both to test reliability.
  4. A Raspberry Pi Zero is used to interrogate the Weather Plus board to feed an instance of Weewx, a popular open source weather station package.
  5. A webcam could also be supported in a follow-on phase.
  6. Weewx integrates, out of the box, with both the Weather Underground and with Windguru.
  7. Additional resiliency might be provided, in a follow-on phase, by adding a monitor capable of power cycling the entire platform (Arduino with a relay)
 The most challenging aspect of the configuration is building for resiliency. This is what I am testing now:
  • Single Http (Read) Error
    • Wait one minute, try again
    • Cleared on next good read
  • Five Http Errors
    • Reset WeatherBoard
    • Sleep for five
    • Cleared in ten minutes
  • Five more Http Errors
    • Reboot
  • Five more Http Errors (Phase 2)
    • Power cycle WeatherBoard
    • Sleep for five
  • Handled by a "Monitor"
  • Watch time stamp of “lastActive” file created by toWeewx on every update created
    • If it does not change in 15 minutes reboot (5 for the serial interface)
    • Cant use the feeder file between toWeewx and Weewx as it is touched by both sides