Please login or register.

Login with username, password and session length
Pages: 1 2 3 [4]

Author Topic: Net.WebService GetData() problem after Raspberry Pi update  (Read 14991 times)

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #45 on: May 31, 2020, 06:59:44 PM »

You were looking for JKUtils which I assume Tuicemen obtained from the old board. Also check the Package Manager in Settings for Earth Tools and Solar Altitude. More useful utilities http://old.homegenie.club:8080/www.homegenie.it/forum/index945d.html?topic=1132.0
Logged

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #46 on: June 01, 2020, 08:07:38 AM »

I downloaded the Jk Utils OpenWeatherData Program (not to be confused with the standard OpenWeatherMap program now in HG).

Looks like the code is doing the same thins, in calling Net.WebService(webserviceurl).GetData();

but in the JK Utils version, that call is within a function called _checkWeather and has a Program.RunAsyncTask(()=> definition to it (I'm not sure what that actually means). 

That function is called at the end of the program in this code:
When.WebServiceCallReceived(Program.Module.Domain {...}

and again in this code:
while (Program.IsEnabled) ...

In the OpenWeatherMap program (the one that stopped working because of the certificate issue on Saturday), the call to:
var weatherData = Net.WebService(webserviceurl_conditions).GetData();

is just done within the while (Program.IsEnabled) {...} loop.

Not sure why the JK Utils version did not run into the certificate issue - but I am going to keep it installed (just inactive) in case I need a backup weather program again.

I also have the JK Utils Solar Altitude program already and run / use that one.

Thanks



Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #47 on: June 01, 2020, 08:43:59 AM »

@soxfan1966, once I get back to coding ( in the fall) I plan to dig into this a bit more. Just to difficult (for me) to code from a phone. I had always ran two weather pulls up till HG switched from WU to OW.   The HG OW program may be able to be edited with a try/catch and if the SSL pull fails use the jkutils pull or a pull from another source. My preference would be another source as the free sources tend to change things without warning.
Although petera's workarround does work for you disabling security certificates for any length of time is not a good idea in todays world.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #48 on: June 01, 2020, 09:20:22 AM »

The difference in the HG included OW pull and the jkutil OW pull is the actual call HG uses https jkutils uses http. So to get arround the security certificate issue with out disabling it in HG change the call to a http address.
I just tested this as it was simple to do from my phone and I now have the HG included OW working. :)%
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #49 on: June 01, 2020, 09:22:40 AM »

So thats in the variable definition of the url then ?
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #50 on: June 01, 2020, 09:27:42 AM »

@soxfan1966, once I get back to coding ( in the fall) I plan to dig into this a bit more. Just to difficult (for me) to code from a phone. I had always ran two weather pulls up till HG switched from WU to OW.   The HG OW program may be able to be edited with a try/catch and if the SSL pull fails use the jkutils pull or a pull from another source. My preference would be another source as the free sources tend to change things without warning.
Although petera's workarround does work for you disabling security certificates for any length of time is not a good idea in todays world.

What exactly do you code. I’m a little confused here. The OW program has experienced expired security certs as did a number of other major applications this weekend and until the matter is resolved I’ve simply bypassed the need to do a key and cypher handshake between HG and OW.

Clearly the JK Utils Program is not very secure if it didn’t go through a similar experience so I wouldn’t recommend anyone use this if we are talking security matters .In fact as I type here I cannot establish a secure connection to this forum so maybe that’s something you should investigate too.

In the meantime instead of scratching my ass and sending emails to people I’ve got @soxfan1966 back on the road. I don’t use weather in HG but saw a user who had put a lot of effort into developing it for his own needs and it didn’t look like the author was in much of a hurry to provide a solution and I imagine soxfan1966 wanted to get back on track before the Fall.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #51 on: June 01, 2020, 11:14:33 AM »

Just to ally any fears about security or contrary to what may have been intimated, my workaround only relates to the security connection between OW and HG. Every other aspect of HG will function as normal. Dropping the s from the https url effectively opens an unsecured connection anyway.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #52 on: June 01, 2020, 11:43:18 AM »

@petera, what I code is primarily for my own use though I do share some of my creations. Like you and many others, my HG is very customized. I put forth what I planed to do with my version of OW so others could try it if they wished.
Your post suggests that you were the only one that actualy took time to look into this which is totaly false. It also implies I'm belittling your workarround which I'm  not.   The fact is jkutils just doesn't use HG certificates designed for https calls. Part of the requiement for Https sites is all http calls get forwarded to https. If you wish Jkutils to use security certificates you just need to change the pull address.
My workarround suggestion is just another option. Users like soxfan1966 are free to use either, use their own or wait (hopefuly not till fall as you suggest)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #53 on: June 01, 2020, 11:54:45 AM »

OpenWeaterMap support just got back to me about the expired certificate  stating it should be fixed now.
So no need for a workarround now. >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #54 on: June 01, 2020, 01:01:53 PM »

I strongly suggest that anyone using OpenWeather seriously for automation etc takes out a paid subscription. Besides the fact that you have direct access to premium product support, you have additional forecast data that the free subscription doesn’t include and of course you are contributing to a project not owned by one of the big data mining giants. I personally don’t use it but would gladly pay if I did. The “something for nothing” concept that some may find admirable is slowly disappearing, being gobbled up by the “big guys”, Dark Sky weather being the latest acquisition. Pay modestly now or pay big later.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Net.WebService GetData() problem after Raspberry Pi update
« Reply #55 on: June 01, 2020, 01:24:26 PM »

Many of the weather sites rely on user PWS info something they get for nothing.  For users that rely on accurate weather info for their automation they should look into a PWS then forward the info to a weather site. Most times this will give you access to more content not to mention the most up to date and accurate weather info.  I'm not sure what OW supplies to users submiting PWS data as my PWS is no longer operational so I never looked into it.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
Pages: 1 2 3 [4]
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.