Page 1 of 2

OSError 19 (ENODEV)

Posted: Wed May 04, 2016 6:22 am
by oli
Hi,

today i got my binary to flash my ESP Module. After flashing the Module, the REPL over UART is working! Great work from you guys so far!
But i hit a little error. When i want to call os.listdir() i get the error OSError: 19
2016-05-04 08_08_05-COM7 - PuTTY.png
2016-05-04 08_08_05-COM7 - PuTTY.png (2.79 KiB) Viewed 34919 times
What could that be?

Thank you!

Re: OSError 19 (ENODEV)

Posted: Wed May 04, 2016 8:32 am
by pfalcon
You can get an idea what that error means by googling up "errno <number>" (we need to think how to make it more user-friendly, too). Error number largely match those of Linux. I usually end up looking at http://www.virtsync.com/c-error-codes-include-errno . From it, you can see that it's ENODEV, meaning that filesystem was not mounted. And that's pretty strange. Please provide output of "import port_diag" and as many details on how you arrived at that situation as possible (e.g., which module you have, how you flashed it, which boot number it is, did you set up WebREPL, etc.).

If you're looking for a hint how to try to get passed it, it is to erase entire flash and to program it again - that's universal first step to try for any kind of "I flashed and see issues" problem, please see here: https://github.com/micropython/micropyt ... structions

Re: OSError 19 (ENODEV)

Posted: Wed May 04, 2016 9:01 am
by oli
Hi,
thanks you!

Here is the output:

Code: Select all

import port_diag
Flash ID: 1340c8 (Vendor: c8 Device: 4013)
Flash bootloader data:
Byte @2: 00
Byte @3: 00 (Flash size: 512KB Flash freq: 40MHZ)
My ESP Module is an old one (1.5 years old). It is the little blue one, with the 8 pin connector. there is absoultely no labeling on the module, so no information. http://l0l.org.uk/wp-content/uploads/20 ... spback.png (the ESP-01)

No WebRepl setup, just Uart-Repl.

Re: OSError 19 (ENODEV)

Posted: Wed May 04, 2016 10:10 am
by deshipu
Micropython requires at least 1024KB flash size on the ESP8266 for the filesystem to work.

Re: OSError 19 (ENODEV)

Posted: Thu May 05, 2016 2:17 pm
by pfalcon
deshipu's answer is correct. WebREPL also isn't started automatically with 512KB Flash, as (user-configurable) startup sequence depends on filesystem availability. You can start it manually with:

Code: Select all

import webrepl
webrepl.start()

Re: OSError ENODEV 19 /* No such device */

Posted: Sun Oct 02, 2016 5:50 pm
by raszga
Hello,
I have a similar problem on an ESP8266-12, even after I blank the flash and reload the ..2016_09-25..bin version ( and all others).
After I load the flash the boot.py is not present and a lot of error messages come as :
*******************************************
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
****************************************
The List Dir is coming back with :
********************************
OSError: [Errno 19] ENODEV
********************************
The error definition is :
#define ENODEV 19 /* No such device */
and the memory is obvious 4 Mb.

The report comes:
***************************************
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: 562812
md5: d7157c7b8c04bc252192de49358543fb
True
************************************************
What is more confusing is that a have an identical board which working just fine so my conclusion is that I have a faulty device ( flash ?)
I would appreciate any suggestion,
Tanks
CR

Re: OSError 19 (ENODEV)

Posted: Mon Oct 03, 2016 8:54 am
by deshipu
The filesystem is not created because the initialization fails earlier with "OSError: can't set AP config". Why that happens, I have no idea, but I've seen a similar error posted here when someone tried the 8285 module with MicroPython.

Re: OSError 19 (ENODEV)

Posted: Tue Oct 04, 2016 1:29 am
by raszga
Thanks fort the response, I suspected some connection.
Now here is interesting, over the "faulty " part I ran from network module ( I loaded the last stable version from 09092016):
**************************************************************
import network
ap = network.WLAN(network.AP_IF) # create access-point interface
ap.active(True) # activate the interface
ap.config(essid='ESP-AP') # set the ESSID of the access point
***************************************************************

Ok this made the boot.py to appear under ListDir ad even further
**************************************************************
WebREPL daemon started on ws://192.168.4.1:8266
WebREPL daemon started on ws://0.0.0.0:8266
Started webrepl in setup mode
could not open file 'main.py' for reading

MicroPython v1.8.4-10-gbc28ac8 on 2016-09-09; ESP module with ESP8266
Type "help()" for more information.
>>> import os;os.listdir('')
['boot.py']
----------------------------
boot.py
----------------------------
>>>
*******************************************************************

Even more interesting the AP which is created is : MicroPython-e06659 with micropythoN password...
(I don't know how I remembered something about the password which I read somewhere)

*************************************************************************************

Hope this helps... it is confusing though....

CR

Re: OSError 19 (ENODEV)

Posted: Sun Nov 13, 2016 8:43 am
by QuAzI
I have a similar problem on firmware `MicroPython v1.8.6-7-gefd0927 on 2016-11-10` with ESP12E (Node MCU V3)
[code]
>>> import port_diag
FlashROM:
Flash ID: 1640ef (Vendor: ef Device: 4016)
Flash bootloader data:
Byte @2: 00
Byte @3: 40 (Flash size: 4MB Flash freq: 40MHZ)
Firmware checksum:
size: 565964
md5: a7aba6d1b34b413abd34e17cc44c9278
True

Networking:
STA ifconfig: ('192.168.0.108', '255.255.255.0', '192.168.0.1', '192.168.0.1')
AP ifconfig: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '192.168.0.1')
Free WiFi driver buffers of type:
0: 8 (1,2 TX)
1: 0 (4 Mngmt TX(len: 0x41-0x100))
2: 8 (5 Mngmt TX (len: 0-0x40))
3: 4 (7)
4: 7 (8 RX)
lwIP PCBs:
Active PCB states:
Listen PCB states:
TIME-WAIT PCB states:
>>> import os;os.listdir('')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 19] ENODEV
[/code]
Firmware downloaded from https://micropython.org/download and uploaded through
[code]
esptool.py -p /dev/ttyUSB0 write_flash 0x00000000 esp8266-20161110-v1.8.6.bin
[/code]

Also first example from MicroPython main page doesn't work
[code]
>>> import pyb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'pyb'
[/code]

Re: OSError 19 (ENODEV)

Posted: Sun Nov 13, 2016 9:06 am
by Roberthh
It looks like the file system does not exist. Try to erase the flash before uploading the ESP binaries, with

esptool.py -p /dev/ttyUSB? erase_flash

Then, after reloading micropython, a new file system is created.

The second observation you mentioned is not really an error. The pyb module does not exist on ESP8266. It exists on PyBoard.