WeatherFlow PiConsole - Archive

Yea unfortunately closing the terminal that you used to run the console will kill it. Nevermind though! You say the console froze at 7.43 am. How long after it froze did you grab the log file?

About an hour after it froze. I was trying to be clever and used: tail -60 ~/wfpiconsole/wfpiconsole.log but the log stopped at 7:42:26 and didnā€™t show any additional data.

Perfect! Thatā€™s the info I needed. It looks like the console is freezing because data is no longer being sent through the websocket connection. The last data arrived at 7:42:26 am coinciding with the time that you noticed the console freezing (7.43 am), and for the whole hour after that no new data was received, creating the impression that the console was frozen.

This puts the bug squarely on the change to the secure websocket I made between V2 and V3. I will roll that back for now while I try and work out what the problem is, or implement some way of forcing the console to reconnect. Iā€™ll probably go with one more patch for you to test just to be 100% sure before rolling out a new version release.

Thanks again for all the help tracking this down!

No problem, Iā€™m glad I can help.

@padieter just published a new patch (v3.1.7). It doesnā€™t do away with the secure websocket entirely, as it turns out I was using an old implementation. I have updated it to the most recent implementation in the hope this may resolve the issues. If it doesnā€™t and you see more freezes, I will stop messing around and re-implement the unsecure version which I know works!

@peter patch 3.1.7 is up and running. Fingers crossed!

1 Like

Sorry @peter, the wfpiconsole froze.

:frowning: :frowning: - although not unexpected. Mine also froze this morning on v3.1.7. I have tried one more thing to try and force the console to reconnect once it has frozen. Can you give v3.1.8 a go with wfpiconsole patch. If there is no luck I will roll back over the weekend. Thanks!

Updated to 3.1.8 and things look good.

and mine is nicely running on 3.1.5 ā€¦ go figure

And Iā€™m running 3.1.1 and havenā€™t had any problems for a couple weeks.

found my console finaly frozen so I patched rebooted and now I get this in the log, knowing it shows outdoor temp and pressure (at least it filled the cases)

log shows this

