WeatherFlow PiConsole - Archive

@peter

Trying to fool some with your script again but it fails at start, I upgraded the pi via the usual update/upgrade (got a new kernel)

nothing seems to launch and I have a feeling there is a time out to external data causing it to fail

here is the log from python3 main.py

otionEvent] <b'FT5406 memory based driver\x00                                                                                                                                                                                                                                     '> range position Y is 0 - 480
[INFO   ] [MTD         ] </dev/input/event0> rotation set to 0
2019-02-21 19:27:25+0100 [-] main.py:149: builtins.RuntimeWarning: Mean of empty slice
2019-02-21 19:27:25+0100 [-] main.py:150: builtins.RuntimeWarning: invalid value encountered in double_scalars
2019-02-21 19:27:25+0100 [-] main.py:1959: builtins.RuntimeWarning: Mean of empty slice
[INFO   ] [Base        ] Leaving application in progress...
[INFO   ] [Support     ] Stopping twisted threads
[INFO   ] [Support     ] Shutting down twisted reactor
2019-02-21 19:29:39+0100 [-] Traceback (most recent call last):
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 138, in _new_conn
2019-02-21 19:29:39+0100 [-]     (self.host, self.port), self.timeout, **extra_kw)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 98, in create_connection
2019-02-21 19:29:39+0100 [-]     raise err
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 88, in create_connection
2019-02-21 19:29:39+0100 [-]     sock.connect(sa)
2019-02-21 19:29:39+0100 [-] TimeoutError: [Errno 110] Connection timed out
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] During handling of the above exception, another exception occurred:
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] Traceback (most recent call last):
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 594, in urlopen
2019-02-21 19:29:39+0100 [-]     chunked=chunked)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 350, in _make_request
2019-02-21 19:29:39+0100 [-]     self._validate_conn(conn)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 837, in _validate_conn
2019-02-21 19:29:39+0100 [-]     conn.connect()
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 281, in connect
2019-02-21 19:29:39+0100 [-]     conn = self._new_conn()
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 147, in _new_conn
2019-02-21 19:29:39+0100 [-]     self, "Failed to establish a new connection: %s" % e)
2019-02-21 19:29:39+0100 [-] requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6fb9f2f0>: Failed to establish a new connection: [Errno 110] Connection timed out
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] During handling of the above exception, another exception occurred:
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] Traceback (most recent call last):
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/adapters.py", line 423, in send
2019-02-21 19:29:39+0100 [-]     timeout=timeout
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 643, in urlopen
2019-02-21 19:29:39+0100 [-]     _stacktrace=sys.exc_info()[2])
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 363, in increment
2019-02-21 19:29:39+0100 [-]     raise MaxRetryError(_pool, url, error or ResponseError(cause))
2019-02-21 19:29:39+0100 [-] requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.checkwx.com', port=443): Max retries exceeded with url: /metar/lat/43.34493/lon/1.15171/decoded (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6fb9f2f0>: Failed to establish a new connection: [Errno 110] Connection timed out',))
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] During handling of the above exception, another exception occurred:
2019-02-21 19:29:39+0100 [-] 
2019-02-21 19:29:39+0100 [-] Traceback (most recent call last):
2019-02-21 19:29:39+0100 [-]   File "main.py", line 2375, in <module>
2019-02-21 19:29:39+0100 [-]     wfpiconsole().run()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/app.py", line 826, in run
2019-02-21 19:29:39+0100 [-]     runTouchApp()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 502, in runTouchApp
2019-02-21 19:29:39+0100 [-]     EventLoop.window.mainloop()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 92, in mainloop
2019-02-21 19:29:39+0100 [-]     self._mainloop()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 87, in _mainloop
2019-02-21 19:29:39+0100 [-]     EventLoop.idle()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 337, in idle
2019-02-21 19:29:39+0100 [-]     Clock.tick()
2019-02-21 19:29:39+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/clock.py", line 581, in tick
2019-02-21 19:29:39+0100 [-]     self._process_events()
2019-02-21 19:29:39+0100 [-]   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
2019-02-21 19:29:39+0100 [-]   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
2019-02-21 19:29:39+0100 [-]   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
2019-02-21 19:29:39+0100 [-]   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
2019-02-21 19:29:39+0100 [-]   File "main.py", line 1989, in SagerForecast
2019-02-21 19:29:39+0100 [-]     Data = requests.get(URL,headers=header)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/api.py", line 70, in get
2019-02-21 19:29:39+0100 [-]     return request('get', url, params=params, **kwargs)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/api.py", line 56, in request
2019-02-21 19:29:39+0100 [-]     return session.request(method=method, url=url, **kwargs)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 488, in request
2019-02-21 19:29:39+0100 [-]     resp = self.send(prep, **send_kwargs)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/sessions.py", line 609, in send
2019-02-21 19:29:39+0100 [-]     r = adapter.send(request, **kwargs)
2019-02-21 19:29:39+0100 [-]   File "/usr/lib/python3/dist-packages/requests/adapters.py", line 487, in send
2019-02-21 19:29:39+0100 [-]     raise ConnectionError(e, request=request)
2019-02-21 19:29:39+0100 [-] requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.checkwx.com', port=443): Max retries exceeded with url: /metar/lat/43.34493/lon/1.15171/decoded (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x6fb9f2f0>: Failed to establish a new connection: [Errno 110] Connection timed out',))

