Kodi Community Forum
Broken OpenWeatherMap Extended - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Weather Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=155)
+---- Thread: Broken OpenWeatherMap Extended (/showthread.php?tid=207110)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42


RE: OpenWeatherMap Extended - bleakassassin - 2015-07-08

(2015-06-15, 07:47)bleakassassin Wrote: I have to say that I'm really happy to see a new weather add-on available! It's looking continuously more promising, too. Thank you for your work on it.

However...

... I have found that this add-on is causing Kodi to take a long time to exit. Regardless of which skin I'm using, having OpenWeatherMap installed causes exit times to at least double, oftentimes triple. I know it's this add-on because my debug log notes for it that the "script didn't stop in 5 seconds - let's kill it". The time between the script being called to stop and it actually stopping exceeds the stopping times for all other add-ons combined.

Any idea why this may be?
I feel like my post got overlooked. I haven't had time to do much more testing until now. Using the most recent version of the add-on from the official repository still causes this immense hang on exit to occur.

I've generated two logs for observation:
  • One log is from a session where nothing else was done besides starting Kodi, waiting for initial load-in to finish, and quitting.
  • The other log was generated similarly. This time, though, I had OWM installed with a location set. I waited for weather information to be loaded. Once it was, I quit.

Hopefully this will be helpful in figuring out this issue. It's a significant nuisance to an otherwise wonderful add-on (which I'm thankful for!).

Log when OWM not installed
Log when OWM installed


RE: OpenWeatherMap Extended - ronie - 2015-07-08

if the addon is currently downloading weather maps, which happens once every 30 mins at most, it can take 10 secs for the script to exit.
since it's simply not possible to interrupt an ongoing download (as far as i know), there's nothing i can do about this.

the best i could do is add an option to disable the download of weather maps, for people who don't care for them anyway.


RE: OpenWeatherMap Extended - bleakassassin - 2015-07-08

(2015-07-08, 19:07)ronie Wrote: if the addon is currently downloading weather maps, which happens once every 30 mins at most, it can take 10 secs for the script to exit.
since it's simply not possible to interrupt an ongoing download (as far as i know), there's nothing i can do about this.

the best i could do is add an option to disable the download of weather maps, for people who don't care for them anyway.
Is that what it is? Huh. Based on my observations, I've actually never gotten maps to show up. I guess they never fully download, which would explain the hang on every exit.


RE: OpenWeatherMap Extended - jp2code - 2015-07-08

I don't know what you are coding in.

Is it possible to use a background worker?

Using a very generic class container like this:
Code:
// class
    public class WeatherInfo
    {
        private string m_apiKey;
        public WeatherInfo(string api_key)
        {
            m_apiKey = api_key;
        }
        public object Data { get; set; }
        public DateTime TimeStamp { get; set; }
        public string Notes { get; set; }
        public void LongProcess()
        {
            try
            {
                // long service call.
            }
            finally
            {
                TimeStamp = DateTime.Now;
            }
        }
    }

You could pass whatever data you need to the worker thread, and then use whatever it returns.

Code:
// example
    public class KodiWeatherApp
    {

        private Label m_weatherInfo;

        public void GetWeatherMap(string apiKey, int millisecondTimeout)
        {
            using (var worker = new BackgroundWorker())
            {
                var mre = new System.Threading.ManualResetEvent(false);
                worker.WorkerReportsProgress = true;
                worker.WorkerSupportsCancellation = true;
                worker.DoWork += delegate(object sender, DoWorkEventArgs e)
                {
                    var weatherData = new WeatherInfo(e.Argument.ToString());
                    weatherData.LongProcess();
                    e.Result = weatherData;
                };
                worker.ProgressChanged += delegate(object sender, ProgressChangedEventArgs e)
                {
                    // unused
                };
                worker.RunWorkerCompleted += delegate(object sender, RunWorkerCompletedEventArgs e)
                {
                    if (e.Error == null)
                    {
                        var weatherData = e.Result as WeatherInfo;
                        m_weatherInfo.Text = weatherData.Notes;
                    }
                    else
                    {
                        // LogError(e.Error);
                        m_weatherInfo.Text = "An error occurred. :(";
                    }
                };
                worker.RunWorkerAsync(apiKey);
                if (worker.IsBusy)
                {
                    while (!mre.WaitOne(millisecondTimeout))
                    {
                        mre.Reset();
                    }
                }
            }
        }
    }

If the form closes, the thread dies.


RE: OpenWeatherMap Extended - nickr - 2015-07-09

Addons are generally written in python.


RE: OpenWeatherMap Extended - Megagolgoth - 2015-07-18

Hi,

OpenWeatherMap Extended seems to make Kodi crash every 30minutes; here the log :

http://paste.leloop.org/?d990fd37be97d211#bTpEh5BpQWYMjHLZ0Urdr4GPwgkB2Laz87wx4isZKuk=

