Windy plugin error

73 views
Skip to first unread message

raenrfm

unread,
Jan 8, 2020, 1:15:45 PM1/8/20
to weewx-user
Posting to windy works for a while but then I inevitably get this error:

Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: restx: Windy: Unexpected exception of type <type 'exceptions.TypeError'>
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: *** Traceback (most recent call last):
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***   File "/usr/share/weewx/weewx/restx.py", line 343, in run_loop
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***     self.process_record(_record, dbmanager)
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***   File "/usr/share/weewx/weewx/restx.py", line 392, in process_record
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***     _payload = self.get_post_body(_full_record)
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***   File "/usr/share/weewx/user/windy.py", line 164, in get_post_body
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: ***     data['pressure'] = 100.0 * record_m['barometer']  # Pascals
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: *** TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
Jan  8 12:21:18 6a4c8de67d74 weewx[7295]: restx: Windy: Thread exiting. Reason: unsupported operand type(s) for *: 'float' and 'NoneType'

Is it because I'm getting a null entry for pressure in a given archive cycle?

raenrfm

unread,
Jan 9, 2020, 8:47:19 AM1/9/20
to weewx-user
Seems like it's this line in the windy.py:

if 'barometer' in record_m:
data['pressure'] = 100.0 * record_m['barometer'] # Pascals
that is causing the issue, but there is no mqtt topic in my setup called "barometer", I'm only posting "pressure", so why would it even be trying to execute this function?

Any takers on this one?

vince

unread,
Jan 9, 2020, 10:38:28 AM1/9/20
to weewx-user
On Thursday, January 9, 2020 at 5:47:19 AM UTC-8, raenrfm wrote:
Seems like it's this line in the windy.py:

if 'barometer' in record_m:

data['pressure'] = 100.0 * record_m['barometer'] # Pascals
that is causing the issue, but there is no mqtt topic in my setup called "barometer", I'm only posting "pressure", so why would it even be trying to execute this function?



Without looking at windy.py, my guess is there is something in your loop and/or archive content that 'has' a barometer item in there.

raenrfm

unread,
Jan 9, 2020, 1:24:08 PM1/9/20
to weewx-user
Hey Vince, thanks for the tip.  Turns out I needed to send from my base station the "barometer" value pre calculated in the base station before sending it to the mqtt server, so seeing as windy.py needs the barometer implicitly I had to send it to weewx already corrected for my altitude.  I guess I assumed that weewx would calculate it at the end of every archive cycle.  Weird.   

mwall

unread,
Jan 9, 2020, 3:35:59 PM1/9/20
to weewx-user
On Thursday, January 9, 2020 at 1:24:08 PM UTC-5, raenrfm wrote:
Hey Vince, thanks for the tip.  Turns out I needed to send from my base station the "barometer" value pre calculated in the base station before sending it to the mqtt server, so seeing as windy.py needs the barometer implicitly I had to send it to weewx already corrected for my altitude.  I guess I assumed that weewx would calculate it at the end of every archive cycle.  Weird. 

it looks like 'barometer' is, indeed, in the record, but it has a value of 'None'.  does your station send partial packets, or does your station sometimes have no barometric reading in enough loop packets so that it reports an archive record with a value of 'None' for pressure/barometer/altimeter? 

fixed at commit add0332f89cd621f4dc9e49bbcd072698f22fbc4 - if there is no barometer, the weewx-windy extension will upload a value of None (not sure how windy will deal with this, but that is what happens for all of the other observations, so at least it will be consistent and will not crash weewx)

m
Reply all
Reply to author
Forward
0 new messages