I am writing an Internet radio program for the ESP32 and I ran into an interesting issue. My code (contained in the attached zip file) goes out to nl1.api.radio-browser.info to get a list of Internet radio stations of a specified genre and gets back a Json doc which I am trying to parse. I am trying to use this streaming parser because the data returned is to big for ArduinoJson to handle.
The problem I am seeing is related somehow to Cyrillic characters that are returned in the data stream but I cannot say how. If you examine my code in the zip file, which is a complete Arduino program which can be run by a ESP32, you will see a file called AJsonListener.h. Check out line 44 which is shown below:
Serial.printf("\nCurrent Key: %s\n", currentKey);
With this line in place, my code successfully parses all 30 records (as shown in the Serial Monitor) in the returned Json doc. Comment this line out and the code stops after 5 entries are processed. So the absences or presences of this print statement determines if the program runs successfully or not. Very strange.
If anyone can find the cause of this I would appreciate. Also, if I am doing something stupid in this code, let me know.
StreamJson_Test.zip
I am writing an Internet radio program for the ESP32 and I ran into an interesting issue. My code (contained in the attached zip file) goes out to nl1.api.radio-browser.info to get a list of Internet radio stations of a specified genre and gets back a Json doc which I am trying to parse. I am trying to use this streaming parser because the data returned is to big for ArduinoJson to handle.
The problem I am seeing is related somehow to Cyrillic characters that are returned in the data stream but I cannot say how. If you examine my code in the zip file, which is a complete Arduino program which can be run by a ESP32, you will see a file called AJsonListener.h. Check out line 44 which is shown below:
Serial.printf("\nCurrent Key: %s\n", currentKey);
With this line in place, my code successfully parses all 30 records (as shown in the Serial Monitor) in the returned Json doc. Comment this line out and the code stops after 5 entries are processed. So the absences or presences of this print statement determines if the program runs successfully or not. Very strange.
If anyone can find the cause of this I would appreciate. Also, if I am doing something stupid in this code, let me know.