Make some attempts to get data.
This commit is contained in:
parent
8911dcbe35
commit
10eff684df
1 changed files with 11 additions and 4 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue