I got back to this after being away for a while.
Along the way I ran into a number of issues but I think I am pretty close to a working solution now. But I do have a question that maybe some developers can help out with.
The general approach is:
a) capture all traffic coming from or going to the hub
b) for dns responses as to where is mqtt.weatherflow.com, I put in my own IP address (and bump up the ttl value fwiw)
c) I capture all tcp hub data. If any of that data is heading outside my subnet, I drop it (with the dns rewrite most data should now be coming to my own IP)
d) I created an mqtt proxy that listens on port 1883 and gets all the traffic that was originally going to mqtt.weatherflow.com. I process the mqtt traffic to decide what to drop and keep. For what I want to drop I still send the necessary responses back to the hub as if they had gone to mqtt.weatherflow.com. For stuff I do want to send on I create my own link to mqtt.weatherflow.com and send the data on its merry way and then forward the responses back to the hub
In general this works great and my bandwidth is down to about 50MB/month which works for me. Furthermore, I believe WF gets all the relevant data they can benefit from including quick changes in wind direction etc. Clearly other filtering approaches could be employed to further reduce the data but I am trying to get WF to benefit from the weather station too.
If anyone wants details as to how to get this done you can email or call.
The issue I am having is that I am still getting more mqtt disconnects (and new dns requests and mqtt subscribes etc) between the hub and my mqtt server. Generally the drop/disconnect happens right after the hub sends an mqtt ping request even though I immediately respond with an mqtt pingres. The log below shows a few seconds of packets that my mqtt proxy is receiving and what it is keeping and dropping. Towards the bottom you can see the pingreq and then dns traffic. Any help as to what makes the hub want to generate a pingreq (and ignore the pingres) is GREATLY appreciated.
2023-09-06 12:11:34,848 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:34,862 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:37,821 - irricloud - INFO - mqtt publish kept: rapid/ST-00107879 qos: 0 kept: [b'{"serial_number":"ST-00107879","type":"rapid_wind","hub_sn":"HB-001189
00","ob":[1694027456,0.36,254]}|0x5a5cf91d9dd7e202']
2023-09-06 12:11:37,848 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:37,860 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:40,830 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:40,849 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:40,863 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:43,665 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:43,690 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:43,704 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:44,437 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:46,668 - irricloud - INFO - mqtt publish drop: status/HB-00118900 no qos or response
2023-09-06 12:11:46,693 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:46,705 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:49,663 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:49,689 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:49,703 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:52,820 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:52,845 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:52,863 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:54,444 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:55,816 - irricloud - INFO - mqtt publish drop: status/HB-00118900 no qos or response
2023-09-06 12:11:55,841 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:55,853 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:58,656 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:11:58,678 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:11:58,695 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:01,820 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:01,843 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:01,855 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:04,448 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:04,821 - irricloud - INFO - mqtt publish drop: status/HB-00118900 no qos or response
2023-09-06 12:12:04,845 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:04,856 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:07,653 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:07,677 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:07,694 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:10,656 - irricloud - INFO - mqtt publish kept: rapid/ST-00107879 qos: 0 kept: [b'{"serial_number":"ST-00107879","type":"rapid_wind","hub_sn":"HB-001189
00","ob":[1694027489,1.06,206]}|0x5d9cd52b9e576760']
2023-09-06 12:12:10,680 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:10,691 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:13,819 - irricloud - INFO - mqtt full rate: 0.026KB/s tcp rate: 0.021KB/s udp_traffic_len: 4034 traffic_len: 17875
2023-09-06 12:12:13,822 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:13,845 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:13,858 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:14,456 - irricloud - INFO - mqtt publish kept: rapid/ST-00107879 qos: 0 kept: [b'{"serial_number":"ST-00107879","type":"rapid_wind","hub_sn":"HB-00118900","ob":[1694027495,0.73,153]}|0x2b1ee69e1998ec1b']
2023-09-06 12:12:16,654 - irricloud - INFO - mqtt publish drop: status/HB-00118900 no qos or response
2023-09-06 12:12:16,688 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:16,696 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:19,655 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:19,677 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:19,689 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:21,061 - irricloud - INFO - mqtt publish drop: rapid/ST-00107879 no qos or response
2023-09-06 12:12:31,071 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 qos: 1 packet_id: 0x12a2
2023-09-06 12:12:31,072 - irricloud - INFO - mqtt got pingreq
2023-09-06 12:12:31,149 - irricloud - INFO - small gap: 49 ob: 0 instance: 11 obs_rain: 0.0 now: 1694027551 obs_time: 1694027502
2023-09-06 12:12:31,162 - irricloud - INFO - mqtt_s response: 0xd000
2023-09-06 12:12:31,164 - irricloud - ERROR - mqtt
Traceback (most recent call last):
File "plugins/weather.py", line 1485, in mqtt
s.send(self.forward_mqtt(now, ipsrc, mqtt_header+data[:pkt_len]))
BrokenPipeError: [Errno 32] Broken pipe
2023-09-06 12:12:31,167 - irricloud - INFO - exit mqtt
2023-09-06 12:12:34,499 - irricloud - INFO - dns changing response from: 54.81.39.221 to: 10.135.0.1 and ttl from: 60 to: 3600
2023-09-06 12:12:34,501 - irricloud - INFO - dns changing response from: 44.217.196.142 to: 10.135.0.1 and ttl from: 60 to: 3600
2023-09-06 12:12:34,503 - irricloud - INFO - dns changing response from: 34.238.102.102 to: 10.135.0.1 and ttl from: 60 to: 3600
2023-09-06 12:12:34,504 - irricloud - INFO - dns changing response from: 3.92.140.50 to: 10.135.0.1 and ttl from: 60 to: 3600
2023-09-06 12:12:34,506 - irricloud - INFO - dns changing response from: 54.156.255.179 to: 10.135.0.1 and ttl from: 60 to: 3600
2023-09-06 12:12:34,654 - irricloud - INFO - enter mqtt addr: ('10.135.0.13', 49188) port: 1883
2023-09-06 12:12:34,655 - irricloud - INFO - mqtt connect clientid: HB-00118900 keepalive: 300
2023-09-06 12:12:34,656 - substation_proxy - INFO - connect_socket mqtt.weatherflow.com:1883
2023-09-06 12:12:34,839 - irricloud - INFO - mqtt_s response: 0x20020000
2023-09-06 12:12:34,849 - irricloud - INFO - mqtt got subscribe flags: 0x2 topics: [('hub/HB-00118900', 1)] rest:
2023-09-06 12:12:34,940 - irricloud - INFO - mqtt_s response: 0x900312a301
2023-09-06 12:12:34,950 - irricloud - INFO - mqtt got subscribe flags: 0x2 topics: [('fw_data/HB-00118900', 1)] rest:
2023-09-06 12:12:35,040 - irricloud - INFO - mqtt_s response: 0x900312a401
2023-09-06 12:12:35,049 - irricloud - INFO - mqtt got subscribe flags: 0x2 topics: [('system', 1)] rest:
2023-09-06 12:12:35,136 - irricloud - INFO - mqtt_s response: 0x900312a501
2023-09-06 12:12:37,651 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response
2023-09-06 12:12:37,674 - irricloud - INFO - mqtt publish drop: debug/ST-00107879 no qos or response