Connecting and reading data from api.open-meteo.com

For general Flowcode discussion that does not belong in the other sections.
Post Reply
simisv
Posts: 25
http://meble-kuchenne.info.pl
Joined: Wed Oct 19, 2022 7:54 am
Has thanked: 5 times
Been thanked: 2 times

Flowcode v10 Connecting and reading data from api.open-meteo.com

Post by simisv »

Hi guys

I'm trying to read weather data from api.open-meteo.com . I know this should work , since I did it using Arduino IDE . When I try using Flowcode v10 and ESP32_wroom32 , can't connect to the server . Tested on local network using "TCP Terminal" as server on my laptop and esp32 it will connect and send the GET request .
Any reason why can't connect to open-meteo ?

Help please
Thank you
Attachments
esp32_api.open_meteo_forum.fcfx.zip
(8.13 KiB) Downloaded 11 times

BenR
Matrix Staff
Posts: 2097
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 556 times
Been thanked: 740 times

Re: Connecting and reading data from api.open-meteo.com

Post by BenR »

Hello,

Your connecting to HTTPS "https://api.open-meteo.com/" on Port 80. I beleive this should maybe be 443.

Or try connecting to the non encrypted HTTP version instead "http://api.open-meteo.com/" on Port 80.

simisv
Posts: 25
Joined: Wed Oct 19, 2022 7:54 am
Has thanked: 5 times
Been thanked: 2 times

Re: Connecting and reading data from api.open-meteo.com

Post by simisv »

Hi Ben
Should be http and port 80 , unfortunately no luck . Don't know what Arduino does different .
This is definitely to much for my brain .
Thanks

chipfryer27
Valued Contributor
Posts: 1829
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 627 times

Re: Connecting and reading data from api.open-meteo.com

Post by chipfryer27 »

Hi

From looking at your chart I assume you have issue when the Network Comms component tries to connect. If that fails it won't matter what your api string consists of.

I might be wrong as it has been a while since I last used, but I'm pretty certain you don't need to include "HTTP://" in NetworkComms address. I can (if I rember correctly) connect with just numerical address 123.456.789.123 or a variable such as "abc.com"

Regards

chipfryer27
Valued Contributor
Posts: 1829
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 404 times
Been thanked: 627 times

Re: Connecting and reading data from api.open-meteo.com

Post by chipfryer27 »

Hi

Further to above you seem to be sending out "debug" info over UART2

After you open a socket you send out "Connecting" then attempt to connect using NetworkComms1.

If you the sent out the value of "socket" over UART2 immediately after, you would get notification of success/failure which may help you debug further.

If you cannot connect it doesn't matter what you send later.

Regards

simisv
Posts: 25
Joined: Wed Oct 19, 2022 7:54 am
Has thanked: 5 times
Been thanked: 2 times

Re: Connecting and reading data from api.open-meteo.com

Post by simisv »

Hi
There is no attempt from esp32 to connect to the server if I use "api.open-meteo.com" . After I used ping command to find out the ip address , witch at this time is "94.130.142.35" , the result is using port 80 and 443 :
"HTTP/1.1 400 Bad Request
Server: nginx"
<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

From what Google is saying , this site accept connections only using his web address api.open-meteo.com .
Maybe is something wrong in the code of the networkcomms esp32 component ?

Need an idea on how to test that .
Need some suggestion's please .

Thank you

Post Reply