Error starting wfpiconsole - unable to fetch station metadata

A few hours ago I rebooted my RaspberryPi, and found that afterwards wfpiconsole didn’t seem to want to restart.

Error message was

Error: unable to fetch station metadata

Looking at the code I found that this message was coming from config.py after it does a test call to the Station metadata API. Calling the same URL wirh curl from the command line confirmed that this was indeed where the problem was.

Strangely, I use the same API call for some of my own code and that was still working fine. But I noticed that my code uses a URL parameter of token, rather than api_key which is used here.

So I tried changing line 188 of config.py to read:

Template = 'https://swd.weatherflow.com/swd/rest/observations/station/{}?token={}'

(I also made similar changes to lines 401 and 557)

This seemed to do the trick and I have my console running again. Not sure what has caused this, although it does seem from other posts on this forum, that there have been some recent issues with the API - so maybe related? The official API documentation does suggest using token as the URL parameter, so maybe safer to stick to that.

Anyway, I thought I would post in case others are seeing similar issues.

EDIT: I’ve noticed that token seems to be used as a URL parameter in all other calls to the API in the code. So the use of api_key in config.py was perhaps a bit of legacy code that wasn’t updated?

1 Like

Sorry for this issue - you are correct that it was some legacy code that I forgot to update. I have just pushed a new release that should solve this issue

1 Like

5 posts were split to a new topic: Configuration error