diff --git a/src/abfall.cpp b/src/abfall.cpp index 2b3d818..a3c189b 100644 --- a/src/abfall.cpp +++ b/src/abfall.cpp @@ -10,9 +10,9 @@ #include "pico/stdlib.h" #include "pico/util/datetime.h" -#include "utils.h" -#include "ntp_client.h" #include "http_client.h" +#include "ntp_client.h" +#include "utils.h" #include "ws2812.h" using std::string; @@ -25,11 +25,18 @@ int main() { WS2812 led(WS2812_PIN); - wifi_setup(); + wifi_setup(); NtpClient::setDateTime(); HttpClient client; - std::string csv = client.retrieveWasteDatesAsCsv(); + std::string csv(""); + for (int i = 1; i <= 10; i++) { + printf("Attempt %d for retrieving data.\n", i); + csv = client.retrieveWasteDatesAsCsv(); + if (csv.length() > 0) { + break; + } + } printf("%s\n", csv.c_str()); char datetime_buf[256];