openURL timeout  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

openURL timeout

Post 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
Debian buster on NUC and three RPi with buster.
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: openURL timeout

Post by waltervl »

Do you do that test on the same system?
Is there a limit of calls on wunderground?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post 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?
Debian buster on NUC and three RPi with buster.
Lokonli
Posts: 2292
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: openURL timeout

Post by Lokonli »

Are you maybe using IPv6? That might give issues with curl.

Verstuurd vanaf mijn AC2003 met Tapatalk

Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post by Number8 »

No IPv4
Debian buster on NUC and three RPi with buster.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: openURL timeout

Post 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. ;)
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post 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 :(
Debian buster on NUC and three RPi with buster.
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: openURL timeout

Post by waltervl »

A little google brought me here https://serverfault.com/questions/85864 ... n-centos-7

Could give it a try.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post by Number8 »

Could it be a DNS lookup issue with curl?
Debian buster on NUC and three RPi with buster.
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: openURL timeout  [Solved]

Post by waltervl »

Try the the test options as mentioned here https://aarvik.dk/disable-ipv6/
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post by Number8 »

I did it right away. I get quick response time in both cases
Debian buster on NUC and three RPi with buster.
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Re: openURL timeout

Post 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.
Debian buster on NUC and three RPi with buster.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest