Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)
Release Open-Meteo Weather
#91
One thing that should be changed: Your service should listen to "OnSleep" and "OnWake" notifications. Once you receive "OnSleep" you should not do any network activties (weather data download for example) until you receive "OnWake". Sleep does not (always) mean to suspend suspend to disk or to RAM. On Android it is more like macOS "pwer napping", where the machine is up, but with only limited functionality. On Android, there will no network access possible in that mode, for both local network and internet. I'm currently seeing lot's of errors in my Kodi log, where your addon is trying to download weather data while the Android machine is "sleeping".

BTW: Hourly forecast tiles seem not to update properly after those errors caused by sleep mode. Machine went to sleep today between 0:00 and 1:00, then the errors started, and after wakeup of the device today at 9:00, first hourly tile displayed temperature for 1:00, and did not update itself it seemed until next Kodi restart.
Reply
#92
(2024-10-31, 10:20)ksooo Wrote: One thing that should be changed: Your service should listen to "OnSleep" and "OnWake" notifications. Once you receive "OnSleep" you should not do any network activties (weather data download for example) until you receive "OnWake". Sleep does not (always) mean to suspend suspend to disk or to RAM. On Android it is more like macOS "pwer napping", where the machine is up, but with only limited functionality. On Android, there will no network access possible in that mode, for both local network and internet. I'm currently seeing lot's of errors in my Kodi log, where your addon is trying to download weather data while the Android machine is "sleeping".
Thanks for that info!
Listening and acting on such events might be a little bit overkill for that issue, a simple connectivity check before starting the download threads should do the trick here.

Quote:BTW: Hourly forecast tiles seem not to update properly after those errors caused by sleep mode. Machine went to sleep today between 0:00 and 1:00, then the errors started, and after wakeup of the device today at 9:00, first hourly tile displayed temperature for 1:00, and did not update itself it seemed until next Kodi restart.
It's hard to tell without seeing any logs but it's actually KODIs job to start the weather thread after the device wakes up. If there is no WEATHER: Downloading weather log entry right after your device wakes up then this issue would happen with every weather addon and a condition check for that situation should be added to KODI, otherwise it's probably an addon issue.

Providing full logfiles (not only addon entries) would be really helpful here:
  • Log snippet before/after when the download errors start
  • Log snippet when your device wakes up
Thanks!
Skin: Night | Weather: weather.openmeteo | Metadata / News (soon): plugin.universal.data | All-in-one KODI client & Night v3 (soon): OpenHT
Reply
#93
> If there is no WEATHER: Downloading weather log entry right after your device wakes up

There definitely is. I see that kodi requests data from the addon right after wakeup.

I even tried switching locations manually which worked on general, but hourly tiles did not update the time, even for the other locations.
Reply
#94
From my log::


