WeatherFlow PiConsole - Archive

How can I see that? It’s a model 3 B+ purchased a few days ago…

in the Weatherflow gear, that is…

Hi @patrick.mussner. Glad we’re making some progress! The error is coming when the code is searching for the different Air and Sky devices attached to your account. Can you confirm your station number and that you have both a Sky and Air module?

The station number is 2037, i have both and works fine.
It is possible that the problem comes because they both (Air & Sky) have the same name? (outdoor)

Is not… i have change the names…

Have you by any chance added a device and then deleted it, or used the delete all data function when you were setting up?

I have only this two devices and i have never added/deleted other, and yes, i have deleted all data after i have mount the sky on the roof 80 days ago…

OK. Thanks for the info - I know what the problem is! When you delete all data from a device, it creates a new device_id (see this discussion: Devices gone from the API - #7 by GaryFunk).

The result is that in the list of devices attached to your station, there is ghost entry. A normal device entry looks like this:

{“device_id”:10473,“serial_number”:“SK-00004384”,“device_meta”:{“agl”:30.0,“name”:“outdoor”,“environment”:“outdoor”,“wifi_network_name”:“”},“device_type”:“SK”,“hardware_revision”:“1”,“firmware_revision”:“43”}

Whereas the ghost entry looks like this:

{“device_id”:3752,“device_meta”:{“agl”:0.0,“name”:“outdoor”,“environment”:“outdoor”,“wifi_network_name”:“”}}

Most importantly the ghost entry is missing the field ‘device_type’, and hence the code is falling over. This isn’t a situation I’ve seen before, but is a very easy fix. Unfortunately I am away travelling at the moment and won’t be able to push an update until the weekend. Sorry!

Edit: @dsj Is there an important reason as to why these ghost devices remain in the API? It would certainly be simpler from a development perspective to have them removed.

1 Like

No problem.
I admire your work for the WeatherFlow community, thanks Peter.
I wish you a good time :blush:

2 Likes

Two things:

I can confirm that if I never set the Other Units, and it defaulted to Imperial, that I get the:
2018-09-11 16:27:54-0400 [-] File “main.py”, line 208, in init
2018-09-11 16:27:54-0400 [-] self.System[‘Units’][‘Other’] = Data[‘station_units’][‘units_other’]
2018-09-11 16:27:54-0400 [-] KeyError: ‘units_other’
error. Setting it to Metric works, as does setting it back to Imperial. So maybe the fix it to toggle it?

Also: My Sky unit is not yet installed, and won’t be for a while, is it possible to run without a Sky unit? I’m getting:

2018-09-11 16:45:07-0400 [-] File “main.py”, line 1408, in Calc_SagerForecast
2018-09-11 16:45:07-0400 [-] URL = Template.format(self.System[‘SkyID’],Now-Hours_6,Now,self.System[‘WFlowKey’])
2018-09-11 16:45:07-0400 [-] KeyError: ‘SkyID’

Is there an easy way to stub this out?

Station 3110 if it helps…

Many Thanks!

you might try the old sysadmin credo of “when in doubt, comment it out”

Quick look at the code seems to say it expects to find a Sky defined. Perhaps try to temporarily edit Calc_SagerForecast() at line 1399 make the first line return and cross your fingers (untested)

@dsj Can you take a look at this? It is hard for me to reproduce this error, but it seems that if the default option is left unchanged, a field is not created in the API.

@wpns As for running without a SKY, it can be done but it will take some trial and error. Start by searching main.py for every instance of self.system[‘SkyID’] and comment out every line in which it occurs. Also edit Calc_SagerForecast() as suggested by @vinceskahan. I still can’t guarantee that this will work though. It’s not a use case that I support as so many variables are dependent on the Sky module. You also happen to be in the same situation as me! I still haven’t had any time to get my SKY setup, so as of yet I can’t use my own console :sob:

Peter, would you please ask these questions as a stand-alone topic in the Developers channel? I’m not sure what the answers are, yet, but I think they are important and would like other developers who might not be following this thread to benefit as well, once we have the answers. Thanks!

2 Likes

Tried to install it on a zerow to see what it might look like on a vanilla display (before pulling the trigger on $140 for a official display plus case plus yet another pi3) and it blows up immediately…

It was unclear to me how to edit the .ini file and what to put in for the Air+Sky names (does it matter?). I’d suggest perhaps a .ini.example file might be helpful for folks to edit and replace values in, rather than fill in lines with no examples there for newbies like me in this case.

FWIW, I tried to run it both ‘with’ editing the kivy .ini file as you said, and ‘without’ it just as a test, and got the same result. Again, this is for a zerow attached to a normal HDMI monitor if that helps any…

I might add that it seems like the files downloaded have DOS EOL, if that matters…

INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop
[INFO   ] [Support     ] Starting twisted reactor
[INFO   ] [Base        ] Leaving application in progress...
[INFO   ] [Support     ] Shutting down twisted reactor
2018-09-12 16:57:13-0700 [-] Traceback (most recent call last):
2018-09-12 16:57:13-0700 [-]   File "main.py", line 1712, in <module>
2018-09-12 16:57:13-0700 [-]     WeatherFlowPyConsole().run()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/app.py", line 826, in run
2018-09-12 16:57:13-0700 [-]     runTouchApp()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 502, in runTouchApp
2018-09-12 16:57:13-0700 [-]     EventLoop.window.mainloop()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 92, in mainloop
2018-09-12 16:57:13-0700 [-]     self._mainloop()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/core/window/window_egl_rpi.py", line 87, in _mainloop
2018-09-12 16:57:13-0700 [-]     EventLoop.idle()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/base.py", line 337, in idle
2018-09-12 16:57:13-0700 [-]     Clock.tick()
2018-09-12 16:57:13-0700 [-]   File "/usr/local/lib/python3.5/dist-packages/kivy/clock.py", line 581, in tick
2018-09-12 16:57:13-0700 [-]     self._process_events()
2018-09-12 16:57:13-0700 [-]   File "kivy/_clock.pyx", line 384, in kivy._clock.CyClockBase._process_events
2018-09-12 16:57:13-0700 [-]   File "kivy/_clock.pyx", line 414, in kivy._clock.CyClockBase._process_events
2018-09-12 16:57:13-0700 [-]   File "kivy/_clock.pyx", line 412, in kivy._clock.CyClockBase._process_events
2018-09-12 16:57:13-0700 [-]   File "kivy/_clock.pyx", line 167, in kivy._clock.ClockEvent.tick
2018-09-12 16:57:13-0700 [-] TypeError: create_window() takes 1 positional argument but 2 were given
1 Like

I have not yet driven up to SparkFun.com to pick up the hardware, so I’m not yet running to code, but first glance looks like the graphics library is failing because the hardware is not what it wants.

Just a guess.

2 Likes

Interesting to hear about your experimenting on a Raspberry Pi Zero! I have never tried it myself, but I don’t think you are ever going to be able to get it working. A quick Google suggests the Zero is missing OpenGL hardware acceleration, which is making the code fall over almost immediately. It does have a software implementation of OpenGL, but reports suggest it is so slow it’s not worth developing for.

If you want a test installation, perhaps give it a spin on a Windows PC? I’ve confirmed this works, and is now my preferred development environment as my Raspberry Pi is now permanently installed on the wall in the living room. This is why it has DOS line endings. I’ve not noticed an issue with this, but I’ll do some testing at the weekend.

I don’t have any instructions for Windows, but I suggest you download Miniconda (https://conda.io/miniconda.html), then follow step 2 and step 5 from the Github instructions (omit the ‘sudo’ command from step 5 and change python3 to just python), then install Kivy following these instructions Installation on Windows — Kivy 2.2.1 documentation, and finally continue with the Github instructions from step 8 onwards. This is untested so let me know if you run into issues.

If you only have one Air and Sky module, you can leave the Air and Sky names empty. I’ll see what I can do about a .ini example. Hope this helps!

2 Likes

Was going to try to get things running on the PC. Should have the Pi today.

I didn’t realize there were minimum hardware requirements. No problem, just wanted to try it on available gear that I had sitting around. Thanks !

To be honest, I didn’t realise there were either! I’ll of course update the Readme on Github to make this clear. Hope you manage to get up and running on some hardware soon. Did you try the Windows install?

naaah - I don’t want to massively pollute my already polluted-by-the-vendor Win10Pro installation any more…

1 Like