Hi there fellow micro-pythonians!
First of all, hats off to the micropython team! Great piece of kit!
But still, i'f got a problem....
I'm writing a custom module incorporating the urequests module. Urequest runs but hangs on line 20: self._cached = self.raw.read()
After that ran a little test but ran into a Errno 13 (implying permission denied):
[code]
MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type "help()" for more information.
>>> import uos
>>> uos.listdir()
['boot.py']
>>> f = open("test.txt", "w")
>>> f.write("this is a test")
14
>>> f.read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 13] EACCES
>>> uos.listdir()
['boot.py', 'test.txt']
>>>
[/code]
Open and write work, read get's errno 13. I tried this with the ESP8266 stable, nightly and my custom builds. In between firmware uploads, the flash is always cleared.
Can any of you maybe reproduce? I'm running a Wemos D1 Mini 4Mb with latest MP 1.10.
I will try to reproduce it myself on another board tonight!
Many thanks already for any help given!
Wemos D1 Mini 4MB file read: OSError: [Errno 13] EACCES
Re: Wemos D1 Mini 4MB file read: OSError: [Errno 13] EACCES
You have to open the file for both reading an writing, like:
f.open("file.txt", "w+")
and before reading, you have to go back to start, like with:
f.seek(0)
These are standard file operation properties, nothing special to MicroPython.
And yes, don't forget to close the file with:
f.close()
Otherwise the data may not be written.
f.open("file.txt", "w+")
and before reading, you have to go back to start, like with:
f.seek(0)
These are standard file operation properties, nothing special to MicroPython.
And yes, don't forget to close the file with:
f.close()
Otherwise the data may not be written.
Re: Wemos D1 Mini 4MB file read: OSError: [Errno 13] EACCES
Consider this as my facepalm. I guess i needed the extra set of eyes to state the obvious... Thanks!