OK, so I have made some progress. Now I need to know how to do certain things with Strings: The SoundCloud server gives a fairly long answer that I try store inside a String. After the routine runs a few times, my chip throws an error at me. All I want is the String to be completely new filled with the new information overtime the routine runs...
void loop() {
if (millis() > zeitBeiLetzterApiAbfrage + zeitZwischenApiAbfragen) {
// alten String leermachen:
vonScEmpfangen = String('a');
Serial.println("\nStarting connection to server...");
// if you get a connection, report back via serial:
if (client.connect(server, 443)) {
Serial.println("connected to server");
// Make an HTTP request:
client.println("GET /users/xxx/tracks?client_id=yyy HTTP/1.1");
client.println("Host: api.soundcloud.com");
client.println("Connection: close");
client.println();
}
// if there are incoming bytes available
// from the server, read them and print them:
while (client.connected() || client.available()) {
char c = client.read();
Serial.write(c);
// String mit Antwort von SC füllen:
vonScEmpfangen = String(vonScEmpfangen + String(c));
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting from server.");
client.stop();
}
// irgendwie den String auswerten
//long positionPlaycount = vonScEmpfangen.indexOf('playback_count');
//Serial.println("\nPosition:");
//Serial.println(positionPlaycount);
zeitBeiLetzterApiAbfrage = millis();
}
}
Serial Monitor shows this:
Starting connection to server...
connected to server
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 44552
Connection: close
Date: Wed, 26 Jul 2017 10:30:03 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
Access-Control-Allow-Methods: GET, PUT, POST, DELETE
Cache-Control: private, max-age=0, must-revalidate
Access-Control-Expose-Headers: Date
Server: am/2
X-Cache: Miss from cloudfront
Via: 1.1 67284fcf464f6f1529cc1e521669622c.cloudfront.net (CloudFront)
X-Amz-Cf-Id: tHhxkikoJKpYfxyyBG1FhRhWVcfuK-UNL97qZM_eJnv1x0wb3w7Ojg==
[{"kind":"track","id":333738043,"created_at":"2017/07/18 16:43:35 +0000","user_id":229446377,"duration":5116299,"commentable":true,"state":"finished","original_content_size":82149168,"last_modified":"2017/07/18 23:56:46 +0000","sharing":"public","tag_list":"Podcast Religion esoterik politik gesellschaft atheismus humanismus türkei lehrplan schule evolution kreationismus islam islamisierung reform goehte-moschee seyran-ates Berlin kindesmissbrauch kirche vatikan ehefüralle merkel hass definition","permalink":"fo
...
and so on
...
/05/07 14:31:09 +0000","user_id":229446377,"duration":6380718,"commentable":true,"state":"finished","original_content_size":102379572,"last_modified":"2017/05/07 14:37:07 +0000","shari
Exception (28):
epc1=0x4000bf0e epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: cont
sp: 3fff0aa0 end: 3fff0ce0 offset: 01a0
>>>stack>>>
3fff0c40: 3ffefb38 3ffefc80 3fff0c70 40203854
3fff0c50: 3ffefb38 3ffefc80 3ffefb38 40203896
3fff0c60: 3ffefb38 3ffefc80 3ffefb48 40201f11
3fff0c70: 00000000 00000000 00000000 3fff400c
3fff0c80: 00001bdf 00001bd0 3fff3bdc 0000000f
3fff0c90: 00000001 00ffffff 0100a8c0 40203554
3fff0ca0: 00000069 3ffefb64 3ffefc80 40201dd4
3fff0cb0: 00000000 00000000 00000001 3ffefcac
3fff0cc0: 3fffdad0 00000000 3ffefca4 40203a90
3fff0cd0: feefeffe feefeffe 3ffefcc0 40100718
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset