WeatherFlow PiConsole

To ‘what’ display specifically ?

Sorry. The main screen, bottom middle.

Hi… I have installed ubunto 18.04 as a dual boot on a windows 10 laptop. Following the instructions ( at least I thought I was), I got to this point

jim@jim-HP-Notebook:~$ wfpiconsole start

Traceback (most recent call last):

File “main.py”, line 28, in

from lib     import config as configFile

File “/home/jim/wfpiconsole/lib/config.py”, line 27, in
import distro

ModuleNotFoundError: No module named ‘distro’

jim@jim-HP-Notebook:~$

Can anyone point me toward what I need to fix?

Many thanx… jt

Jim Tolbert
jim@riverridge-wi.net

Hi @bruce4, I’m not sure I follow exactly what you are asking here? From your screenshot it looks like you have already added another time to the display?

Hi @jim5, sorry you have run into issues! You should be able to fix it by running:

python3 -m pip install distro

How did you install the console on your Ubuntu machine? Did you use the one-line installer (i.e. curl -sSL https://peted-davis.github.io/wfpiconsole | bash)? If so, then the distro module should already have been installed. There may be a bug that I need to look into to.

Hi Peter … Thank you very much. I will try this. Yes… I used the one line installer. I will let you know.

Hi Peter… The distro installed and wfpiconsole started and asked for my checkwx api key.
jim@jim-HP-Notebook:~$ wfpiconsole start

===================================================
Starting wfpiconsole configuration wizard

Required fields are marked with an asterix (*)

API keys

Please enter your CheckWX API Key*: f4ce9a5069e545c8a9ea362bb4
Traceback (most recent call last):
File “main.py”, line 33, in
configFile.create()
File “/home/jim/wfpiconsole/lib/config.py”, line 100, in create
writeConfigKey(Config,Section,Key,default[Section][Key])
File “/home/jim/wfpiconsole/lib/config.py”, line 431, in writeConfigKey
validateAPIKeys(Config)
File “/home/jim/wfpiconsole/lib/config.py”, line 452, in validateAPIKeys
CHECKWX = requests.get(URL,headers=header).json()
File “/usr/lib/python3/dist-packages/requests/api.py”, line 72, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/lib/python3/dist-packages/requests/api.py”, line 58, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/lib/python3/dist-packages/requests/sessions.py”, line 506, in request
prep = self.prepare_request(req)
File “/usr/lib/python3/dist-packages/requests/sessions.py”, line 449, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File “/usr/lib/python3/dist-packages/requests/models.py”, line 306, in prepare
self.prepare_headers(headers)
File “/usr/lib/python3/dist-packages/requests/models.py”, line 440, in prepare_headers
check_header_validity(header)
File “/usr/lib/python3/dist-packages/requests/utils.py”, line 869, in check_header_validity
raise InvalidHeader(“Invalid return character or leading space in header: %s” % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-API-Key
jim@jim-HP-Notebook:~$

In cases I had a leading of trailing blank, I tried copying the checkwx api and received the same result.

Sorry for being so dumb in the stuff. thanks for you help… jt

Sorry. I’ll be more specific. That was a cut & paste example of what I want it to do. Currently there is only one time field centered under the date on my display. Is there any documentation on this program besides the readme on Github? I hate to keep asking these simple questions. I also want to attempt to add Density Altitude to the display but that’s another topic.

Ahhh! That makes more sense. I was confused by the screenshot. Sorry! I’m afraid there is no documentation for modifying the code. I can point you in the right direction though - the layout code is contained in wfpiconsole.kv, and the clock and date are specified on lines 774-782. You will want to add another TimeDateField and tweak the x position and and size_hint_x fields so that it takes up half the available space.

I’ve tested this a couple of times now with both old and new API keys and I cannot reproduce the error you are seeing. Are you 100% sure you are copying the API key correctly? It should be 26 characters long, and look something like this: a05a8872ba2d4f1997cc0a4094 (note this one won’t work!).

I will try it again when I get home this evening. Thanx, Peter… jt

G’Evening, Peter…

So I deleted by CheckWX Api token and got a new one. When I put that in at the prompt in wfpiconsole, I got the same series of errors.
So then I ran the curl command and it “checked” everything, but found 13 additional files that needed to be updated and it did that.
Then I put the (new) checkWX api again and got the same (I’ll include this below). I have worked with computers for 45 years and recognize the problem is probably mine… but I don’t know where to start. Should I reformat the partition? Should delete all the files in the partition? Should I follow a more surgical approach?
I can’t tell you how much I appreciate your assistance as I recognize my limitations and the applicability of the Fortran IV skill :wink: But I wanna make this work. Thanks again… jt

Here is the dump from the latest run.....
jim@jim-HP-Notebook:~$ python3 -m pip install distro
Defaulting to user installation because normal site-packages is not writeable
Collecting distro
  Downloading distro-1.5.0-py2.py3-none-any.whl (18 kB)
Installing collected packages: distro
Successfully installed distro-1.5.0
jim@jim-HP-Notebook:~$ wfpiconsole start

  ===================================================
  Starting wfpiconsole configuration wizard          
  ===================================================

  Required fields are marked with an asterix (*)     

  API keys
  ---------------------------------
  Please enter your CheckWX API Key*:  f4ce9a5069e545c8a9ea362bb4 
Traceback (most recent call last):
  File "main.py", line 33, in <module>
    configFile.create()
  File "/home/jim/wfpiconsole/lib/config.py", line 100, in create
    writeConfigKey(Config,Section,Key,default[Section][Key])
  File "/home/jim/wfpiconsole/lib/config.py", line 431, in writeConfigKey
    validateAPIKeys(Config)
  File "/home/jim/wfpiconsole/lib/config.py", line 452, in validateAPIKeys
    CHECKWX = requests.get(URL,headers=header).json()
  File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 506, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3/dist-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/usr/lib/python3/dist-packages/requests/utils.py", line 869, in check_header_validity
    raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-API-Key
jim@jim-HP-Notebook:~$ wfpiconsole start

  ===================================================
  Starting wfpiconsole configuration wizard          
  ===================================================

  Required fields are marked with an asterix (*)     

  API keys
  ---------------------------------
  Please enter your CheckWX API Key*:  f4ce9a5069e545c8a9ea362bb4
Traceback (most recent call last):
  File "main.py", line 33, in <module>
    configFile.create()
  File "/home/jim/wfpiconsole/lib/config.py", line 100, in create
    writeConfigKey(Config,Section,Key,default[Section][Key])
  File "/home/jim/wfpiconsole/lib/config.py", line 431, in writeConfigKey
    validateAPIKeys(Config)
  File "/home/jim/wfpiconsole/lib/config.py", line 452, in validateAPIKeys
    CHECKWX = requests.get(URL,headers=header).json()
  File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 506, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3/dist-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/usr/lib/python3/dist-packages/requests/utils.py", line 869, in check_header_validity
    raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-API-Key
jim@jim-HP-Notebook:~$ wfpiconsole start

  ===================================================
  Starting wfpiconsole configuration wizard          
  ===================================================

  Required fields are marked with an asterix (*)     

  API keys
  ---------------------------------
  Please enter your CheckWX API Key*:  b29a49976e9f436181ef3c9bed
Traceback (most recent call last):
  File "main.py", line 33, in <module>
    configFile.create()
  File "/home/jim/wfpiconsole/lib/config.py", line 100, in create
    writeConfigKey(Config,Section,Key,default[Section][Key])
  File "/home/jim/wfpiconsole/lib/config.py", line 431, in writeConfigKey
    validateAPIKeys(Config)
  File "/home/jim/wfpiconsole/lib/config.py", line 452, in validateAPIKeys
    CHECKWX = requests.get(URL,headers=header).json()
  File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 506, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3/dist-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/usr/lib/python3/dist-packages/requests/utils.py", line 869, in check_header_validity
    raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-API-Key
jim@jim-HP-Notebook:~$ curl -sSL https://peted-davis.github.io/wfpiconsole | bash
[sudo] password for jim: 

  [✓] Root user check passed
  [✓] Hardware check passed (x86_64)
  [✓] OS check passed (Ubuntu 18.04.5 LTS)

  ================================ 
  Installing WeatherFlow PiConsole 
  ================================ 

  [✓] Checking for updated packages
  [✓] Installing updated packages

  [i] WeatherFlow PiConsole dependency checks...
  [✓] Checking for git
  [✓] Checking for curl
  [✓] Checking for rng-tools
  [✓] Checking for build-essential
  [✓] Checking for python3-pip
  [✓] Checking for python3-setuptools
  [✓] Checking for libssl-dev
  [✓] Checking for libffi6
  [✓] Checking for libffi-dev
  [✓] Checking for jq

  [i] WeatherFlow PiConsole Python module checks...
  [✓] Updating Python package manager
  [✓] Checking for Python module autobahn[twisted]
  [✓] Checking for Python module numpy
  [✓] Checking for Python module pytz
  [✓] Checking for Python module pyasn1-modules
  [✓] Checking for Python module service_identity
  [✓] Checking for Python module geopy
  [✓] Checking for Python module ephem
  [✓] Checking for Python module pillow
  [✓] Checking for Python module packaging
  [✓] Checking for Python module pyOpenSSL
  [✓] Checking for Python module distro
  [✓] Checking for Python module cython 

  [i] Kivy Python library dependency checks...
  [✓] Checking for ffmpeg
  [✓] Checking for libsdl2-dev
  [✓] Checking for libsdl2-image-dev
  [✓] Checking for libsdl2-mixer-dev
  [✓] Checking for libsdl2-ttf-dev
  [✓] Checking for libportmidi-dev
  [✓] Checking for libswscale-dev
  [✓] Checking for libavformat-dev
  [✓] Checking for libavcodec-dev
  [✓] Checking for zlib1g-dev
  [✓] Checking for libgstreamer1.0-dev
  [✓] Checking for gstreamer1.0-plugins-base
  [✓] Checking for gstreamer1.0-plugins-good

  [✓] Kivy Python library installation check 

  [✓] Installing the latest version of WeatherFlow PiConsole: v4.0.1
  
  ============================================ 
  WeatherFlow PiConsole installation complete! 
  Start the console with: 'wfpiconsole start'  
  ============================================ 

jim@jim-HP-Notebook:~$ wfpiconsole start

  ===================================================
  Starting wfpiconsole configuration wizard          
  ===================================================

  Required fields are marked with an asterix (*)     

  API keys
  ---------------------------------
  Please enter your CheckWX API Key*:  b29a49976e9f436181ef3c9bed
Traceback (most recent call last):
  File "main.py", line 33, in <module>
    configFile.create()
  File "/home/jim/wfpiconsole/lib/config.py", line 100, in create
    writeConfigKey(Config,Section,Key,default[Section][Key])
  File "/home/jim/wfpiconsole/lib/config.py", line 431, in writeConfigKey
    validateAPIKeys(Config)
  File "/home/jim/wfpiconsole/lib/config.py", line 452, in validateAPIKeys
    CHECKWX = requests.get(URL,headers=header).json()
  File "/usr/lib/python3/dist-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 506, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 449, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python3/dist-packages/requests/models.py", line 306, in prepare
    self.prepare_headers(headers)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 440, in prepare_headers
    check_header_validity(header)
  File "/usr/lib/python3/dist-packages/requests/utils.py", line 869, in check_header_validity
    raise InvalidHeader("Invalid return character or leading space in header: %s" % name)
requests.exceptions.InvalidHeader: Invalid return character or leading space in header: X-API-Key
jim@jim-HP-Notebook:~$

Sorry to all for trashing the thread. Is there a better way to do this?.. jt

Hello @peter, I’ve been using your console since the beginning and I have to praise you, since the last version 4.0.1 the software runs like a Swiss clock!
It runs on 4 different Raspberrys…
Thank you for your effort and all the time you spent for it.
I would also like to thank you that you are always looking for and finding an answer to all the problems with the console here in the forum.
Greetings from Italy
Patrick

1 Like

This peculiar… I have a Ubuntu 18.04 dual boot setup as well so I will do some more testing this evening. In the meantime, can you try making an API request manually from the terminal. Something like this will work:

curl 'https://api.checkwx.com/metar/KJFK' -H 'X-API-Key: b29a49976e9f436181ef3c9bed'

For me it returns something looking like this:

{"results":1,"data":["KJFK 240851Z 29013KT 10SM FEW060 06/M01 A3020 RMK AO2 SLP225 T00561006 51013 $"]}

Hopefully this might begin to narrow down where the problem is. I also copied the same API key into the console and it worked as well. Have you tried manually typing the API key into the console rather than using copy/paste? That might help indicate where the problem is.

Note I took the API key from the terminal output you shared above - you might want to delete and regenerate it once everything is working so others can’t use it.

Thanks for your kind words @patrick.mussner! It is much appreciated :smiley:

Hey Peter…

It Works! It’s beautiful!
The problem, a surprise to no one, was me!
Once I typed the CheckWX API token in(rather than copying), and used the correct info for the rest data, everything went right on thru.
Thanks so much for your assistance!.. jt

Peter
Capture
Rainfall where it says 0% is that the current rainfall at this moment
or is it the forecast rainfall for now?
If it’s for “now”
How often does the Daily % update?

The 0% is the expected chance of rainfall at the point in time that the hourly forecast is valid. So in the screenshot you shared the expected chance of rain at 17:00 is 0%. The daily % is extracted from the latest daily forecast every hour, however I do not know how frequently WeatherFlow run their forecast model.

Brilliant! That’s great news. Glad we managed to get it up and running :smiley: