Make some attempts to get data.

This commit is contained in:
Martin Brodbeck 2023-01-02 15:17:33 +01:00
parent 8911dcbe35
commit 10eff684df

View file

@ -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];