bpaauwe / WeatherFlow

UDI Polyglot based node server for the WeatherFlow smart weather station
Other
4 stars 2 forks source link

not finding the hub #5

Closed MechEng70 closed 4 years ago

MechEng70 commented 4 years ago

Just created a new install of the polyglot on a rpi4. added the weatherflow node server from the store. Added it to the dashboard. still does not find the weatherflow hub. Added a Station key with the 4 digit number from the weatherflow app for StationID. any suggestions?

bpaauwe commented 4 years ago

The hub broadcast data over your local network using the UDP protocol. The node server listens for those broadcasts. If your network is blocking UDP packets or if the RPi is on a different network from the hub the UDP packets won't get through. If this is the case, you'll have to change your network configuration for it to work.

If that's not the case. On the RPi, looking in ~/.nodeservers/WeatherFlow/logs/debug will have the debug output from the node server. If there's a problem with the node server, the debug log should show what the problem is.

MechEng70 commented 4 years ago

ok. Hub and RPI4 are on the same network. do you know how to tell if the network is blocking this?

bpaauwe commented 4 years ago

It would probably be a router configuration, which is router dependent.

Did you check the log and does it show any errors?

MechEng70 commented 4 years ago

2019-10-25 09:03:09,062 [Thread-1 ] [ERROR] Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "./weatherflow.py", line 362, in udp_data s.bind(('0.0.0.0', self.udp_port)) OSError: [Errno 98] Address already in use 2019-10-25 09:03:09,063 [Thread-1 ] [WARNING] /usr/lib/python3.7/threading.py:951: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_DGRAM, proto=0, laddr=('0.0.0.0', 0)>

bpaauwe commented 4 years ago

Ah, do you have something else also trying to get data from the hub running on that RPi?

By default, only one application on the machine can listen for the data unless it is configured specifically to allow sharing with other applications. The node server is configured to allow sharing but it looks like something else is already running that's not configured to share.

MechEng70 commented 4 years ago

That may be weewx. But that is having issues talking. I will shut that down and see if it helps.

On Fri, Oct 25, 2019, 10:11 Bob Paauwe notifications@github.com wrote:

Ah, do you have something else also trying to get data from the hub running on that RPi?

By default, only one application on the machine can listen for the data unless it is configured specifically to allow sharing with other applications. The node server is configured to allow sharing but it looks like something else is already running that's not configured to share.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bpaauwe/WeatherFlow/issues/5?email_source=notifications&email_token=ACZH4LUXZZNC4ZSGQACF6QLQQMSDTA5CNFSM4JFFG6KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECI7GLI#issuecomment-546435885, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZH4LUSI2FLWRQ32HPAZYLQQMSDTANCNFSM4JFFG6KA .

ToddLorey commented 4 years ago

