Page 1 of 1

free file space on esp-32 wroom

Posted: Wed Mar 15, 2017 11:08 am
by devnull
I thought that I had this cracked, based on the calcs in this thread: viewtopic.php?t=2778

But the value of 0.046875 MB free space just can't be correct ??

Code: Select all

def dfree():
	bits = statvfs('/flash')
	print(bits)
	blksize = bits[0] # 4096
	blkfree = bits[3] # 12
	freesize = blksize * blkfree # 49152
	mbcalc = 1024*1024 # 1048576 
	mbfree = freesize / mbcalc # 0.046875
	print(mbfree)


>>> dfree()
(4096, 4096, 58, 12, 12, 0, 0, 0, 0, 255)
0.046875

What am I doing wrong ??

Re: free file space on esp-32 wroom

Posted: Wed Mar 15, 2017 11:22 am
by Roberthh
The calculation looks consistent. 12 Blocks of 4 kBytes each are 48 kbytes ~ 0.04688 MBytes. The actual esp32 port has a flash filesystem size of 256 kBytes (64 blocks). You can increase that in micropython-esp32/esp32/modules/flashbdev.py
, last line.