WeeWx integration with custom home-built weather station

470 views
Skip to first unread message

Sean Coston

unread,
Jul 29, 2017, 5:55:27 PM7/29/17
to weewx-user
Hi all. First post here.

I have been on a several month journey of building my own weather station using an  Arduino Mega and an ESP8266 wifi communications module along with a number of sensors.
I have 3-D printed anenometer, wind-vane, and rain-meter parts of my own design and have calibrated these instruments. The data I am getting from my set up seems to be reliable compared to readings from a nearby weather station posted on WU.
Right now, I have the data from the weather station being sent to a very simple web server that I built on a Linux 16.04 virtual machine running on my FreeNAS11 box. I've written a php script that accepts posts from the ESP8266 (data passed to it from the Arduino) and the php script takes live data and constructs a web page that I can access from any browser. The php script also writes posted sensor data to a MySQL database on the Linux server, and queries the same database to receive conditioned data like max/min temps, averaged data, etc. The php script also writes to a "|" (vertical bar) delimited raw data file (similar to that used by WD, and others) that is constantly updated and can be read by any program with simple parsing techniques.

Attached are a screen shot of my webpage, and a copy of my raw data file with some data in it.
My question to this group is, is there any way to "show" custom weather station data to weewx so the robust data display tools can be used? I have had fun up to now, but really don't want to reinvent the wheel when it comes to data display.



I'm not looking for anyone to hold my hand, just to maybe explain how WeeWx gets its data so maybe I can mimic that and thus "present" my data to WeeWx as if it were coming from an already developed weather station platform.

Thanks to anyone responding to this.

Sean


LiveWeatherRaw.txt

Thomas Keffer

unread,
Jul 30, 2017, 9:38:04 AM7/30/17
to weewx-user
Hello, Sean

That's quite an ambitious project you're doing! Sounds like fun.

To start, make sure you take a look at the Weewx Customizing Guide. It explains how weewx works under the hood.

Weewx expects a stream of raw sensor data, while your raw data seems to be a mix of sensor data plus aggregates and historical data. I don't know how wedded you are to your data stream (and underlying MySQL model), but if you are, it could be very difficult to adapt the weewx reporting machinery to it. 

Alternatively, you could keep your database schema, and run weewx in parallel with it. Don't know why you'd want two different databases holding what is essentially the same data, but that would work.

Another approach would be to do ditch your database and PHP script and substitute weewx's logging capability in their place.

The last two alternatives would require that you either write a custom driver, or adapt an existing driver, to log the data coming off the Arduino. See the Customizing Guide for instructions on how to write a custom driver

Give the Customizing Guide a read and think this over. Once you decide what approach you want to take we can discuss the details.

Would love to see some pictures of the hardware you built!

-tk


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Clay Jackson

unread,
Jul 30, 2017, 10:44:44 AM7/30/17
to weewx...@googlegroups.com
Hey, Sean - lots of different ways to accomplish what you're after.  The customization guide is the place to start, and then Matt and others have some great code samples in hit.  I'll send you a snippet I did that grabs the barometric pressure from an AORS string a bit later today

Sent from my iPhone
Clay Jackson

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Sean Coston

unread,
Jul 30, 2017, 10:41:14 PM7/30/17
to weewx-user
Tom,

I discovered the customizing guide after I posted the first post here. Would have looked that over more closely before posting.
I will probably use your first suggestion and run the two databases in parallel as I have actually been having incredible fun engineering all of this and learning to write php, html, javascript/AJAX (most all of my prior coding was in visual basic). My server setup is pretty powerful and memory/processor use will not be a concern so parallel databases sounds like a quick way to get a functioning system and still have the ability to develop my own "system" for fun.

I'll look at writing a custom driver to make a parallel data stream that weewx can use.

The first pic is my prototyping board... three temperature sensors, one with a humidity sensor, one with an atmospheric pressure sensor, light intensity sensor that measures lux, UV index sensor, the analog wind direction sensor, and the two hall effect sensors that are hooked up to the arduino's interrupts (so as not to miss an event).
The second pic is my bastardized radiation shield made from plastic bowls painted flat black on the inside, flat white on top. 

Had fun making parts with Solidworks  software and my 3D printer. Several improvement cycles on most parts, especially the rain meter tip bucket and funnel. Eventually designed something that would fit in a couple of 4" sched 80 PVC coupler fittings.
The wind vane uses a continuous turn potentiometer and is powered with 5 V from the Arduino - the output is 0 to 5 volts and linear around the compass. My original anenometer, the white one, functioned very well but I discovered the shorter arms worked just as well, had less inertial mass to slow down after a gust, and will take up less space at my deployment site.

I plan to place the arduino in a central 3" PVC junction and connect all the elements with 2"PVC to route the signal wire. there will be external supports as well.  Have not full deployed it yet because I am waiting on an arduino screw connection shield to make connecting everything easier. I'll post more pics when it is deployed fully.

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
Message has been deleted

Sean Coston

unread,
Jul 31, 2017, 11:34:01 AM7/31/17
to weewx-user
Tom and Clay,

I just successfully got my driver and live data file up and running. There was a fileparse.py driver that required very little modification. All I had to do was rewrite my own live data file generator to generate an additional constantly updating data stream per  weewx's simple data posting needs.

Now to get that French fellow's template up and running...  ;)

Sean
Reply all
Reply to author
Forward
0 new messages