Net.WebService GetData() problem after Raspberry Pi update

Started by soxfan1966, May 30, 2020, 07:35:58 AM

Previous topic - Next topic

soxfan1966

Good morning,

As I periodically do, I checked for updates for my Raspberry Pi this morning.  Seeing these seemed to be an update (see here:  https://www.raspberrypi.org/downloads/) I went thru the process of using Putty to connect to my Pi and then go thru the update.

Everything appeared to work fine, and it boots and HG Loads.

However, I am getting an error with the Weather Widget now - its reported that it cannot find "sys" in a string - but after some troubleshooting, appears that this command in the Weather program (both the "standard" and my updated version):

var weatherData = Net.WebService(webserviceurl_conditions).GetData();

is no longer returning any data, so when the rest of the program tries to parse the results it ends up with the missing sys error.

If you add this line:
Program.Notify("weatherData = " + weatherData);

to the weather program right after the line above, and then under Maintenence options turn on Event History you can see that weatherData is nil - it should be a list of data returned from the OpenWeatherMap API call.

I'm not sure if perhaps the Net.WebService on the pi was not started / enabled after the update, or if something in the update changed / broke how that is supposed to work.  But I'm hoping someone here may have an answer (or even a suggestion).

Thanks :)

petera

Have you tried restarting OW. Have you tried recompiling the OW Program, saving it, disabling and re enabling it. I have seen this problem before usually when the OW server was playing up and the call was returning a null value. As it’s a HG specific issue and not an X10 one you’re probably best reporting it over on HomeGenie.Club.

soxfan1966

Yes, tried restarting the program and also recompiling.  Also did a restart of the pi.  None of that fixed the problem.

soxfan1966

I posted the same question / problem over on the HG Club site too.

petera

Quote from: soxfan1966 on May 30, 2020, 08:47:38 AM
I posted the same question / problem over on the HG Club site too.

Have you tried to make any of those calls manually via a browser bar. I don’t use the OW program program in HG but I’ll enable it and have a look. What version of Mono are you using. Is it definitely the Stable Release. Are you running upgrade or dist-upgrade when updating your system.

soxfan1966

Yes, I made the same API calls via the browser and they work fine.  The weather program was also getting results before I updated the OS.  I'm wondering if a service didn't start.

petera

Quote from: soxfan1966 on May 30, 2020, 09:41:30 AM
Yes, I made the same API calls via the browser and they work fine.  The weather program was also getting results before I updated the OS.  I'm wondering if a service didn't start.

Ok I'm getting the same error. I reckon there's a problem at the OW server end. If calls are working via a browser bar the only logical explanation would be an issue validating the key via HG. Changes in security certs can sometimes throw an error like this, but I haven't updated in a while so updating is unlikely to be the source of your problem. I'd give it a while before carrying out any major surgery on your system. Bear in mind you're modifying that program quite a bit too.

soxfan1966

Ok, thanks for checking - I was getting the same error on the standard OW program too (I thought it was something I did at first).   I'm out for the day now so will check it later.

Tuicemen

I'm at my off grid place and a bit behind with my updates. You may wish to check the jkutils open weather map program just to see if it distributes the same behavior.
Please Read Topic:
General Forum Etiquette
Before you post!

petera

Quote from: Tuicemen on May 30, 2020, 01:29:54 PM
I'm at my off grid place and a bit behind with my updates. You may wish to check the jkutils open weather map program just to see if it distributes the same behavior.

Is your OW program throwing the same error. The problem isn’t updating as I haven’t done a system update in quite a while. Try restarting your OW program to see if it is fetching current forecasts. OW have made changes recently to their api which clearly won’t get picked up unless the author or someone else edits the OW program in HG to reflect this. From what I can gather the last valid call HG made to OW was at 06.30 your time this morning.

Tuicemen

Just logged on to my HG and your correct last update time for OW was 6:41 am today.   :-[
I should have paid more close attention when I pulled it up last.   :-[
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

I can make the same API calls for conditions and forecasts from a browser with no errors and data returned.

If the api changes you refer to at for one all, that also works (I'm using that in addition to the other calls for historical rain data).

The issue seems to be the API calls from within HG using the Net.WebService calls - there is no error in the program when you compile but when it runs you get the missing sys reported because there is no weather data to parse.

I tried again while ago and same error happened.  But it appears others, who did not update their OS are getting the same error so it does not appear related to that.


Quote from: petera on May 30, 2020, 04:09:48 PM
Quote from: Tuicemen on May 30, 2020, 01:29:54 PM
I'm at my off grid place and a bit behind with my updates. You may wish to check the jkutils open weather map program just to see if it distributes the same behavior.

Is your OW program throwing the same error. The problem isn’t updating as I haven’t done a system update in quite a while. Try restarting your OW program to see if it is fetching current forecasts. OW have made changes recently to their api which clearly won’t get picked up unless the author or someone else edits the OW program in HG to reflect this. From what I can gather the last valid call HG made to OW was at 06.30 your time this morning.

petera

Quote from: soxfan1966 on May 30, 2020, 05:39:39 PM
I can make the same API calls for conditions and forecasts from a browser with no errors and data returned.

If the api changes you refer to at for one all, that also works (I'm using that in addition to the other calls for historical rain data).

The issue seems to be the API calls from within HG using the Net.WebService calls - there is no error in the program when you compile but when it runs you get the missing sys reported because there is no weather data to parse.

I tried again while ago and same error happened.  But it appears others, who did not update their OS are getting the same error so it does not appear related to that.


Quote from: petera on May 30, 2020, 04:09:48 PM
Quote from: Tuicemen on May 30, 2020, 01:29:54 PM
I'm at my off grid place and a bit behind with my updates. You may wish to check the jkutils open weather map program just to see if it distributes the same behavior.

Is your OW program throwing the same error. The problem isn’t updating as I haven’t done a system update in quite a while. Try restarting your OW program to see if it is fetching current forecasts. OW have made changes recently to their api which clearly won’t get picked up unless the author or someone else edits the OW program in HG to reflect this. From what I can gather the last valid call HG made to OW was at 06.30 your time this morning.

There's been no changes to HG (obviously). I've not updated HG recently but from what I've been able to determine from other users is that OW stopped fetching weather forecast updates via HG earlier today. The only logical explanation is that there's been some form change in how OW is handling 3rd party service calls to their server. Yes you're API key is working fine from your browser but if their server is not validating the HG app this may be the issue. Best at this stage if you post this problem over at Genes GitHub and see if he responds to it. That's a problem you'll encounter when an app like HG is not regularly maintained.


Tuicemen

Since I currently only have access via my phone it is difficult to  do much digging. However I was able to load the jkutils open weather version and it works so it would be worth looking into its code for comparisons.
Please Read Topic:
General Forum Etiquette
Before you post!

SMF spam blocked by CleanTalk