Hi @ all,
I just managed to hook into the data sent from my affordable weather station and get the data into weewx. It took me quite some time and I read a lot along the way. I am using a raspberry but most things will be similar on other OS https://github.com/weewx/weewx/wiki/Raspberry%20Pi.
I hope I can provide some knowledge base that might encourage others to get their data away from data hogs like wunderground.com (.csv export option was removed recently). Btw I you want to use a awesome community founded weather app and website use windy.com !
But back to Weewx. From the Weewx site http://weewx.com/docs/usersguide.htm#about
WeeWX is software, written in Python, that interacts with a weather station to produce plots, reports, and HTML pages. It can optionally upload the reports to a remote Web server as well as publish to weather services such as WeatherUnderground, CWOP, or PWSweather.com.
Initial development began in the winter of 2008-2009, with the first release in 2009.
The source code is hosted on GitHub, while downloads are available at weewx.com/downloads.
WeeWX is about 13,000 lines of code, plus another 13,000 for the drivers for all the types of supported hardware.
There are many stations that are supported by Weewx drivers while others are not.
If your station is not supported you have several options to get the data.
Question 1: can you set a sever IP and Port or is there only 1 fixed server in the station?
- if you can set a different IP and Port you are lucky
- you can install weewx and the interceptor driver https://github.com/matthewwall/weewx-interceptor and use the lister mode
driver = user.interceptor device_type = observer port = 8000
Problem 1: IP can not be set
- this makes it a bit more difficult but still possible
- you can try to telnet into the wifi or lan connected module
- for example depending on the station https://obrienlabs.net/redirecting-weather-station-data-from-observerip/
Problem 2: IP can not be set
- option: you can install weewx and the interceptor driver https://github.com/matthewwall/weewx-interceptor and use the sniff mode/ package capture
- Example: sniff mode for any WU client
This example assumes two network interfaces on the computer running weewx. 1) Plug the computer into the local network using the first interface (eth0). Plug the device into the second interface (eth1). Bridge the two network interfaces. If you run any web services on the computer, configure them to listen on interface eth0, not eth1. 2) Set parameters in the weewx configuration file. The device has IP address of X.X.X.X [Interceptor] driver = user.interceptor device_type = wu-client mode = sniff iface = eth1 pcap_filter = src X.X.X.X and dst port 80
Problem 3: it still does not work
- Redirect traffic using a router and iptables
- see how https://obrienlabs.net/redirecting-weather-station-data-from-observerip/
How do you know you are getting data:
in the weewx.conf file you set the report to 1 to get a more detailed flow of data http://www.weewx.com/docs/usersguide.htm#monitoring
with: tail -f/ var/log/syslog or /var/log/syslog you should see data coming in
another option is to install Cumulus Real Time https://github.com/weewx/weewx/wiki/crt
this will create a always current .txt
Once everything works fine you might be thinking how great it would be to get the data into farmOS!
So what could be the options to get data into farmOS?
Some ideas not sorted for feasibility:
- set a cron job to transfer realtime.txt data into farmOS see here http://landoflinux.com/linux_raspberry_pi_weather_station.html
—> this might be one option to get the data into farmOS however realtime.txt is updated regularly and all old data is overwritten so if a package is dropped its gone
- Weewx is hard on SD cards run on PI’s so you can send log files to a remote syslog server
down this page this option is explained https://github.com/weewx/weewx/wiki/Minimize-writes-on-SD-cards
this might be a pretty good option to get the data into farmOS however ideally it would also still be stored in the Weewx database for Reports that you can view in a browser or make available on your website
- there is also an option to the data to a remote sever via FTP but I cant find it at the moment
I hope this helps the community to either run their own weather station with Weewx or start up the integration of Weewx data into farmOS