File Permission issues - OSError: [Errno 13] EACCES

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
yaseen
Posts: 1
Joined: Tue Nov 01, 2016 2:35 pm

File Permission issues - OSError: [Errno 13] EACCES

Post by yaseen » Tue Nov 01, 2016 2:40 pm

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]

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

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

Post by platforma » Tue Nov 15, 2016 3:15 pm

Which module are you using? Filesystem is only supported with modules >512k of flash.
That os.listdir() looks like there is no filesystem.

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

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

Post by platforma » Tue Nov 15, 2016 3:18 pm

Also try erasing the flash completely using the latest esptool.py.

robos
Posts: 2
Joined: Wed Dec 07, 2016 8:58 am

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

Post by robos » Wed Dec 07, 2016 10:57 am

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?

User avatar
fdushin
Posts: 32
Joined: Thu Jul 21, 2016 5:38 pm

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

Post by fdushin » Sun Dec 11, 2016 2:57 pm

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).

172pilot
Posts: 1
Joined: Sun Dec 11, 2016 4:56 pm

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

Post by 172pilot » Tue Dec 13, 2016 5:16 pm

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

robos
Posts: 2
Joined: Wed Dec 07, 2016 8:58 am

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

Post by robos » Tue Dec 13, 2016 9:08 pm

It helped, thank you fdushin.

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

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

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

Post by platforma » Wed Dec 14, 2016 9:55 am

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.

Post Reply