Hi, I'm searching for a basic Arduino code example, but there is nothing yet. very confusing after all these years.....
Here is my code, which does not work...I always get "Fehler beim Abrufen der Daten" means the else path of the HTTP_Code_OK. Can someone please teach me??
Thanks
----------
void loop() {
if(wifiMulti.run() == WL_CONNECTED) {
String url = "https://vrmapi.victronenergy.com/v2/full";
HTTPClient http;
http.addHeader("x-authorization:", "eyJ0eAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjgwY2NhN2VhYjYyNWZlNjVmZmM4YTI1ZTY2OTIxODQ2In0.eyJ1aWQiOiIzNTMyOTgiLCJ0b2tlbl90eXBlIjoiZGVmYXVsdCIsImlzcyI6InZybWFwaS52aWN0cm9uZW5lcmd5LmNvbSIsImF1ZCI6Imh0dHBzOi8vdnJtYXBpLnZpY3Ryb25lbmVyZ3kuY29tLyIsImlhdCI6MTY5MzY1MzkyMCwiZXhwIjoxNjkzNzQwMzIwLCJqdGkiOiI4MGNjYTdlYWI2MjVmZTY1ZmZjOGEyNWU2NjkyMTg0NiJ9.ZSNaayziK_8zlwfGktiHvnNe1WrXSRk3GtvaTvT0x5kqbvXBkHYY6UmuQ6lq6xtz4VIbzl-BEO1bmBf3udMd5km2i-uSXe64KAOoEbXM-fCpmn_B7b64h3AxMH8ApPUm4YUwVeChcaQzfHbMQLrcOtyyn8g4b5eylDLvhLhs8pq3_HnuzS-7aH-SkJttzena1A1NgjJed4An096DoNOzaZF_To7p0F0ocqRCaK9pIllYVOgKovC-rLJvs1j3NX-iIm1tFsQ8CRMxWVm9rZ7RsjOxFwNl2SzR2Imk_5BcceQXVlrLVwvxPVXyIOTPGl-iIbFNlkH5-gUmrfVLVvUQ"); // Ihr Authentifizierungstoken
http.begin(url);
int httpResponseCode = http.GET();
if (httpResponseCode == HTTP_CODE_OK) {
String payload = http.getString();
Serial.println(payload);
} else {
Serial.println("Fehler beim Abrufen der Daten");
}
http.end();
} else {
Serial.println("Verbindung zum WLAN verloren, erneuter Verbindungsversuch...");
}
delay(5000);
}