Page 1 of 1

openURL timeout

Posted: Sunday 10 October 2021 20:35
by Number8
Hello to all
I have a very strange timeout issue for a long time that I really don't how to sort out.
After 15 sec this url call triggers a timeout reported in the log file

Code: Select all

local wunderURL = "https://api.weather.com/v3/wx/forecast/daily/5day?geocode=47.097,1.966&language=fr-FR&format=json&units=m&apiKey=xxx"
dz.openURL({
   url = wunderURL,
   callback = "wundergroundResponseForecast1"
})
log file excerpt

Code: Select all

2021-10-10 20:25:17.214 Error: Error opening url: https://api.weather.com/v3/wx/forecast/daily/5day?geocode=47.097,1.966&language=fr-FR&format=json&units=m&apiKey=xxx
2021-10-10 20:25:17.291 Error: dzVents: Error: (3.0.14) meteo script: HTTP/1.1 response: 28 ==>> Timeout was reached
If I simply copy/past without waiting the url displayed in the log file in a browser I get an immediate answer
So what could make the API not responding?
Running 2020.2 build 12485 on Debian buster
Thank you

Re: openURL timeout

Posted: Sunday 10 October 2021 21:08
by waltervl
Do you do that test on the same system?
Is there a limit of calls on wunderground?

Re: openURL timeout

Posted: Saturday 16 October 2021 5:30
by Number8
Thanks waltervl. It turns out that a curl on the same machine (NUC Intel i5) takes roughly 10 sec that I guess is the timeout limit. On the same network doing the same request in a PC browser triggers the response almost immediately. Doing the same request on an RPi gear takes 15 sec as well. Size of the response is 6Ko. Network is 1Gb wired.
2 questions then: why such a timing difference? and is there a way to increase timeout limit, at least on a per http call basis?

Re: openURL timeout

Posted: Saturday 16 October 2021 9:09
by Lokonli
Are you maybe using IPv6? That might give issues with curl.

Verstuurd vanaf mijn AC2003 met Tapatalk


Re: openURL timeout

Posted: Saturday 16 October 2021 10:17
by Number8
No IPv4

Re: openURL timeout

Posted: Saturday 16 October 2021 10:22
by EddyG
I have it sometimes too (and for years), sometimes a few times per day and sometimes only a few times per week.
I just ignore it. It might be that at that time the RPi or weather.com are busy. Don't call more often then every 15 minutes.
It does not really matter if a few calls are missed per day, weather does not change that fast. ;)

Re: openURL timeout

Posted: Saturday 16 October 2021 10:25
by Number8
I was not worried until it did not work anymore. So I guess it is a different issue, isn'it? I call it once every hour maximum :(

Re: openURL timeout

Posted: Saturday 16 October 2021 10:28
by waltervl
A little google brought me here https://serverfault.com/questions/85864 ... n-centos-7

Could give it a try.

Re: openURL timeout

Posted: Saturday 16 October 2021 10:28
by Number8
Could it be a DNS lookup issue with curl?

Re: openURL timeout  [Solved]

Posted: Saturday 16 October 2021 10:31
by waltervl
Try the the test options as mentioned here https://aarvik.dk/disable-ipv6/

Re: openURL timeout

Posted: Saturday 16 October 2021 10:36
by Number8
I did it right away. I get quick response time in both cases

Re: openURL timeout

Posted: Saturday 16 October 2021 10:48
by Number8
Anyhow, as advised in https://aarvik.dk/disable-ipv6/ the following line as been appended to /etc/resolv.conf-file

Code: Select all

options single-request-reopen
The response time is now 5 sec, which is still long compared to a browser, but below the 10 sec timeout.
Thank to all you for the help. Was not an obvious problem.