will try after dinner again. But next code iteration it would be nice to intercept and just launch the rest at least no ?

another attempt gives another error

-] Traceback (most recent call last):
2019-02-21 19:32:34+0100 [-]   File "main.py", line 2375, in <module>
2019-02-21 19:32:34+0100 [-]     wfpiconsole().run()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/app.py", line 826, in run
2019-02-21 19:32:34+0100 [-]     runTouchApp()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 502, in runTouchApp
2019-02-21 19:32:34+0100 [-]     EventLoop.window.mainloop()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 92, in mainloop
2019-02-21 19:32:34+0100 [-]     self._mainloop()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 87, in _mainloop
2019-02-21 19:32:34+0100 [-]     EventLoop.idle()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 337, in idle
2019-02-21 19:32:34+0100 [-]     Clock.tick()
2019-02-21 19:32:34+0100 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/clock.py", line 581, in tick
2019-02-21 19:32:34+0100 [-]     self._process_events()
2019-02-21 19:32:34+0100 [-]   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
2019-02-21 19:32:34+0100 [-]   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
2019-02-21 19:32:34+0100 [-]   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
2019-02-21 19:32:34+0100 [-]   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
2019-02-21 19:32:34+0100 [-]   File "main.py", line 1999, in SagerForecast
2019-02-21 19:32:34+0100 [-]     self.Sager['Dial'] = sager.DialSetting(self.Sager)
2019-02-21 19:32:34+0100 [-]   File "/home/pi/wfpiconsole/lib/sager.py", line 256, in DialSetting
2019-02-21 19:32:34+0100 [-]     if wdc == "Backing": 
2019-02-21 19:32:34+0100 [-] UnboundLocalError: local variable 'wdc' referenced before assignment
pi@WF_console:~/wfpiconsole $ 

I’ll look into this now. What station ID are you trying?

1 Like

full config file

GeoNames = xxxx
MetOffice =
DarkSky = xxxx
CheckWX = xxxx
WeatherFlow = 146e4f2c-adec-4244-b711-1aeca8f46a48

[Station]
StationID = 3531
OutdoorID = 16029
SkyID = 7505
OutdoorHeight = 1.2
SkyHeight = 5.0
Latitude = 43.34493
Longitude = 1.15171
Elevation = 242.0582275390625
Timezone = Europe/Paris
Country = FR
ForecastLocn = Gratens
MetOfficeID =

[Units]
Temp = c
Pressure = hpa
Wind = kph
Direction = cardinal
Precip = mm
Distance = km
Other = metric

[Display]
TimeFormat = 24 hr
DateFormat = Mon, 01 Jan 0000

[FeelsLike]
ExtremelyCold = -4
FreezingCold = 0
VeryCold = 4
Cold = 9
Mild = 14
Warm = 24
Hot = 28
VeryHot = 33

[System]
BarometerMax = 1050
BarometerMin = 950
Version = v2.1

I see the problem - because the SKY module has only just come back online, the code is falling over when it is looking for the change in wind direction over the last 6 hours. I’ll put a fix in for this, as it is only the SagerForecast that cannot be displayed.

1 Like

indeed, it’s the sky that came back to life today.
thanks Peter

Is it just the wind sensor in the Sky module that has been offline, or has the rain sensor been offline too? Just trying to understand a couple of other bugs that this situation has thrown up!

wind, and everything related to light (UV, lux and brightness) was down, rain was still working

OK that makes sense. The rain data was still returning values (mainly zero), whilst the wind data was returning NaN.

Just about to push an update. Watch this space…

1 Like

that bug is solved, installed and rebooted, all is up, now keep an eye on it.
Thanks for the very quick update @Peter

1 Like

Updated! Thanks @peter

I’ll keep an eye on the next few days…

1 Like

I love it!
Running great on a 24" monitor


All 4 are 24"

3 Likes

Are the readings from the same station?

Yes, both upper monitors show station 4834.

The sea level air pressure is off with one of them.

1 Like

Hummm, I never noticed that. I’ll have to look into it later on…
Thanks for pointing that out!

In ArchiveSW, on the Panel Tab,

Hub height: 316.0
Air height: 2.4
Sky height: 4.3

1 Like

Dumb question - how do you get those other displays (other than the top right one) - I can’t seem to click/tap on much that activates any other display…

2 Likes

Not a dumb question at all.
Each display is run by a different Raspberry Pi.

Is it strange that I have more Raspberry Pis than I do socks?

5 Likes

And always looking for another deal to buy another! LOL

1 Like