I started writing the code in Arduino IDE however I decided to switch to MicroPython since I like Python a lot more than C++ and it allows me to implement some more complicated features easier. I finished writing the code for the project (it still has some minor bugs but it's quite stable). The way it works is simple, the ESP32 starts up, measures temperature, humidity, etc., sends it to a Blynk server, and then it goes to deep sleep for a few minutes, and the whole thing repeats. The issue is that the node only works for about 1-2 hours, and after that, it stops working. After connecting it to my PC, I was greeted with a "FAT filesystem appears to be corrupted, ....." message. I did a bit of googling and found out that FAT is not really reliable, and I could try using LittleFS instead. So I did.
This is the code I used to convert the filesystem to LittleFS v2:
Code: Select all
import os
os.umount('/')
os.VfsLfs2.mkfs(bdev)
os.mount(bdev, '/')
Before I continued, I wanted to verify that the filesystem is actually LittleFS and not FAT, however, I could not find out how. Is this even possible? Is it possible to detect the filesystem in MicroPython?
I'm not sure if it actually converted the filesystem correctly because after I let the node run for a while, after about 2 and a half hours, it stopped working, and I got the same ("FAT filesystem appears to be corrupted, .....") message. Does this mean that the filesystem wasn't actually LittleFS? Or what happened.