LukePrior / LukePrior/Raspberry-Pi-Thermal-Printer

Invalid API Key provided

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

@LukePrior, I'm so excited to try out this thermal printer script that I stumbled on at diyodemag.org. I loved the writeup so much that I subscribed to the magazine! But I am having an issue. I suspect that something may have changed at openweathermap.org with what they permit using the free API. I have a tested valid API but `weather.py` is still returning the following error. Can you confirm?

` File "/home/pi/Raspberry-Pi-Thermal-Printer/code/weather.py", line 38, in
one_call = mgr.one_call(lat=lat, lon=lon)
File "/home/pi/.local/lib/python3.9/site-packages/pyowm/weatherapi25/weather_manager.py", line 531, in one_call
_, json_data = self.http_client.get_json(ONE_CALL_URI, params=params)
File "/home/pi/.local/lib/python3.9/site-packages/pyowm/commons/http_client.py", line 158, in get_json
HttpClient.check_status_code(resp.status_code, resp.text)
File "/home/pi/.local/lib/python3.9/site-packages/pyowm/commons/http_client.py", line 313, in check_status_code
raise exceptions.UnauthorizedError('Invalid API Key provided')
pyowm.commons.exceptions.UnauthorizedError: Invalid API Key provided`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with code/weather.py at line 38, where pyowm calls one_call with the configured coordinates, and compare the reported behavior with OpenWeatherMap's current API requirements. Confirm whether the tested key is accepted for this request and identify what must change for the script to run without the UnauthorizedError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
api, embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.