raphv / galactic-weather-clock

A clock showing the weather on a Pimoroni Galactic Unicorn
7 stars 1 forks source link

Issue with Getting weather -1 #1

Open PsychoShaft opened 1 year ago

PsychoShaft commented 1 year ago

Error fetching time -1 Time to update weather Updating weather http://api.open-meteo.com/v1/forecast?latitude=52.9&longitude=-1.4&timezone=Europe%2FLondon&hourly=weathercode,temperature_2m&forecast_days=2&current_weather=true Error getting weather -1

raphv commented 1 year ago

Hi @PsychoShaft, this looks like a network issue since both the NTP server and the OpenMeteo API return an issue. It might be that your home router is blocking requests or not providing correct DNS information

Make sure you have a file called WIFI_CONFIG.py with your credentials:

SSID = 'HomeRouter'
PSK = 'P@$$w0rd1234'

Can you try connecting directly in the REPL/Python interpreter, e.g. via Thonny or Mu? Normally when you run connect(), it will show the IP address your router assigns you.

>>> from connect import connect
>>> connect()
>>> import urequests
>>> req = urequests.get('http://api.open-meteo.com/v1/forecast?latitude=52.9&longitude=-1.4&timezone=Europe%2FLondon&hourly=weathercode,temperature_2m&forecast_days=2&current_weather=true')
>>> print(req.json())