pimoroni-pico icon indicating copy to clipboard operation
pimoroni-pico copied to clipboard

Add Garbage Collection to weather example

Open LeePorte opened this issue 1 year ago • 1 comments
trafficstars

The existing weather example was resulting in OSError: [Errno 12] ENOMEM when executing subsequent calls to the open-meteo API.

After adding the garbage collection I am no longer seeing these errors and data is being collected as per the timer.

Requesting URL: https://api.open-meteo.com/v1/forecast?latitude=**.******&longitude=-*.*******&current_weather=true&timezone=auto
Data obtained!
Temperature = 17.8°C
Conditions = slight rain
Last Open-Meteo update: 2024-07-24, 19:45
    
Requesting URL: https://api.open-meteo.com/v1/forecast?latitude=**.******&longitude=-*.*******&current_weather=true&timezone=auto
Data obtained!
Temperature = 17.6°C
Conditions = cloudy
Last Open-Meteo update: 2024-07-24, 20:00

Requesting URL: https://api.open-meteo.com/v1/forecast?latitude=**.******&longitude=-*.*******&current_weather=true&timezone=auto
Data obtained!
Temperature = 17.4°C
Conditions = cloudy
Last Open-Meteo update: 2024-07-24, 20:15

LeePorte avatar Jul 24 '24 19:07 LeePorte

Sorry, and thank you, all the RP2350 and SDK 2.0 stuff has been keeping me busy!

Gadgetoid avatar Aug 18 '24 11:08 Gadgetoid