GET data from PVoutput.org with Arduino MKR1010

I am trying to GET the daily peak output from my uploaded data to pvoutput.org. This data upload from the inverter is performed by a Raspi.
Now I want to GET the daily peak energy using a Arduino MKR1010 but my Arduino does/will not connect to the pvoutput.org server.
All I get is a “disconnecting from server” message after about 10sec.
The data does exist as I can get it manually from my browser.
https://pvoutput.org/service/r2/getstatus.jsp?key=myapireadkey&sid=mychID&d=20210530
What is the solution?

My Arduino code is based on

#include <WiFiNINA.h>
#include “secrets.h”
WiFiSSLClient client;

char ssid[] = SECRET_SSID; // your network SSID (name)
char pass[] = SECRET_PASS; // your network password

int status = WL_IDLE_STATUS; // the Wifi radio’s status
char server[] = “pvoutput.org”;

void setup() {
//Initialize serial:
Serial.begin(9600);
//while(!Serial);//may hang if usb unplugged
for (int i = 0; i < 5; i++) {
delay(1000);
}
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
status = WiFi.begin(ssid, pass);
}
if (client.connect(server, 443)) { // port 80 for HTTP, port 443 for HTTPS ?
Serial.println(“connected to server”);

// Make a HTTP request:
client.println("GET /getstatus.jsp?key=myapireadkey&sid=mychID&d=20210530 HTTP/1.1");
client.println("Host: pvoutput.org/service/r2");
client.println("Connection: close");
client.println();

}

// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.write©;
}

// if the server’s disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println(“disconnecting from server.”);
client.stop();

// do nothing forevermore:
while (true);

}
Serial.println(“end Setup”);
}

void loop() {

}

This issue now fixed. The MKR1010 requires the SSL certificate for pvoutput.org:443 installed using the Arduino IDE Firmware Updater Tool.

Hi mackpvoutput, i bought an MKR1010 and i tried to use your script inserting my apikey and system ID.
I tried several times but i always get no response and serial monitor is empty.

Already checked/tried:

  • SSL certificate
  • PVoutput API settings
  • Tried using APIkey and read only key
  • Other sample script making HTTP requests to Google (working)
  • Updating installed libraries
  • Script from my browser (working)

Here you can see serial monitor outputs:

19:04:08.086 → Attempting to connect to SSID: Alice-73412369
19:04:28.036 → Connected to wifi
19:04:28.036 → SSID: Alice-73412369
19:04:28.036 → IP Address: 192.168.1.7
19:04:28.036 → signal strength (RSSI):-54 dBm
19:04:28.036 →
19:04:28.036 → Starting connection to server…
19:04:30.146 → connected to server
19:04:30.146 → 1
19:04:30.521 →
19:04:30.521 → disconnecting from server.

What’s wrong with my configuration?

Thanks