Closed Rylfas closed 2 months ago
Same error here
Rylfas schreef op 2024-06-19 12:41:
Installed the KNMI weather plugin for the first time in Domoticz 2024.4
After installation: git clone https://github.com/bramvreugd/Domoticz-KNMI-Weather-Plugin.git and a Domoticz restart. The creation in the Hardware section: This error is occurs and is persistent.
2024-06-19 12:24:23.195 Amsterdam: onstart 2024-06-19 12:24:23.195 Amsterdam: mode 6:0 2024-06-19 12:24:23.195 Amsterdam: Name=HTTP Test, Transport=TCP/IP, Protocol=HTTP, Address=Amsterdam 2024-06-19 12:24:23.195 Amsterdam: Sending connect 2024-06-19 12:24:23.196 Amsterdam: Sended connect 2024-06-19 12:24:23.005 Status: Amsterdam: Entering work loop. 2024-06-19 12:24:23.005 Status: Amsterdam: Started. 2024-06-19 12:24:23.194 Status: Amsterdam: Initialized version 1.3.0, author 'Bramv' 2024-06-19 12:25:28.322 Amsterdam: onDisconnect called for connection to: weerlive.nl:80 2024-06-19 12:30:23.196 Error: Amsterdam: KNMI returned a status: 301 2024-06-19 12:31:28.168 Amsterdam: onDisconnect called for connection to: weerlive.nl:80
The API key is valid (tested). Second time installation as described in previous Issue was not successful. Python is version 3.9.2
Any ideas?
-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Links:
[1] https://github.com/bramvreugd/Domoticz-KNMI-Weather-Plugin/issues/4 [2] https://github.com/notifications/unsubscribe-auth/AEAV657IPDBBLT5A3TMGF2TZIFN7PAVCNFSM6AAAAABJRZLD36VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DEMBRG4YDOMI
Hi Rylfas and Edwin,
Thanks for reporting. It stopped working on the 14th at my installation but after i restarted the plugin it worked again. Can you test the plugin again after disabeling and re-enabeling it again.
Can you also test the url directly in your browser http://weerlive.nl/api/weerlive_api_v2.php?key=your_key&locatie=Hoek%20van%20Holland
Replace your_key with your api key
kind regards, Bram
Hello Bram,
Problem remains after restart of the plugin.
The URL with my API key works without problems.
KInd regards,
Frank
Hello Bram,
Problem remains after restart of the plugin. RPI reboot did not solve it either
Version: 2024.4 Build Hash: 731719420 Compile Date: 2024-01-30 09:16:34 dzVents Version: 3.1.8 Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]
The URL with my API key works without problems.
KInd regards,
Edwin
Hello Bram,
This is in my log when I have Debug on ALL Replaced my ket with @@@@ Hope this is helpfull
2024-06-24 23:01:20.090 KNMI: Received 494 bytes of data 2024-06-24 23:01:20.091 KNMI: 48 54 54 50 2f 31 2e 31 20 33 30 31 20 4d 6f 76 65 64 20 50 HTTP/1.1.301.Moved.P 2024-06-24 23:01:20.091 KNMI: 65 72 6d 61 6e 65 6e 74 6c 79 0d 0a 53 65 72 76 65 72 3a 20 ermanently..Server:. 2024-06-24 23:01:20.091 KNMI: 6e 67 69 6e 78 2f 31 2e 32 30 2e 31 0d 0a 44 61 74 65 3a 20 nginx/1.20.1..Date:. 2024-06-24 23:01:20.091 KNMI: 4d 6f 6e 2c 20 32 34 20 4a 75 6e 20 32 30 32 34 20 32 31 3a Mon,.24.Jun.2024.21: 2024-06-24 23:01:20.091 KNMI: 30 31 3a 32 30 20 47 4d 54 0d 0a 43 6f 6e 74 65 6e 74 2d 54 01:20.GMT..Content-T 2024-06-24 23:01:20.091 KNMI: 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 0d 0a 43 6f 6e 74 ype:.text/html..Cont 2024-06-24 23:01:20.091 KNMI: 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 31 36 39 0d 0a 43 6f 6e ent-Length:.169..Con 2024-06-24 23:01:20.091 KNMI: 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d nection:.keep-alive. 2024-06-24 23:01:20.091 KNMI: 0a 4c 6f 63 61 74 69 6f 6e 3a 20 68 74 74 70 73 3a 2f 2f 77 .Location:.https://w 2024-06-24 23:01:20.091 KNMI: 65 65 72 6c 69 76 65 2e 6e 6c 2f 61 70 69 2f 77 65 65 72 6c eerlive.nl/api/weerl 2024-06-24 23:01:20.091 KNMI: 69 76 65 5f 61 70 69 5f 76 32 2e 70 68 70 3f 6b 65 79 3d 64 ive_api_v2.php?key=@ 2024-06-24 23:01:20.091 KNMI: 66 33 63 36 30 38 33 66 34 26 6c 6f 63 61 74 69 65 3d 35 32 @@@@@@@@@&locatie=52 2024-06-24 23:01:20.091 KNMI: 2e 33 38 37 32 33 25 32 43 35 2e 32 38 32 38 39 0d 0a 45 78 .38723%2C5.28289..Ex 2024-06-24 23:01:20.091 KNMI: 70 69 72 65 73 3a 20 54 68 75 2c 20 30 31 20 4a 61 6e 20 31 pires:.Thu,.01.Jan.1 2024-06-24 23:01:20.091 KNMI: 39 37 30 20 30 30 3a 30 30 3a 30 31 20 47 4d 54 0d 0a 43 61 970.00:00:01.GMT..Ca 2024-06-24 23:01:20.091 KNMI: 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6e 6f 2d 63 61 63 68 che-Control:.no-cach 2024-06-24 23:01:20.091 KNMI: 65 0d 0a 0d 0a 3c 68 74 6d 6c 3e 0d 0a 3c 68 65 61 64 3e 3c e......
< 2024-06-24 23:01:20.091 KNMI: 74 69 74 6c 65 3e 33 30 31 20 4d 6f 76 65 64 20 50 65 72 6d title>301.Moved.Perm 2024-06-24 23:01:20.091 KNMI: 61 6e 65 6e 74 6c 79 3c 2f 74 69 74 6c 65 3e 3c 2f 68 65 61 anently</hea 2024-06-24 23:01:20.091 KNMI: 64 3e 0d 0a 3c 62 6f 64 79 3e 0d 0a 3c 63 65 6e 74 65 72 3e d>....The issue is that weerlive.nl is redirecting http to https. I fixed this by replacing everything "HTTP" with "HTTPS" (not sure if the hardcoded 'Protocol="HTTP"' bits is a conscious choice, or it should be using the self.sProtocol variable), and replacing sPort="80" with "443"
Thank you for fixing ir. I was unable to fix it for the next week because I have no access to the system.
Op wo 26 jun. 2024 22:38 schreef Marcel Paans @.***>:
The issue is that weerlive.nl is redirecting http to https. I fixed this by replacing everything "HTTP" with "HTTPS" (not sure if the hardcoded 'Protocol="HTTP"' bits is a conscious choice, or it should be using the self.sProtocol variable), and replacing sPort="80" with "443"
— Reply to this email directly, view it on GitHub https://github.com/bramvreugd/Domoticz-KNMI-Weather-Plugin/issues/4#issuecomment-2192588740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAV655HLEC2GLDX4ZD4VC3ZJMRERAVCNFSM6AAAAABJRZLD36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGU4DQNZUGA . You are receiving this because you commented.Message ID: @.***>
Got a different issue now since last night, coincidentally when my internet connection went down for a while, so maybe this doesn't affect other people. Anyway, when I restart Domoticz it show this in the logs:
Error: KNMI weather: Connection Exception: 'resolve: Host not found (non-authoritative), try again later [asio.netdb:2]' connecting to 'weerlive.nl:443'
And then when it tries to connect every 10 mins or so, it times out (not surprising if it can't find the host)..
KNMI weather: Failed to connect (110) to: **********:********* with error: Connection timed out
I tried deleting the pycache/plugin.cpython-37.pyc file and rebooting my PI, but that didn't do anything.
Oddly enough, when using curl on my Domoticz PI host to retrieve the data from the API it has no issues. I'm not familiar with Python, but I googled "[asio.netdb:2]" and seems to indicate a deeper issue.
Edit:
Correction, after the reboot, it keeps giving the first error message every 10mins:
Error: KNMI weather: Connection Exception: 'resolve: Host not found (non-authoritative), try again later [asio.netdb:2]' connecting to 'weerlive.nl:443'
Edit 2:
Tried out host weerlive.nl
on a whim and it also failed with a timeout. Apparently the /etc/resolv.conf on my PI was a symlink to /run/systemd/resolve/resolv.conf that didn't exist anymore. Not quite sure how or why that happened, but I removed the symlink and put a file there with the correct settings. Thought I fixed it as host weerlive.nl
returned with IP addresses. But alas, the plugin is now returning this again:
KNMI weather: Failed to connect (110) to: **********:********* with error: Connection timed out
Edit 3: Problem solved itself. Getting data from weerlive.nl as of 19:00 today. 🤷🏻
The issue is that weerlive.nl is redirecting http to https. I fixed this by replacing everything "HTTP" with "HTTPS" (not sure if the hardcoded 'Protocol="HTTP"' bits is a conscious choice, or it should be using the self.sProtocol variable), and replacing sPort="80" with "443"
This solved my problem.
Thanks to both of you
Can someone post the plugin.py the have working right now, please?
Do not know exactly if all http mentions need to be changed to https
Can someone post the plugin.py the have working right now, please?
Do not know exactly if all http mentions need to be changed to https
You have to rename the plugin back to plugin.py to use it or use it as a reference.
great thx
It's a kind of Lourdes experience indeed. This HTTPS/443 solution worked for me too.
Thanks.
Installed the KNMI weather plugin for the first time in Domoticz 2024.4
After installation: git clone https://github.com/bramvreugd/Domoticz-KNMI-Weather-Plugin.git and a Domoticz restart. The creation in the Hardware section: This error is occurs and is persistent.
2024-06-19 12:24:23.195 Amsterdam: onstart 2024-06-19 12:24:23.195 Amsterdam: mode 6:0 2024-06-19 12:24:23.195 Amsterdam: Name=HTTP Test, Transport=TCP/IP, Protocol=HTTP, Address=Amsterdam 2024-06-19 12:24:23.195 Amsterdam: Sending connect 2024-06-19 12:24:23.196 Amsterdam: Sended connect 2024-06-19 12:24:23.005 Status: Amsterdam: Entering work loop. 2024-06-19 12:24:23.005 Status: Amsterdam: Started. 2024-06-19 12:24:23.194 Status: Amsterdam: Initialized version 1.3.0, author 'Bramv' 2024-06-19 12:25:28.322 Amsterdam: onDisconnect called for connection to: weerlive.nl:80 2024-06-19 12:30:23.196 Error: Amsterdam: KNMI returned a status: 301 2024-06-19 12:31:28.168 Amsterdam: onDisconnect called for connection to: weerlive.nl:80
The API key is valid (tested). Second time installation as described in previous Issue was not successful. Python is version 3.9.2
Any ideas?