I've tried a manual update and Kodi crash. Replaced it by Yahoo Weather add-on, and i've got no crash... For references, I've made this post : http://forum.kodi.tv/showthread.php?tid=232404&pid=2055553


RE: OpenWeatherMap Extended - ronie - 2015-07-18

(2015-07-18, 10:26)Megagolgoth Wrote: Hi,

OpenWeatherMap Extended seems to make Kodi crash every 30minutes; here the log :

http://paste.leloop.org/?d990fd37be97d211#bTpEh5BpQWYMjHLZ0Urdr4GPwgkB2Laz87wx4isZKuk=

I've tried a manual update and Kodi crash. Replaced it by Yahoo Weather add-on, and i've got no crash... For references, I've made this post : http://forum.kodi.tv/showthread.php?tid=232404&pid=2055553

thanx for the report.
could you please provide a full debug log using these steps:
1 enable debug logging in kodi
2 enable logging in the addon settings
3 restart kodi
4 wait until kodi crashes
5 post the entire xbmc.log file on xbmclogs.com


RE: OpenWeatherMap Extended - Megagolgoth - 2015-07-19

(2015-07-18, 11:33)ronie Wrote:
(2015-07-18, 10:26)Megagolgoth Wrote: Hi,

OpenWeatherMap Extended seems to make Kodi crash every 30minutes; here the log :

http://paste.leloop.org/?d990fd37be97d211#bTpEh5BpQWYMjHLZ0Urdr4GPwgkB2Laz87wx4isZKuk=

I've tried a manual update and Kodi crash. Replaced it by Yahoo Weather add-on, and i've got no crash... For references, I've made this post : http://forum.kodi.tv/showthread.php?tid=232404&pid=2055553

thanx for the report.
could you please provide a full debug log using these steps:
1 enable debug logging in kodi
2 enable logging in the addon settings
3 restart kodi
4 wait until kodi crashes
5 post the entire xbmc.log file on xbmclogs.com

Here we go : http://paste.leloop.org/?2b37733b7614d640#hSI0u1VDefa2gTVnhhcf6P4PxP8CleWuybOWmVs1Doc=

and another fresh one : http://paste.leloop.org/?f6df9fac6fe6554f#/478v6l9saFt89TdupSyeedp94Tv0rPvFXHv0Rx1H2s=


RE: OpenWeatherMap Extended - ronie - 2015-07-19

thanx for trying, but the second one is not a Debug Log :-)
in the first one, your changing loglevels when kodi is running, which makes it less useful for me.

please, if you could, provide another Debug Log using the exact instructions from the post above.
then just let kodi sit idle for 30 mins until it crashes.


RE: OpenWeatherMap Extended - Megagolgoth - 2015-07-20

(2015-07-19, 13:56)ronie Wrote: thanx for trying, but the second one is not a Debug Log :-)
in the first one, your changing loglevels when kodi is running, which makes it less useful for me.

please, if you could, provide another Debug Log using the exact instructions from the post above.
then just let kodi sit idle for 30 mins until it crashes.

It doesn't want crash!


No weather images in OpenWeatherMap Extended - un1versal - 2015-07-23

V16alpha after the rename of the weather resource images icon I no longer have images in openweathermap.extended.

I compile kodi from source every other day.

Ive tried uninstalling the addon and reinstalling, tried removing texture13.db, renaming userdata (basically fresh install)
Ive removed old resource images addon after https://github.com/xbmc/xbmc/pull/7535
Ive removed the weather.zip from /media folder in system

What I get.

Image
Image
Image
Image

Logs show the resource addon being loaded, if I install yahoo weather it works there but no matter what I do openweathermap.extended will not load the images on the hourly, 36hourly etc views.
Debug logs shows nothing odd going on but here it is.

http://pastebin.com/raw.php?i=1NyDC2EA

Any suggestions where to look?


RE: OpenWeatherMap Extended - ronie - 2015-07-23

the whole image resource thing is still work in progress.
there's a couple of things we're working on atm.

over the past week i've been creating lots of resource addon,
including 9 different weather icon packs.

also, i've been writing a script to allow users to select a custom weather icon pack
instead of the default one shipped with kodi.

last night, i've created the addon repo for Jarvis,
so i can now start publishing all of this work.

we still need to hook up the new addon repo to Kodi though.
once that has been taking care of, i can push a fix for openweather.


RE: OpenWeatherMap Extended - un1versal - 2015-07-23

This I cant understand as a acceptable answer. Will be looking forward to see this work as well.

Offtopic: Would be extra nice to see skin theme addons that work for default skin also


RE: OpenWeatherMap Extended - un1versal - 2015-07-24

Version 3.0.0 all working again.

Good work on the resource addons.


RE: OpenWeatherMap Extended - shuvro - 2015-07-24

Hi! @ ronie

I put the location 10001 (New York City ) nothing coming. What i have to do for setting ??
Need help Thanks.