And it returns data. It is the HTTPS connection over port 443
Now I have Arduino Uno R4WIFI and I use WiFiS3.h library, I wrote this code
#include <WiFiS3.h>
char ssid[] = "xxxx"; // your network SSID (name)
char pass[] = "xxxx"; // your network password
char server[] = "www.alphavantage.co"; // Alpha Vantage API server
char apiKey[] = "xxxxxxx"; // your Alpha Vantage API key
char symbol[] = "IBM"; // Apple stock symbol
WiFiClient client;
void setup() {
// initialize serial communication
Serial.begin(9600);
Serial.println("Connecting to WiFi...");
while (WiFi.begin(ssid, pass) != WL_CONNECTED) {
Serial.print(".");
delay(1000);
}
Serial.println("Connected to WiFi");
}
void loop() {
if (client.connect(server, 443)) {
Serial.println("Connected to server");
// make a HTTP GET request to Alpha Vantage API
client.print("GET /query?function=TIME_SERIES_DAILY&symbol=");
client.print(symbol);
client.print("&apikey=");
client.print(apiKey);
// wait for response
while (client.available()) {
char c = client.read();
Serial.print(c);
}
// close connection
client.stop();
} else {
// if connection failed
Serial.println("Connection failed");
// Attempt to reconnect to WiFi
reconnectWiFi();
}
// wait before making next request
delay(60000); // wait 1 minute before making next request
}
void reconnectWiFi() {
Serial.println("Attempting to reconnect to WiFi...");
WiFi.disconnect();
delay(1000);
while (WiFi.begin(ssid, pass) != WL_CONNECTED) {
Serial.print(".");
delay(1000);
}
Serial.println("Reconnected to WiFi");
This does not work. I am afraid the connect is not the right methos and connectSSL does not seem to exist for this library. Anybody has a clue how this can be fixed
I've been looking at this too..
I'm finding the documentation lacking..
Usually with SSL you have certs to deal with or you go inSecure and except anything..
There's 2 links at the top of the demo, one of them is talking about certs that seem to be preloaded..
curious though..
can you elaborate some on this??
does it connect to the server??
i whois'd your link, it's not a godaddy, you may need to get a cert..
or maybe there is a way to except any cert thrown at you but I don't see this..
Looking at the source I do see..
void setCACert(const char* root_ca);
curious, does the example work??
it just connects to google, which I see thay have a cert for..