I use interceptor and I have my router do the internet portion of the
equation. The way I implimented it is with firewall rules on my router.
When my WS-1400-IP sends his data to wunderground my router makes a copy of
the packets and sends them to my weewx computer.
If your WS2902 communicates with wunderground directly from your router
over WiFi then the router is the logical first opportunity to duplicate and
redirect the copy of the data. I have no idea if the Asus rt-a66u running
stock software has provisions for 'ip tables' but you can load DD-WRT
software on that model and it can do it. Switching the OS that is running
on your router IS NOT TRIVIAL!
At any rate the firewall rules I use with DD-WRT are as follows,
iptables -t nat -A PREROUTING -s 10.10.100.72 -p tcp --dport 80 -j DNAT
--to-destination 10.10.100.13:8099
iptables -t nat -A POSTROUTING -j MASQUERADE
My WS-1400-IP device has IP address 10.10.100.72
My weewx computer has IP address 10.10.100.13
My router changes the destination IP and port, my examples use 8099.
My weewx.conf file has the following interceptor settings,
[Interceptor]
# This section is for the network traffic interceptor driver.
# The driver to use:
driver = user.interceptor
# Specify the hardware device to capture. Options include:
# acurite-bridge - acurite internet bridge
# observer - fine offset WH2600/HP1000/HP1003, aka 'observer'
# lw30x - oregon scientific LW301/LW302
# lacrosse-bridge - lacrosse GW1000U/C84612 internet bridge
device_type = observer
port = 8099
There is another way to use interceptor in sniff mode but I think it requires
different firewall rules.
If your stock router uses 'iptables' you can try the lines I used just replace
the IP addresses with whatever you are using.
Change the device_type in your weewx.conf to whatever is apropriate for your
device.
Beware! the firewall rules use fixed IP addresses.
If you use DHCP on your router it is necessary to make sure your router always
gives the same IP to your 2902 and your PC running weewx.
The solution is to add Static Leases to your DHCP server on your router for the
2902 and weewx respectively.
If you don't do this and one of the devices gets a different address it can be
"level 3 fun" figuring out why something stopped working when you did not
change anything.
If you choose this method and it does not work right away you can use
wireshark on the weewx PC and sniff packets to verify that the router is
working as expected. Don't forget to verify that the data is still going to
a remote destination if that is what you want.
It is also possible with firewall rules to NOT send the data directly to
wunderground etc.
That way weewx can do whatever you choose with the data and send that out.
:-)
Hope this helps! :-)
On Wednesday, January 22, 2020 at 9:36:46 PM UTC-6, Christopher Lanus wrote:
>
> hello there, i recently got an ambient weather 2902 station, and am
> interested in storing my data locally, which brought me to weewx, and
> eventually here.
>
> i've done a fair bit of reading/experimenting, and am still unable to
> intercept my weather data. i'll do my best describing what my setup looks
> like:
>
> - weather station up and running, connected to wifi,
> - reporting data to ambient weather and wunderground.
> - have wunderground station id
> - have a record of this station's local ip in my network
> - weewx installed on rpi3 running raspian (via [[
> http://weewx.com/docs/debian.htm][debian instructions]])
> - this pi is also running owncloud, served by nginx on ports 80/443
> - this pi has a static ip
> - interceptor driver installed via [[
> https://github.com/matthewwall/weewx-interceptor][its github]]
> - pihole running on a pi zero
> - this pi has a static ip
> - my router (asus rt-ac66u) uses this pi as its dns server
> - i have noted that my station makes regular calls to `time.windows.com`
> - and only infrequent to `rtupdate.wunderground.com`
> - i have updated the `/etc/hosts`, adding records to resolve both `
> time.windows.com` and `rtupdate.wunderground.com` to the ip running weewx
> - i have configured weewx.conf
> station_type = Interceptor
> ...
> [Interceptor]
> driver = user.interceptor
> device_type = observer
> port = 9000
> ...
> [[Wunderground]]
> enable = true
> ..
>
>
> - i have started/restarted weewx daemon
> - i have manually run interceptor
> - do not see any traffic
> - however, when i manually hit my weewx machine's ip on port 9000, i see
> it logged in my terminal
> - running `journalctl -u weewx.service`, i've seen the following messages:
>
>
> Jan 21 21:32:28 cql-server weewx[5408]: restx: Wunderground-PWS: Data for
> station KILLAGRA32 will be posted
> Jan 21 21:32:28 cql-server weewx[5408]: restx: PWSweather: Posting not
> enabled.
> Jan 21 21:32:28 cql-server weewx[5408]: restx: CWOP: Posting not enabled.
> Jan 21 21:32:28 cql-server weewx[5408]: restx: WOW: Posting not enabled.
> Jan 21 21:32:28 cql-server weewx[5408]: restx: AWEKAS: Posting not enabled
> .
> Jan 21 21:32:28 cql-server weewx[5408]: engine: Starting up weewx version
> 3.9.2
> Jan 21 21:32:28 cql-server weewx[5408]: engine: Starting main packet loop.
> Jan 21 21:47:16 cql-server weewx[5408]: cheetahgenerator: Generated 8
> files for report SeasonsReport in 3.75 seconds
> Jan 21 21:47:17 cql-server weewx[5408]: imagegenerator: Generated 14
> images for SeasonsReport in 1.04 seconds
> Jan 21 21:47:17 cql-server weewx[5408]: copygenerator: copied 5 files to /
> var/www/html/weewx
> Jan 21 21:50:04 cql-server weewx[5408]: manager: Added record 2020-01-21
> 21:50:00 CST (1579665000) to database 'weewx.sdb'
> Jan 21 21:50:04 cql-server weewx[5408]: manager: Added record 2020-01-21
> 21:50:00 CST (1579665000) to daily summary in 'weewx.sdb'
> Jan 21 21:50:06 cql-server weewx[5408]: cheetahgenerator: Generated 8
> files for report SeasonsReport in 1.26 seconds
> Jan 21 21:50:07 cql-server weewx[5408]: imagegenerator: Generated 14
> images for SeasonsReport in 0.98 seconds
> Jan 21 21:50:07 cql-server weewx[5408]: copygenerator: copied 0 files to /
> var/www/html/weewx
> Jan 21 21:50:21 cql-server weewx[5408]: restx: Wunderground-PWS: Failed
> to publish record 2020-01-21 21:50:00 CST (1579665000): Failed upload
> after 3 tries
>
> at this point, not sure what else i should be doing - any help would be
> much appreciated.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/c7438513-043f-4cd0-b4a7-d34a961a5715%40googlegroups.com.