#include <ArduinoJson.h>
#include <LittleFS.h>
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
printf("ESP32 Partition table:\n\n");
printf("| Type | Sub | Offset | Size | Label |\n");
printf("| ---- | --- | -------- | -------- | ---------------- |\n");
esp_partition_iterator_t pi = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
if (pi != NULL) {
do {
const esp_partition_t* p = esp_partition_get(pi);
printf("| %02x | %02x | 0x%06X | 0x%06X | %-16s |\r\n",
p->type, p->subtype, p->address, p->size, p->label);
} while (pi = (esp_partition_next(pi)));
}
if (!LittleFS.begin()) {
Serial.println("LittleFS Mount Failed!");
} else {
Serial.println("LittleFS Mounted");
}
// open the file for reading
File file = LittleFS.open("/data.json", "r");
if (!file) {
Serial.println("Failed to open file for reading");
return;
}
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}