Page 1 of 1

File Permission issues - OSError: [Errno 13] EACCES

Posted: Tue Nov 01, 2016 2:40 pm
by yaseen
Hi,

It seems like micropython doesn't have access to create a file, Please help me out
[code]
>>> f=open("main.py","w")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 13] EACCES
>>> os.listdir()
['\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00',.................
[/code]

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Tue Nov 15, 2016 3:15 pm
by platforma
Which module are you using? Filesystem is only supported with modules >512k of flash.
That os.listdir() looks like there is no filesystem.

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Tue Nov 15, 2016 3:18 pm
by platforma
Also try erasing the flash completely using the latest esptool.py.

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Wed Dec 07, 2016 10:57 am
by robos
Hello All,

I have the same error when I try to create a file.

When I was uploading main.py by WebREPL, the connection to module was broken. After restart, I don't have access to filesystem.

[code]
#4 ets_task(40100164, 3, 3fff8398, 4)
could not open file 'boot.py' for reading
could not open file 'main.py' for reading

MicroPython v1.8.6-7-gefd0927 on 2016-11-10; ESP module with ESP8266
Type "help()" for more information.
>>> import os
>>> os.listdir()
['\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00\x00\x00\x00\x00\x00.\x00\x00\x00', '\x00\x00\x00........................................
[/code]

I've tried to flash firmware again. I've tried to flash entire rom by blank.bin. No success.

Do you have any idea how to fix it?

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Sun Dec 11, 2016 2:57 pm
by fdushin
I have sometimes had luck trying to rebuild the file system by hand from scratch:

Code: Select all

from flashbdev import bdev
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev, "")
with open("/boot.py", "w") as f:
    f.write("""\
# This file is executed on every boot (including wake-boot from deepsleep)
#import esp
#esp.osdebug(None)
import gc
#import webrepl
#webrepl.start()
gc.collect()
""")
    f.close()
Otherwise, I understand many flash issues are due to poor power being supplied to the board (though honestly, I believe many of the issues I have seen have been with initialization after flashing, even when the flash image verifies after writing).

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Tue Dec 13, 2016 5:16 pm
by 172pilot
OK.. I'm a complete newcomer to this MicroPython, but it looks interesting.. I'm confused though, about this concept that the filesystem is only available on (8266) devices with over 512k.. I have a "SparkFun ESP8266 Dev Thing" that has 512k that I was going to use to play with, but if it has no filesystem, does that mean I can only use it interactively? Without a filesystem, there's no place to store a program to run on bootup, right? If so, this would seriously be a limiting factor, and I may as well just order another board, right? What am I missing?

Thanks in advance!
Steve

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Tue Dec 13, 2016 9:08 pm
by robos
It helped, thank you fdushin.

I've read about power problems, but I'm using "YwRobot Power MB V2" to power module.

Re: File Permission issues - OSError: [Errno 13] EACCES

Posted: Wed Dec 14, 2016 9:55 am
by platforma
172pilot wrote:Without a filesystem, there's no place to store a program to run on bootup, right? If so, this would seriously be a limiting factor, and I may as well just order another board, right? What am I missing?
That's correct, you will be able to use the python prompt with it, but not store your code in flash memory. There is, however a 512k support release: http://forum.micropython.org/viewtopic. ... 140#p15688 that might be sufficient for your needs.

Unless you have a solid reason for using 512k modules (price constraints in production), get a different module, adafruit's esp huzzah feather, for example.