pi@WF_console:~/wfpiconsole $ tail -f wfpiconsole.log 
2020-04-26 10:31:44+0200 [-] Log opened.
2020-04-26 10:31:47+0200 [-] Starting factory <__main__.WeatherFlowClientFactory object at 0x75c00d10>
2020-04-26 10:31:50+0200 [-] connection_opened
2020-04-26 10:31:50+0200 [-] ack
2020-04-26 10:31:50+0200 [-] obs_st
2020-04-26 10:31:59+0200 [WeatherFlowClientProtocol (TLSMemoryBIOProtocol),client] Unhandled Error
	Traceback (most recent call last):
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 103, in callWithLogger
	    return callWithContext({"system": lp}, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 86, in callWithContext
	    return context.call({ILogContext: newCtx}, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	--- <exception caught here> ---
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/_threadedselect.py", line 276, in _doReadOrWrite
	    why = getattr(selectable, method)()
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 243, in doRead
	    return self._dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 249, in _dataReceived
	    rval = self.protocol.dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/tls.py", line 330, in dataReceived
	    self._flushReceiveBIO()
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
	    ProtocolWrapper.dataReceived(self, bytes)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/policies.py", line 120, in dataReceived
	    self.wrappedProtocol.dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/twisted/websocket.py", line 135, in dataReceived
	    self._dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1180, in _dataReceived
	    self.consumeData()
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1192, in consumeData
	    while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1558, in processData
	    fr = self.onFrameEnd()
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1680, in onFrameEnd
	    self._onMessageEnd()
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/twisted/websocket.py", line 163, in _onMessageEnd
	    self.onMessageEnd()
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 628, in onMessageEnd
	    self._onMessage(payload, self.message_is_binary)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/twisted/websocket.py", line 166, in _onMessage
	    self.onMessage(payload, isBinary)
	  File "main.py", line 72, in onMessage
	    self.factory._app.WebsocketDecodeMessage(Message)
	  File "main.py", line 403, in WebsocketDecodeMessage
	    websocket.Tempest(Msg,self.Obs,self.config)
	  File "/home/pi/wfpiconsole/lib/websocket.py", line 135, in Tempest
	    Obs['StrikeDist']    = observation.Format(StrikeDist,'StrikeDistance')
	  File "/home/pi/wfpiconsole/lib/observationFormat.py", line 318, in Format
	    cObs[ii-1] = DispValues[DistValues.index(cObs[ii-1])]
	builtins.ValueError: 35 is not in list
	
2020-04-26 10:31:59+0200 [WeatherFlowClientProtocol (TLSMemoryBIOProtocol),client] Unhandled Error
	Traceback (most recent call last):
	  File "/usr/local/lib/python3.5/dist-packages/kivy/clock.py", line 581, in tick
	    self._process_events()
	  File "/usr/local/lib/python3.5/dist-packages/kivy/support.py", line 210, in reactor_work
	    q.popleft()()
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/_threadedselect.py", line 227, in _interleave
	    getattr(self, '_process_' + msg)(*args)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/_threadedselect.py", line 199, in _process_Notify
	    _logrun(selectable, _drdw, selectable, method, dct)
	--- <exception caught here> ---
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 103, in callWithLogger
	    return callWithContext({"system": lp}, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/log.py", line 86, in callWithContext
	    return context.call({ILogContext: newCtx}, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 122, in callWithContext
	    return self.currentContext().callWithContext(ctx, func, *args, **kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/python/context.py", line 85, in callWithContext
	    return func(*args,**kw)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/_threadedselect.py", line 286, in _doReadOrWrite
	    self._disconnectSelectable(selectable, why, method == "doRead")
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/posixbase.py", line 258, in _disconnectSelectable
	    selectable.connectionLost(failure.Failure(why))
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 519, in connectionLost
	    self._commonConnection.connectionLost(self, reason)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/internet/tcp.py", line 327, in connectionLost
	    protocol.connectionLost(reason)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/tls.py", line 398, in connectionLost
	    self._flushReceiveBIO()
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
	    ProtocolWrapper.dataReceived(self, bytes)
	  File "/usr/local/lib/python3.5/dist-packages/twisted/protocols/policies.py", line 120, in dataReceived
	    self.wrappedProtocol.dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/twisted/websocket.py", line 135, in dataReceived
	    self._dataReceived(data)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1180, in _dataReceived
	    self.consumeData()
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1192, in consumeData
	    while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1550, in processData
	    fr = self.onFrameData(payload)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 1645, in onFrameData
	    self._onMessageFrameData(payload)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/twisted/websocket.py", line 154, in _onMessageFrameData
	    self.onMessageFrameData(payload)
	  File "/usr/local/lib/python3.5/dist-packages/autobahn/websocket/protocol.py", line 602, in onMessageFrameData
	    self.frame_data.append(payload)
	builtins.AttributeError: 'NoneType' object has no attribute 'append'

edit, did another reboot and opened log quicker giving more details i put above instead original log, they both contains same lines except I get a few more this time

hope this helps somehow

Thanks for updating the log - the second one is much easier to understand. Looks like there is a small bug in the lighting distance. Iā€™ll get a fix sorted ASAP.

1 Like

Should be all fixed now. You can use the patch command to jump to v3.1.9.

patched and running again, all fields populated

pi@WF_console:~/wfpiconsole $ tail -f wfpiconsole.log 
2020-04-26 12:19:45+0200 [-] Log opened.
2020-04-26 12:19:48+0200 [-] Starting factory <__main__.WeatherFlowClientFactory object at 0x768209f0>
2020-04-26 12:19:50+0200 [-] connection_opened
2020-04-26 12:19:51+0200 [-] ack
2020-04-26 12:19:51+0200 [-] obs_st
2020-04-26 12:20:09+0200 [-] ack
2020-04-26 12:20:09+0200 [-] ack
2020-04-26 12:20:09+0200 [-] obs_air
2020-04-26 12:20:35+0200 [-] obs_air
2020-04-26 12:20:39+0200 [-] obs_st

logs till now

Looks good! Just to note, this bug may crop up again if WF adjust the lightning strike distance bins on the Tempest. David has mentioned this might be the case

2 Likes

Just a quick update. My console has NOT froze in well over 24 hours on 3.1.8.

Now that is good news! Any chance you could send me the entire contents of your wfpiconsole.log file as an attachment here? You can transfer the whole file from your Raspberry Pi to your PC/Mac by right clicking on the VNC icon on the Pi desktop and selecting File Transfer...

Ok, here is the file after the transfer option. Well, the file would not upload as an attached *.txt file so I made a PDF of the file, perhaps the text file is too large as it worked previous files.

wfpiconsole log april 26.pdf (183.7 KB)

Thanks - that all looks good. From the log I can see that the websocket connection has timed out twice (which is expected), but it has happily reconnected within 5 minutes (which is normal behaviour). I think the freezing you were seeing was because the websocket was not reconnecting in the past. Letā€™s give it a few more days and then hopefully we can say this bug is fully squashed :+1:

1 Like