linuxmint / cinnamon-spices-applets

Applets for the Cinnamon desktop
http://cinnamon-spices.linuxmint.com
591 stars 503 forks source link

weather@mockturtl Incorrect API Key error with Weather Underground #4629

Open garuffalo opened 1 year ago

garuffalo commented 1 year ago
 * Version 3.2.11 (2023-01-01 15:22:22)
 * Cinnamon Version 4.4.8
 * Linux Mint 19.3
 * Intel Mobile GM965/GL960 Integrated Graphics *and* i915 driver

Notify author of applet @Gr3q

Issue Weather applet currently showing "Incorrect API Key" instead of current conditions. Correct API key is entered in configurations. Logged into Weather Underground account to verify key.

Steps to reproduce Switch to another service for which I have an API key (Dark Sky) and applet displays conditions normally. Same with non-API services like OpenWeatherMap and U.S. National Weather.

Expected behaviour Correct API key should show current conditions in the panel applet.

Other information incorrect_api_key

garuffalo commented 1 year ago

Snippet of Looking Glass log might help:

error t=2023-01-03T14:58:06Z [weather@mockturtl#45]: Retrying in the next 60 seconds... error t=2023-01-03T14:58:06Z [weather@mockturtl#45]: Could not refresh weather, data could not be obtained. info t=2023-01-03T14:59:06Z [weather@mockturtl#45]: Error calling URL: Unauthorized,

Access Denied

Access Denied

You don't have permission to access "http://api.weather.com/v3/location/near?" on this server.

Reference #18.1cf36e68.1672775946.e7f90969

error t=2023-01-03T14:59:07Z [weather@mockturtl#45]: Retrying in the next 75 seconds... error t=2023-01-03T14:59:07Z [weather@mockturtl#45]: Could not refresh weather, data could not be obtained. info t=2023-01-03T15:00:22Z [weather@mockturtl#45]: Error calling URL: Unauthorized,

Access Denied

Access Denied

You don't have permission to access "http://api.weather.com/v3/location/near?" on this server.

Reference #18.14f36e68.1672776022.be98fd85

error t=2023-01-03T15:00:22Z [weather@mockturtl#45]: Retrying in the next 90 seconds... error t=2023-01-03T15:00:22Z [weather@mockturtl#45]: Could not refresh weather, data could not be obtained.

Gr3q commented 1 year ago

Have your Account type changed?

garuffalo commented 1 year ago

As far as I can tell, no, my account type has not changed. I have only had the account for a few days. I signed up using the Raspberry Pi workaround you suggested.

Under "Your Membership > Status" it says "Paid Membership" (even though I didn't pay anything). On the API Keys section it says, "Expires: Sat, 24 Jun 2023 16:52:24 GMT". I don't know what happens after that.

garuffalo commented 1 year ago

I just logged in to my account for Weather Underground, and it is showing my device as "offline". Any idea how to get it back online?

offline

garuffalo commented 1 year ago

Weather Underground API works most of the time, but I'm still getting "Incorrect API Key" from time to time. It seems intermittent. I can't tie it to anything. I logged in to my WU account and the key is valid. Restarting Cinnamon does nothing. I also sometimes get "Service Error" in the conditions area. Actually, in the latest instance, that is what preceded "Incorrect API Key". The applet generally goes back to working correctly after letting some time pass. Frustrating, because I like Weather Underground as a data source.

Gr3q commented 1 year ago

I'll have a look at the documentation more closely maybe they mention something about ratelimits or request limits. If they don't, they definitely don't put it out at the front...

garuffalo commented 1 year ago

I'm now trying the update interval at 15 minutes. I had it set to 10 minutes (and 5 min. before that). Will see if fewer calls per day will help.

garuffalo commented 1 year ago

May be a little early to report, but WU API, in the applet, seemed to work without issue all day yesterday, after I had switched to 15 minute update interval. Will continue with this for a few days, and then switch back to 10 min. to see if that affects anything.

garuffalo commented 1 year ago

So far, so good, with the update interval at 15 minutes. No errors. Will test for awhile more and then try shorter intervals to see if I can reproduce the error.

garuffalo commented 1 year ago

I changed the update interval for WU to 5 minutes (from 15 min., which had been working quite well). For a time, it seemed as if things were working OK at 5 min., but last night I left my computer on all night and in the morning I saw "service error", and then, later, "incorrect API key". My testing is far from scientific, but it seems that WU does not like the shorter update intervals. I have set it back to 15 minutes and went back to using Dark Sky for the day. It is my guess that after some time, the WU call clock will reset and I will be able to resume using WU.

Gr3q commented 1 year ago

I still can't see any limits mentioned anywhere. The best I could do is enable debug logging and run weather underground and count the calls in a day.

Gr3q commented 1 year ago

After some testing it looks like about 1500 calls/day, but one pass in the applet can take about 3-15 (depending on location) calls, mostly building a somewhat reliable observation data from multiple stations.

So yeah it's not enough for a day.

I'll check tomorrow as well if it resets and if it goes above again

Edit: Yeah, tested it today as well, it has a limit of 1500 calls a day. I'll update the README and I'll try to add a remaining call counter as for some of the other providers

garuffalo commented 1 year ago

I have left my computer up and running for several days and nights now, with the update interval set at 15 minutes for Weather Underground. No issues, so I am happy to leave the setting there.

MacMaverick855 commented 1 year ago

I have a Personal Weather Station (PWS) with an API key, It worked forever on all my phone apps accessing the PWS using a two year old API key. After running into the exact same problems above with Weather, I changed my API key, entered it and the Weather applet worked, for a day, with the call interval at 5 minutes. After changing API keys 4 times, I did a search and found several references to changing the interval to 15 minutes. At 5 minutes intervals, only 288 calls should be made per day. If the limit is 1500, why would the API key be rejected? (Rhetorical)

I would love to be able to see my PWS updates as often as they occur (every three seconds) on my linux desktop. This is not a show stopper because just being able to SEE my PWS on my desktop is hella-cool!!!

Have switched to 15 minute intervals to see if this helps.

MacMac855

Gr3q commented 1 year ago

After some testing it looks like about 1500 calls/day, but one pass in the applet can take about 3-15 (depending on location) calls, mostly building a somewhat reliable observation data from multiple stations.

Because of API limitations and spotty observation data from stations, I need to make calls:

This happens at each pass.