# Weather-phat

**URL:** <https://forums.pimoroni.com/t/weather-phat/23186>\
**Category:** Raspberry Pi\
**Created:** [October 30, 2023, 8:50am UTC](https://forums.pimoroni.com/t/weather-phat/23186 "2023-10-30T08:50:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![akio](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@akio](https://forums.pimoroni.com/u/akio)\
**Post date:** [October 30, 2023, 8:50am UTC](https://forums.pimoroni.com/t/weather-phat/23186/1 "2023-10-30T08:50:12Z")

</div>

## i use raspbary py zero 2 w with phat, and then run the program. python3 /home/akio/Pimoroni/inky/examples/phat/weather-phat.py But print time out error.How I can change? Please teach me. Akio

Status code Unknown from [https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find:](https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find:) ERROR - HTTPSConnectionPool(host=‘[geocode.arcgis.com](http://geocode.arcgis.com)’, port=443): Read timed out. (read timeout=5.0)  
Traceback (most recent call last):  
File “/home/akio/Pimoroni/inky/examples/phat/weather-phat.py”, line 112, in   
weather = get\_weather(location\_string)  
File “/home/akio/Pimoroni/inky/examples/phat/weather-phat.py”, line 73, in get\_weather  
res = requests.get(“[https://api.open-meteo.com/v1/forecast?latitude=](https://api.open-meteo.com/v1/forecast?latitude=)” + str(coords[0]) + “&longitude=” + str(coords[1]) + “&current\_weather=true”)  
TypeError: ‘NoneType’ object is not subscriptable

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [October 30, 2023, 9:45am UTC](https://forums.pimoroni.com/t/weather-phat/23186/2 "2023-10-30T09:45:08Z")

</div>

That error looks like the example is struggling to connect to the weather API, does this happen every time?

Is your Pi connected to the internet?

---

<div class="post-metadata">

**Author:** ![akio](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@akio](https://forums.pimoroni.com/u/akio)\
**Post date:** [October 30, 2023, 9:34pm UTC](https://forums.pimoroni.com/t/weather-phat/23186/3 "2023-10-30T21:34:19Z")

</div>

That error is the example is having trouble connecting to the weather API. I can connect once in 5 times.

The Pi is connected to the internet via Wi-Fi.  
Akio

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [October 31, 2023, 7:13am UTC](https://forums.pimoroni.com/t/weather-phat/23186/4 "2023-10-31T07:13:53Z")

</div>

From the trace, it seems that [geocode.arcgis.com](http://geocode.arcgis.com) has a problem. Not open-meteo.

---

<div class="post-metadata">

**Author:** ![hel](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/hel/32/6075_2.png) [@hel](https://forums.pimoroni.com/u/hel)\
**Post date:** [October 31, 2023, 2:21pm UTC](https://forums.pimoroni.com/t/weather-phat/23186/5 "2023-10-31T14:21:00Z")

</div>

You could add your latitude and longitude manually to this line (and comment out the `coords =` line) if you’re having trouble with the geocoder library/arcgis:

> <https://github.com/pimoroni/inky/blob/776addf15d60ac720ac29893eeb902f0feea9108/examples/phat/weather-phat.py#L73>

---

<div class="post-metadata">

**Author:** ![akio](https://avatars.discourse-cdn.com/v4/letter/a/57b2e6/32.png) [@akio](https://forums.pimoroni.com/u/akio)\
**Post date:** [June 3, 2024, 11:12pm UTC](https://forums.pimoroni.com/t/weather-phat/23186/6 "2024-06-03T23:12:05Z")

</div>

Thank you very much. I appreciate it.