2024-11-01 08:02:24.045 T:9509     info <general>: [weather.openmeteo]: [LOC3] Downloading map: rvradar
2024-11-01 08:02:24.063 T:9510     info <general>: [weather.openmeteo]: [LOC3] Downloading map: rvsatellite
2024-11-01 08:02:26.157 T:9510     info <general>: [weather.openmeteo]: [E] Download: https://api.rainviewer.com/public/weather-maps.json (HTTPSConnectionPool(host='api.rainviewer.com', port=443): Max retries exceeded with url: /public/weather-maps.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x27dd87c490>: Failed to resolve 'api.rainviewer.com' ([Errno 7] No address associated with hostname)")))
2024-11-01 08:02:26.157 T:9510     info <general>: [weather.openmeteo]: [E] RVIndex rvsatellite currently not available ...
2024-11-01 08:02:26.181 T:9510     info <general>: [weather.openmeteo]: [LOC3] Downloading map: gctemp
2024-11-01 08:02:26.181 T:9509     info <general>: [weather.openmeteo]: [E] Download: https://api.rainviewer.com/public/weather-maps.json (HTTPSConnectionPool(host='api.rainviewer.com', port=443): Max retries exceeded with url: /public/weather-maps.json (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x27de2b5ec0>: Failed to resolve 'api.rainviewer.com' ([Errno 7] No address associated with hostname)")))
2024-11-01 08:02:26.182 T:9509     info <general>: [weather.openmeteo]: [E] RVIndex rvradar currently not available ...
2024-11-01 08:02:26.202 T:9509     info <general>: [weather.openmeteo]: [LOC3] Downloading map: gcwind
2024-11-01 08:02:28.329 T:9509     info <general>: [weather.openmeteo]: [E] Download: https://geo.weather.gc.ca/geomet?SERVICE...=image/png (HTTPSConnectionPool(host='geo.weather.gc.ca', port=443): Max retries exceeded with url: /geomet?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=53.33087298301705,11.25,54.1624339680678,12.65625&CRS=EPSG:4326&WIDTH=256&HEIGHT=256&LAYERS=GDPS.ETA_UU&FORMAT=image/png (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x27dea0ecd0>: Failed to resolve 'geo.weather.gc.ca' ([Errno 7] No address associated with hostname)")))
2024-11-01 08:02:28.329 T:9509     info <general>: [weather.openmeteo]: [E] Map gcwind currently not available ...
2024-11-01 08:02:28.334 T:9510     info <general>: [weather.openmeteo]: [E] Download: https://geo.weather.gc.ca/geomet?SERVICE...=image/png (HTTPSConnectionPool(host='geo.weather.gc.ca', port=443): Max retries exceeded with url: /geomet?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=53.33087298301705,11.25,54.1624339680678,12.65625&CRS=EPSG:4326&WIDTH=256&HEIGHT=256&LAYERS=GDPS.ETA_TT&FORMAT=image/png (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x27de630c30>: Failed to resolve 'geo.weather.gc.ca' ([Errno 7] No address associated with hostname)")))
2024-11-01 08:02:28.334 T:9510     info <general>: [weather.openmeteo]: [E] Map gctemp currently not available ...
2024-11-01 08:02:28.863 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: weather
2024-11-01 08:02:29.038 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: airquality
2024-11-01 08:02:29.134 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: moon
2024-11-01 08:02:31.221 T:20043    info <general>: [weather.openmeteo]: Finished (24.265 sec)
...
2024-11-01 08:06:39.310 T:19537    info <general>: Got device wakeup intent
2024-11-01 08:06:39.724 T:19955    info <general>: OnWake: Running resume jobs
...
2024-11-01 08:06:40.585 T:19955    info <general>: PumpPowerEvents: OnWake called
...
2024-11-01 08:07:24.554 T:10473    info <general>: WEATHER: Downloading weather
2024-11-01 08:07:28.152 T:10623    info <general>: [weather.openmeteo]: [LOC1] Updating data: weather
2024-11-01 08:07:28.337 T:10623    info <general>: [weather.openmeteo]: [LOC1] Updating data: airquality
2024-11-01 08:07:28.448 T:10623    info <general>: [weather.openmeteo]: [LOC1] Updating data: moon
2024-11-01 08:07:30.871 T:10473    info <general>: WEATHER: Weather download okay!
2024-11-01 08:07:31.282 T:20043    info <general>: [weather.openmeteo]: Initialising ...
2024-11-01 08:07:33.947 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: weather
2024-11-01 08:07:34.145 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: airquality
2024-11-01 08:07:34.259 T:20043    info <general>: [weather.openmeteo]: [LOC1] Updating data: moon
...
2024-11-01 08:07:36.838 T:20043    info <general>: [weather.openmeteo]: Finished (5.556 sec)
Reply
#95
(2024-11-01, 11:18)ksooo Wrote: Log

Hmm, the log after the device wakes up looks actually pretty normal to me.
No data, parsing or any other obvious errors but you are saying that the hourly forecast is now stuck on the time the device went to sleep? No more weather GUI updates until you restart KODI?

I couldn't replicate this issue myself, so I have to rely on your log :
You might actually need to enable debug & verbose in the addon settings for this one and then let the device go to sleep, after ~2 hours wake it up again and PM me the full log (from the timestamp your device woke up). Note: This logfile is going to be huge because it will print out every single windows property that is being set by the addon.

Thanks!
Skin: Night | Weather: weather.openmeteo | Metadata / News (soon): plugin.universal.data | All-in-one KODI client & Night v3 (soon): OpenHT
Reply
#96
Could it be that it only happens if the day changes between sleep and wakeup?
Reply
#97
(2024-11-01, 15:03)ksooo Wrote: Could it be that it only happens if the day changes between sleep and wakeup?
It could be but in the addon I'm comparing date & hour strings, so unless your android system isn't returning a wrong now/current time & date after your system wakes up, I don't see how day changes could cause this issue.
This is something I'm going to see and check for if I have the logs.
Skin: Night | Weather: weather.openmeteo | Metadata / News (soon): plugin.universal.data | All-in-one KODI client & Night v3 (soon): OpenHT
Reply
#98
I've now successfully emulated your condition by disabling network connectivity and then steadily increasing the system time by 1 hour and check for the addons behavior. This issue is caused because the addon is running normally but the weather data to match the current time is getting "out of bounds" after about 30+ hours because the addon couldn't download the current weather data in that "sleep" state.

Note: If you are in this state it should still fix itself but worst case would be to wait 1 hour until the next weather download would be triggered

I'm going to switch and increase that check to process all available weather data which means that this situation should only happen if your android device would be sleeping for more than 7 days, at which point there is no more weather data available until we download current data.
Skin: Night | Weather: weather.openmeteo | Metadata / News (soon): plugin.universal.data | All-in-one KODI client & Night v3 (soon): OpenHT
Reply
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7(current)

Logout Mark Read Team Forum Stats Members Help
Open-Meteo Weather0