free file space on esp-32 wroom

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

free file space on esp-32 wroom

Post by devnull » Wed Mar 15, 2017 11:08 am

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 ??

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: free file space on esp-32 wroom

Post by Roberthh » Wed Mar 15, 2017 11:22 am

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.

Post Reply