I'm having a similar issue of the hub not being found. I'm on a new Polisy, so it's not Raspian Stretch, as the requirements define. Maybe that's the issue. Here's a snippet of the log file if it helps: `2019-11-04 09:36:04,846 [NodeServer] [INFO ] Starting WeatherFlow Node Server 2019-11-04 09:36:04,848 [NodeServer] [INFO ] Sending customParams to Polyglot. 2019-11-04 09:36:04,850 [NodeServer] [INFO ] no station defined, skipping lookup. 2019-11-04 09:36:04,852 [NodeServer] [INFO ] Adding node Temperatures(temperature) 2019-11-04 09:36:04,854 [NodeServer] [INFO ] Adding node Humidity(humidity) 2019-11-04 09:36:04,870 [NodeServer] [INFO ] Adding node Barometric Pressure(pressure) 2019-11-04 09:36:04,878 [NodeServer] [INFO ] Adding node Wind(wind) 2019-11-04 09:36:04,888 [NodeServer] [INFO ] Adding node Precipitation(rain) 2019-11-04 09:36:04,896 [NodeServer] [INFO ] Adding node Illumination(light) 2019-11-04 09:36:04,905 [NodeServer] [INFO ] Adding node Lightning(lightning) 2019-11-04 09:36:04,912 [NodeServer] [INFO ] starting thread for UDP data 2019-11-04 09:36:04,933 [NodeServer] [INFO ] WeatherFlow Node Server Started. 2019-11-04 09:36:04,946 [Thread-1 ] [INFO ] Starting UDP receive loop 2019-11-04 09:36:15,742 [Interface ] [INFO ] Changed units from metric to US 2019-11-04 09:36:15,744 [Interface ] [INFO ] Skipping node controller 2019-11-04 09:36:15,744 [Interface ] [INFO ] Skipping node hub 2019-11-04 09:36:15,745 [Interface ] [INFO ] Setting node temperature to units us 2019-11-04 09:36:15,746 [Interface ] [INFO ] Adding node Temperatures(temperature) 2019-11-04 09:36:15,747 [Interface ] [INFO ] Setting node humidity to units us 2019-11-04 09:36:15,748 [Interface ] [INFO ] Adding node Humidity(humidity) 2019-11-04 09:36:15,750 [Interface ] [INFO ] Setting node pressure to units us 2019-11-04 09:36:15,750 [Interface ] [INFO ] Adding node Barometric Pressure(pressure) 2019-11-04 09:36:15,752 [Interface ] [INFO ] Setting node wind to units us 2019-11-04 09:36:15,753 [Interface ] [INFO ] Adding node Wind(wind) 2019-11-04 09:36:15,754 [Interface ] [INFO ] Setting node rain to units us 2019-11-04 09:36:15,755 [Interface ] [INFO ] Adding node Precipitation(rain) 2019-11-04 09:36:15,756 [Interface ] [INFO ] Setting node light to units us 2019-11-04 09:36:15,757 [Interface ] [INFO ] Adding node Illumination(light) 2019-11-04 09:36:15,759 [Interface ] [INFO ] Setting node lightning to units us 2019-11-04 09:36:15,759 [Interface ] [INFO ] Adding node Lightning(lightning) 2019-11-04 09:36:15,761 [Interface ] [INFO ] Changed elevation from 0.0 to 64 2019-11-04 09:37:04,781 [Controller] [DEBUG] heartbeat hb=0 2019-11-04 09:37:04,784 [Controller] [DEBUG] set_hub_timestamp: 1572889024 2019-11-04 09:37:04,785 [Controller] [INFO ] Updating Driver hub - GV4: 1572889024, uom: 57 2019-11-04 09:37:38,652 [Interface ] [DEBUG] Received stop from Polyglot... Shutting Down. 2019-11-04 09:37:38,653 [Interface ] [INFO ] Disconnecting from MQTT... localhost:1883 2019-11-04 09:37:38,655 [Interface ] [DEBUG] Stopping WeatherFlow node server. 2019-11-04 09:37:43,056 [MainThread] [INFO ] Received Config from STDIN. 2019-11-04 09:37:43,057 [MainThread] [INFO ] UDI Polyglot v2 Interface 2.0.31 Starting... 2019-11-04 09:37:43,354 [Interface ] [INFO ] Connecting to MQTT... localhost:1883 2019-11-04 09:37:43,402 [Interface ] [INFO ] MQTT Connected with result code 0 (Success) 2019-11-04 09:37:43,403 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/ns/10 - MID: 1 Result: 0 2019-11-04 09:37:43,404 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2019-11-04 09:37:43,405 [Interface ] [INFO ] Sent Connected message to Polyglot 2019-11-04 09:37:43,526 [NodeServer] [INFO ] Starting WeatherFlow Node Server 2019-11-04 09:37:43,527 [Interface ] [ERROR] KeyError in gotConfig: 'Units' Traceback (most recent call last): File "/var/polyglot/.local/lib/python3.7/site-packages/polyinterface/polyinterface.py", line 493, in inConfig watcher(config) File "./weatherflow.py", line 61, in process_config if new_params['Units'] != self.myConfig['Units']: KeyError: 'Units' 2019-11-04 09:37:43,527 [NodeServer] [INFO ] Sending customParams to Polyglot. 2019-11-04 09:37:43,851 [NodeServer] [INFO ] WF says units are US 2019-11-04 09:37:43,852 [NodeServer] [INFO ] daily rainfall = 0.000000 2019-11-04 09:37:43,853 [NodeServer] [INFO ] yesterday rainfall = 0.000000 2019-11-04 09:37:43,855 [NodeServer] [INFO ] Adding node Temperatures(temperature) 2019-11-04 09:37:43,859 [NodeServer] [INFO ] Adding node Humidity(humidity) 2019-11-04 09:37:43,862 [NodeServer] [INFO ] Adding node Barometric Pressure(pressure) 2019-11-04 09:37:43,865 [NodeServer] [INFO ] Adding node Wind(wind) 2019-11-04 09:37:43,868 [NodeServer] [INFO ] Adding node Precipitation(rain) 2019-11-04 09:37:43,872 [NodeServer] [INFO ] Adding node Illumination(light) 2019-11-04 09:37:43,874 [NodeServer] [INFO ] Adding node Lightning(lightning) 2019-11-04 09:37:43,876 [NodeServer] [INFO ] starting thread for UDP data 2019-11-04 09:37:43,878 [NodeServer] [INFO ] WeatherFlow Node Server Started. 2019-11-04 09:37:43,880 [Thread-1 ] [INFO ] Starting UDP receive loop 2019-11-04 09:38:43,437 [Controller] [DEBUG] heartbeat hb=0 2019-11-04 09:38:43,439 [Controller] [DEBUG] set_hub_timestamp: 1572889123 2019-11-04 09:38:43,440 [Controller] [INFO ] Updating Driver hub - GV4: 1572889123, uom: 57 2019-11-04 09:39:00,039 [Interface ] [DEBUG] Received stop from Polyglot... Shutting Down. 2019-11-04 09:39:00,040 [Interface ] [INFO ] Disconnecting from MQTT... localhost:1883 2019-11-04 09:39:00,042 [Interface ] [DEBUG] Stopping WeatherFlow node server. 2019-11-04 09:39:04,580 [MainThread] [INFO ] Received Config from STDIN. 2019-11-04 09:39:04,582 [MainThread] [INFO ] UDI Polyglot v2 Interface 2.0.31 Starting... 2019-11-04 09:39:04,835 [Interface ] [INFO ] Connecting to MQTT... localhost:1883 2019-11-04 09:39:04,879 [Interface ] [INFO ] MQTT Connected with result code 0 (Success) 2019-11-04 09:39:04,880 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/ns/10 - MID: 1 Result: 0 2019-11-04 09:39:04,881 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2019-11-04 09:39:04,882 [Interface ] [INFO ] Sent Connected message to Polyglot 2019-11-04 09:39:05,004 [NodeServer] [INFO ] Starting WeatherFlow Node Server 2019-11-04 09:39:05,005 [Interface ] [ERROR] KeyError in gotConfig: 'Units' Traceback (most recent call last): File "/var/polyglot/.local/lib/python3.7/site-packages/polyinterface/polyinterface.py", line 493, in inConfig watcher(config) File "./weatherflow.py", line 61, in process_config if new_params['Units'] != self.myConfig['Units']: KeyError: 'Units' 2019-11-04 09:39:05,006 [NodeServer] [INFO ] Sending customParams to Polyglot. 2019-11-04 09:39:05,346 [NodeServer] [INFO ] WF says units are US 2019-11-04 09:39:05,346 [NodeServer] [INFO ] daily rainfall = 0.000000 2019-11-04 09:39:05,347 [NodeServer] [INFO ] yesterday rainfall = 0.000000 2019-11-04 09:39:05,349 [NodeServer] [INFO ] Adding node Temperatures(temperature) 2019-11-04 09:39:05,351 [NodeServer] [INFO ] Adding node Humidity(humidity) 2019-11-04 09:39:05,354 [NodeServer] [INFO ] Adding node Barometric Pressure(pressure) 2019-11-04 09:39:05,357 [NodeServer] [INFO ] Adding node Wind(wind) 2019-11-04 09:39:05,361 [NodeServer] [INFO ] Adding node Precipitation(rain) 2019-11-04 09:39:05,364 [NodeServer] [INFO ] Adding node Illumination(light) 2019-11-04 09:39:05,369 [NodeServer] [INFO ] Adding node Lightning(lightning) 2019-11-04 09:39:05,371 [NodeServer] [INFO ] starting thread for UDP data 2019-11-04 09:39:05,375 [Thread-1 ] [INFO ] Starting UDP receive loop 2019-11-04 09:39:05,376 [NodeServer] [INFO ] WeatherFlow Node Server Started. 2019-11-04 09:40:04,918 [Controller] [DEBUG] heartbeat hb=0 2019-11-04 09:40:04,920 [Controller] [DEBUG] set_hub_timestamp: 1572889204 2019-11-04 09:40:04,922 [Controller] [INFO ] Updating Driver hub - GV4: 1572889204, uom: 57

