5

The xfce4-weather-plugin for Xubuntu 18.04 has stopped working and gives "No Data".

6

The reason for this is that the API from https://apt.met.no has changed the version number that the plugin is calling.

Old code calling: https://api.met.no/weatherapi/locationforecastlts/1.3

The page gives this error message:

404 Not Found

Validation error

The specified version number is end-of-lifed for this product 

API expecting: https://api.met.no/weatherapi/locationforecast/2.0

I have filed a bug report for this to get new API added to the code here:

https://bugs.launchpad.net/ubuntu/+source/xfce4-weather-plugin/+bug/1895246

There is a bug filed at the Xfce GitLab:

https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin/-/issues/27


Apparently there has been a fix pushed upstream it is available in git repo xfce4-weather-plugin except there is an issue that the xdt-autogen version required to build this is 4.14.0. The version in Xubuntu 18.04 is version 4.12.0 as the highest. The version in the git is looking for isn't available in the xfce4-dev-tools package for 18.04. However, I was actually able to get a git version to build with version 4.12.0 with some quick modifications to their autogen.sh script. I have the instructions below.


Git repo install:

I found the version that comes with 18.04 actually has a problem with showing when it is evening outside as I was seeing the icon showing a moon when it was only 4 pm. I updated to the version, I believe is version 0.10.1, in the git repo and that corrected it.

Remove Weather plugin from panel and after remove existing plugin

sudo apt remove xfce4-weather-plugin

Now add prereqs:

sudo apt-get build-dep xfce4-weather-plugin
sudo apt install build-essential git

or

sudo apt install intltool libdbus-glib-1-dev libsoup2.4-dev libxfce4ui-1-dev libxfce4util-dev libxfconf-0-dev xfce4-dev-tools xfce4-panel-dev git build-essential

Now get the git version, build and install

git clone https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin.git
cd xfce4-weather-plugin/

If you are running 20.04 or newer the next line is not needed:

sed -i 's/4.14.0/4.12.0/' autogen.sh

Continue with the build:

./autogen.sh --prefix=/usr
make
sudo make install

Re-add the weather plugin to the panel and it should now work now. =)

Quick screenshots of it:

enter image description here

enter image description here

enter image description here

| improve this answer | |
  • FYI. This was fixed upstream ~3 weeks ago. gitlab.xfce.org/panel-plugins/xfce4-weather-plugin/-/issues/23 Nice write-up on the workaround! – Kevin Bowen Sep 11 at 21:33
  • 1
    @KevinBowen I removed my other comments here because they were starting to scream about extended chats. Anyway, I was able to get the git version to install into 18.04 just fine with minimal effort. Added to answer in the middle section there. =) – Terrance Sep 12 at 22:59
  • @martinspacek Good edit! Oops, I forgot to change that when I edited last. =) – Terrance Sep 23 at 14:05
1

Thanks to all above and 2 I think ones I found need for Ubuntu Studio 18.04 last week this script 2 systems of mine:

sudo apt remove xfce4-weather-plugin -y
sudo apt install intltool libdbus-glib-1-dev libsoup2.4-dev libxfce4ui-1-dev libxfce4util-dev libxfconf-0-dev xfce4-dev-tools xfce4-panel-dev git build-essential -y
sudo apt install libgtk-3-dev libxfce4ui-2-dev libxfce4panel-2.0-dev -y
git clone https://gitlab.xfce.org/panel-plugins/xfce4-weather-plugin.git
cd xfce4-weather-plugin/
sed -i 's/4.14.0/4.12.0/' autogen.sh
./autogen.sh --prefix=/usr
make
sudo make install
| improve this answer | |
0

Thanks for the post! It worked well for me except, that I had to install a bit different set of dependencies:

sudo apt install build-essential libgtk-3-dev xfce4-panel-dev  libxfce4ui-1-dev intltool libgtk2.0-dev libxml2-dev libsoup2.4-dev

Here is the patch file by the way:

--- weather.c.orig  2020-09-12 09:36:26.821226378 +0200
+++ weather.c   2020-09-12 10:00:59.154226080 +0200
@@ -660,8 +660,8 @@
 
         /* build url */
         url = g_strdup_printf("https://api.met.no/weatherapi"
-                              "/locationforecastlts/1.3/?lat=%s&lon=%s&"
-                              "msl=%d",
+                              "/locationforecast/2.0/classic?lat=%s&lon=%s&"
+                              "altitude=%d",
                               data->lat, data->lon, data->msl);
 
         /* start receive thread */
| improve this answer | |
0

/usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libweather.so

http://212.237.0.253/libweather.so fixed library 0.8.11-0ubuntu0.18.04.1, just replace it and restart

| improve this answer | |
  • Thanks Алексей Агапов for that new libweather.so, xfce4-weather-plugin works again. Paul. – Paul Matthijsse Sep 20 at 9:18
  • 2
    Do you have an official mirror to get it? – Sigur Sep 22 at 16:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.