dragondaud / myClock

Pixel Display NTP/Weather Clock for ESP8266/ESP32
MIT License
26 stars 13 forks source link

GET Weather issue again #10

Closed anthonyjclarke closed 5 years ago

anthonyjclarke commented 5 years ago

Again, been working for a while... noticed -11 red in the corner. Plugged into Serial Port, recompiled and uploaded

Serial output :

readSPIFFS: mounted WiFi: myClock-EEDEA1 192.168.1.87 getIPlocation: Telstra Corporation, New South Wales, AU, Australia/Sydney 16:58:25.585 -> setup: 2112, Australia/Sydney, true setNTP: configure NTP ....... OK 16:58:33.828 -> setNTP: next timezone check @ Mon Apr 1 02:00:00 2019 16:58 16:58:34.910 -> http://api.openweathermap.org/data/2.5/weather?zip=2112,AU&units=metric&lang=en&appid=7d78f48198d62b872d371929ecf898a8 16:58:34.943 -> getWeather: GET failed: -11 read Timeout 16:58 16 6536 16:59 85 7104 17:00 76 7304

When I copy the Get Weather URL (I added a line to print it) in a browser immediately :

{"coord":{"lon":151.18,"lat":-33.79},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":21.07,"pressure":1015,"humidity":35,"temp_min":19.44,"temp_max":22.22},"visibility":10000,"wind":{"speed":6.2,"deg":260},"clouds":{"all":0},"dt":1554011885,"sys":{"type":1,"id":9600,"message":0.0062,"country":"AU","sunrise":1553976357,"sunset":1554018788},"id":170000270,"name":"Sydney","cod":200}

Any thoughts?

dragondaud commented 5 years ago

The library HTTPClient is getting a timeout on reading the response. If you poll too often with free account, it will not respond. And you just posted your API key on a public forum, so anybody could be using it. I would regenerate your API key and keep it private. When I run the image in the 'bin' directory on github I have over 10k freeheap (the number printed after the time) in the loop, so something is probably failing from not having enough memory. When you compile, make sure to have NoAssert-NDEBUG for Debug Level and use lwIP v2 (lower memory).

Also, OpenWeatherMap has not been providing accurate weather information for my location frequently, so I'v been working on adding Accuweather as an option. When I tried compiling myClock with the latest github version of core and other libs I'm getting a failure that I haven't tracked down yet. It should work with the latest released version though, which is more memory efficient than the previous release.

On Sun, Mar 31, 2019 at 12:04 AM Anthony Clarke notifications@github.com wrote:

Again, been working for a while... noticed -11 red in the corner. Plugged into Serial Port, recompiled and uploaded

Serial output :

readSPIFFS: mounted WiFi: myClock-EEDEA1 192.168.1.87 getIPlocation: Telstra Corporation, New South Wales, AU, Australia/Sydney 16:58:25.585 -> setup: 2112, Australia/Sydney, true setNTP: configure NTP ....... OK 16:58:33.828 -> setNTP: next timezone check @ Mon Apr 1 02:00:00 2019 16:58 16:58:34.910 -> http://api.openweathermap.org/data/2.5/weather?zip=2112,AU&units=metric&lang=en&appid=7d79f48198d62b872d371929ecf898a8 16:58:34.943 -> getWeather: GET failed: -11 read Timeout 16:58 16 6536 16:59 85 7104 17:00 76 7304

When I copy the Get Weather URL (I added a line to print it) in a browser immediately :

{"coord":{"lon":151.18,"lat":-33.79},"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"base":"stations","main":{"temp":21.07,"pressure":1015,"humidity":35,"temp_min":19.44,"temp_max":22.22},"visibility":10000,"wind":{"speed":6.2,"deg":260},"clouds":{"all":0},"dt":1554011885,"sys":{"type":1,"id":9600,"message":0.0062,"country":"AU","sunrise":1553976357,"sunset":1554018788},"id":170000270,"name":"Sydney","cod":200}

Any thoughts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dragondaud/myClock/issues/10, or mute the thread https://github.com/notifications/unsubscribe-auth/AZnTPsghXidvHDIM-Kk6cTGvOWmjttvGks5vcE_4gaJpZM4cUI4z .

-- david denney dragondaud AT gmail DOT com 719-821-8900