error on create file

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
jmv
Posts: 5
Joined: Thu Aug 25, 2016 2:00 pm

error on create file

Post by jmv » Thu Aug 25, 2016 2:17 pm

hi, i get a error wen i create or list file.(last precompiled versions)

Performing initial setup
Traceback (most recent call last):
File "_boot.py", line 11, in <module>
File "inisetup.py", line 37, in setup
File "inisetup.py", line 9, in wifi
OSError: can't set AP config
could not open file 'boot.py' for reading
could not open file 'main.py' for reading

MicroPython v1.8.3-45-gc428367 on 2016-08-25; ESP module with ESP8266
Type "help()" for more information.

>>> f = open('data.txt', 'w')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV

>>>import os;os.listdir('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
>>> Waiting answer from ESP - Timeout reached. Command aborted.

User avatar
pythoncoder
Posts: 4351
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: error on create file

Post by pythoncoder » Fri Aug 26, 2016 6:18 am

Did you erase the flash before installing the firmware? This is the commonest reason for this issue.
Peter Hinch

User avatar
deshipu
Posts: 1364
Joined: Thu May 28, 2015 5:54 pm

Re: error on create file

Post by deshipu » Fri Aug 26, 2016 6:57 am

Can you paste the result of running "import port_diag" here please?

jmv
Posts: 5
Joined: Thu Aug 25, 2016 2:00 pm

Re: error on create file

Post by jmv » Fri Aug 26, 2016 12:43 pm

Did you erase the flash before installing the firmware? This is the commonest reason for this issue.
how I erase all flash?

I flash with ESP8266Flasher.exe (windows)


[url=https://postimg.org/image/9jxxjh6i7/][img]https://s11.postimg.org/9jxxjh6i7/flah.png[/img][/url]

[url=https://postimg.org/image/7tjhvqecv/][img]https://s11.postimg.org/7tjhvqecv/flash_ok.png[/img][/url]

[url=https://postimg.org/image/z5eqx2j3j/][img]https://s11.postimg.org/z5eqx2j3j/initnok.png[/img][/url]

[url=https://postimg.org/image/4p8tyxxkf/][img]https://s11.postimg.org/4p8tyxxkf/initok.png[/img][/url]

[url=https://postimg.org/image/lr1o11cfj/][img]https://s11.postimg.org/lr1o11cfj/portdiag.png[/img][/url]


[url=https://postimage.org/]upload gif from url[/url]


https://s11.postimg.org/xnop7roz7/flah.png
https://s11.postimg.org/6ehx70d9v/flash_ok.png
https://s11.postimg.org/xdls25zqr/initnok.png
https://s11.postimg.org/b2xx272gj/initok.png
https://s11.postimg.org/j9pwtrsj7/portdiag.png

import port_diag
FlashROM:
Flash ID: 1640e0 (Vendor: e0 Device: 4016)
Flash bootloader data:
Byte @2: 02
Byte @3: 40 (Flash size: 4MB Flash freq: 40MHZ)
Firmware checksum:
size: 530740
md5: 798a3ddd15a3515eac9dbd198889fb2c
True
Networking:
STA ifconfig: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '208.67.222.222')
AP ifconfig: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '208.67.222.222')
Free WiFi driver buffers of type:
0: 8
1: 0
2: 8
3: 4
4: 7
lwIP PCBs:
Active PCB states:
Listen PCB states:
TIME-WAIT PCB states:
>>>


sorry for bad post and bad english!

jmv
Posts: 5
Joined: Thu Aug 25, 2016 2:00 pm

Re: error on create file

Post by jmv » Sat Aug 27, 2016 4:00 pm

work's fine in 1.7 version. but not work in last versions.

User avatar
pythoncoder
Posts: 4351
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: error on create file

Post by pythoncoder » Sun Aug 28, 2016 9:30 am

Re erasing flash. I'm not a Windows user but this should work if you change the port to the correct Windows serial port:

Code: Select all

esptool.py --port /dev/ttyUSB0 erase_flash
Then install the firmware normally. You'll need to set up any WiFi connection details again as erase_flash erases everything.
Peter Hinch

jmv
Posts: 5
Joined: Thu Aug 25, 2016 2:00 pm

Re: error on create file

Post by jmv » Mon Aug 29, 2016 2:56 pm

solved! erased all flash with ESP8266Flasher.exe (windows)

thanks!

Lornioiz
Posts: 36
Joined: Wed Aug 03, 2016 11:39 am
Location: Florence, Italy

Re: error on create file

Post by Lornioiz » Thu Oct 13, 2016 12:58 pm

jmv wrote:solved! erased all flash with ESP8266Flasher.exe (windows)

thanks!
Unfortunately, this doesn't work for me.
I erased the board multiple time. I know it was erased completely because not only the internal file system is now empty, but the name of the wifi network is reverted to the "MicroPython--XXX" format as well.
However, I still get the "OSError: can't set AP config", while a couple of months ago I have not had any problem... aside for that, the board seems to work fine.
Still struggling to understand...

P.S.
Update: It turned out that while it was impossibile to change the AP configuration from Repl, it was possibile do it from WEBRepl without any problem... I still don't get it, but as far as it works it is ok with me...

jmv
Posts: 5
Joined: Thu Aug 25, 2016 2:00 pm

Re: error on create file

Post by jmv » Sat Oct 15, 2016 11:39 am

write a blank file to erase all memory with espflasher.exe
work's for me. ;)
Attachments
blank_1MB.zip
(1.13 KiB) Downloaded 169 times

Post Reply