`

bpaauwe commented 4 years ago

I'm running it on a Polisy too and not having any issue seeing the data from either of my two hubs so it's not the Polisy.

I don't see anything in the log that indicates a problem. Yours looks just like mine other than I start seeing all the node updates after the UDP receive loop starts.

Was that you manually restarting it multiple times?

jimboca commented 4 years ago

This looks like the units config hasn't been added?

2019-11-04 09:37:43,527 [Interface ] [ERROR] KeyError in gotConfig: 'Units' Traceback (most recent call last): File "/var/polyglot/.local/lib/python3.7/site-packages/ polyinterface/polyinterface.py", line 493, in inConfig watcher(config) File "./weatherflow.py", line 61, in process_config if new_params['Units'] != self.myConfig['Units']: KeyError: 'Units'

On Mon, Nov 4, 2019, 11:42 AM Bob Paauwe notifications@github.com wrote:

I'm running it on a Polisy too and not having any issue seeing the data from either of my two hubs so it's not the Polisy.

I don't see anything in the log that indicates a problem. Yours looks just like mine other than I start seeing all the node updates after the UDP receive loop starts.

Was that you manually restarting it multiple times?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bpaauwe/WeatherFlow/issues/5?email_source=notifications&email_token=AAMBIPEATF3FD552JPF4ZD3QSBUIPA5CNFSM4JFFG6KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDAJEGY#issuecomment-549491227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMBIPHVLPW3SQQ3UTSAZX3QSBUIPANCNFSM4JFFG6KA .

ToddLorey commented 4 years ago

Thanks guys. I tracked it down to my router (Edgerouter12). I needed to add a "broadcast relay" entry to forward the 50222 UDP stuff to the Polisy that I put on another VLAN. I should have checked that first. I had forgotten that I needed to do that when I first set up the WeatherFlowPoly a long time ago.

I do have the "Units" parameter set to "us", so I'm not sure what's going on there. The units seem to work out when they make it to the ISY.

Yeah, that was me restarting it manually in the previous log. Here's my log now... looking much better but it is still complaining about the "Units" parameter.

2019-11-04 11:45:02,575 [Interface ] [DEBUG] Stopping WeatherFlow node server. 2019-11-04 11:45:07,017 [MainThread] [INFO ] Received Config from STDIN. 2019-11-04 11:45:07,019 [MainThread] [INFO ] UDI Polyglot v2 Interface 2.0.31 Starting... 2019-11-04 11:45:07,361 [Interface ] [INFO ] Connecting to MQTT... localhost:1883 2019-11-04 11:45:07,415 [Interface ] [INFO ] MQTT Connected with result code 0 (Success) 2019-11-04 11:45:07,417 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/ns/10 - MID: 1 Result: 0 2019-11-04 11:45:07,417 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2019-11-04 11:45:07,418 [Interface ] [INFO ] Sent Connected message to Polyglot 2019-11-04 11:45:07,542 [NodeServer] [INFO ] Starting WeatherFlow Node Server 2019-11-04 11:45:07,543 [Interface ] [ERROR] KeyError in gotConfig: 'Units' Traceback (most recent call last): File "/var/polyglot/.local/lib/python3.7/site-packages/polyinterface/polyinterface.py", line 493, in inConfig watcher(config) File "./weatherflow.py", line 61, in process_config if new_params['Units'] != self.myConfig['Units']: KeyError: 'Units' 2019-11-04 11:45:07,544 [NodeServer] [INFO ] Sending customParams to Polyglot. 2019-11-04 11:45:07,859 [NodeServer] [INFO ] WF says units are US 2019-11-04 11:45:07,864 [NodeServer] [INFO ] daily rainfall = 0.000000 2019-11-04 11:45:07,865 [NodeServer] [INFO ] yesterday rainfall = 0.000000 2019-11-04 11:45:07,867 [NodeServer] [INFO ] Adding node Temperatures(temperature) 2019-11-04 11:45:07,870 [NodeServer] [INFO ] Adding node Humidity(humidity) 2019-11-04 11:45:07,872 [NodeServer] [INFO ] Adding node Barometric Pressure(pressure) 2019-11-04 11:45:07,876 [NodeServer] [INFO ] Adding node Wind(wind) 2019-11-04 11:45:07,879 [NodeServer] [INFO ] Adding node Precipitation(rain) 2019-11-04 11:45:07,885 [NodeServer] [INFO ] Adding node Illumination(light) 2019-11-04 11:45:07,887 [NodeServer] [INFO ] Adding node Lightning(lightning) 2019-11-04 11:45:07,890 [NodeServer] [INFO ] Clearing old weekly, daily, hourly data 2019-11-04 11:45:07,890 [NodeServer] [INFO ] starting thread for UDP data 2019-11-04 11:45:07,892 [NodeServer] [INFO ] WeatherFlow Node Server Started. 2019-11-04 11:45:07,893 [Thread-1 ] [INFO ] Starting UDP receive loop 2019-11-04 11:45:25,630 [Thread-1 ] [INFO ] Updating Driver hub - GV2: -62, uom: 25 2019-11-04 11:45:25,647 [Thread-1 ] [INFO ] Updating Driver pressure - ST: 29.751, uom: 23 2019-11-04 11:45:25,650 [Thread-1 ] [INFO ] Updating Driver pressure - GV0: 29.992, uom: 23 2019-11-04 11:45:25,652 [Thread-1 ] [INFO ] TREND 0.000000 to 1007.500000 2019-11-04 11:45:25,653 [Thread-1 ] [INFO ] Updating Driver pressure - GV1: 2, uom: 25 2019-11-04 11:45:25,655 [Thread-1 ] [INFO ] Updating Driver temperature - ST: 60.4, uom: 17 2019-11-04 11:45:25,659 [Thread-1 ] [INFO ] Updating Driver temperature - GV0: 58.8, uom: 17 2019-11-04 11:45:25,661 [Thread-1 ] [INFO ] Updating Driver temperature - GV1: 43.2, uom: 17 2019-11-04 11:45:25,664 [Thread-1 ] [INFO ] Updating Driver temperature - GV2: 60.4, uom: 17 2019-11-04 11:45:25,667 [Thread-1 ] [INFO ] Updating Driver temperature - GV3: 60.4, uom: 17 2019-11-04 11:45:25,669 [Thread-1 ] [INFO ] Updating Driver humidity - ST: 53, uom: 22 2019-11-04 11:45:25,671 [Thread-1 ] [INFO ] Updating Driver lightning - ST: 0, uom: 25 2019-11-04 11:45:25,673 [Thread-1 ] [INFO ] Updating Driver lightning - GV0: 0.0, uom: 116 2019-11-04 11:45:25,675 [Thread-1 ] [INFO ] Updating Driver hub - GV0: 3.45, uom: 72 2019-11-04 11:45:47,098 [Thread-1 ] [INFO ] Updating Driver hub - GV3: -33, uom: 25 2019-11-04 11:45:47,122 [Thread-1 ] [INFO ] Updating Driver wind - ST: 0.76, uom: 48 2019-11-04 11:45:47,124 [Thread-1 ] [INFO ] Updating Driver wind - GV0: 180, uom: 76 2019-11-04 11:45:47,127 [Thread-1 ] [INFO ] Updating Driver wind - GV1: 1.5, uom: 48 2019-11-04 11:45:47,128 [Thread-1 ] [INFO ] Updating Driver wind - GV2: 180, uom: 76 2019-11-04 11:45:47,131 [Thread-1 ] [INFO ] Updating Driver wind - GV3: 0.0, uom: 48 2019-11-04 11:45:47,133 [Thread-1 ] [INFO ] Updating Driver light - ST: 3.77, uom: 71 2019-11-04 11:45:47,135 [Thread-1 ] [INFO ] Updating Driver light - GV0: 567, uom: 74 2019-11-04 11:45:47,138 [Thread-1 ] [INFO ] Updating Driver light - GV1: 68142, uom: 36 2019-11-04 11:45:47,141 [Thread-1 ] [INFO ] Updating Driver rain - ST: 0.0, uom: 24 2019-11-04 11:45:47,143 [Thread-1 ] [DEBUG] RAIN 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2019-11-04 11:45:47,145 [Thread-1 ] [INFO ] Updating Driver rain - GV0: 0.0, uom: 105 2019-11-04 11:45:47,148 [Thread-1 ] [INFO ] Updating Driver rain - GV1: 0.0, uom: 105 2019-11-04 11:45:47,152 [Thread-1 ] [INFO ] Updating Driver rain - GV2: 0.0, uom: 105 2019-11-04 11:45:47,155 [Thread-1 ] [INFO ] Updating Driver rain - GV3: 0.0, uom: 105 2019-11-04 11:45:47,160 [Thread-1 ] [INFO ] Updating Driver rain - GV4: 0.0, uom: 105 2019-11-04 11:45:47,162 [Thread-1 ] [INFO ] Updating Driver rain - GV5: 0.0, uom: 105 2019-11-04 11:45:47,164 [Thread-1 ] [INFO ] Sending customData to Polyglot.

bpaauwe commented 4 years ago

The "Units" error is because of a race condition in the Polyglot threads. I need to do some work to prevent that.