OSError 19 (ENODEV)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
oli
Posts: 17
Joined: Wed Aug 05, 2015 9:13 am

OSError 19 (ENODEV)

Post by oli » Wed May 04, 2016 6:22 am

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 34525 times
What could that be?

Thank you!

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: OSError 19 (ENODEV)

Post by pfalcon » Wed May 04, 2016 8:32 am

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
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

oli
Posts: 17
Joined: Wed Aug 05, 2015 9:13 am

Re: OSError 19 (ENODEV)

Post by oli » Wed May 04, 2016 9:01 am

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.

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

Re: OSError 19 (ENODEV)

Post by deshipu » Wed May 04, 2016 10:10 am

Micropython requires at least 1024KB flash size on the ESP8266 for the filesystem to work.

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: OSError 19 (ENODEV)

Post by pfalcon » Thu May 05, 2016 2:17 pm

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()
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

raszga
Posts: 10
Joined: Sat Sep 10, 2016 2:06 pm

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

Post by raszga » Sun Oct 02, 2016 5:50 pm

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

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

Re: OSError 19 (ENODEV)

Post by deshipu » Mon Oct 03, 2016 8:54 am

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.

raszga
Posts: 10
Joined: Sat Sep 10, 2016 2:06 pm

Re: OSError 19 (ENODEV)

Post by raszga » Tue Oct 04, 2016 1:29 am

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

QuAzI
Posts: 2
Joined: Sun Nov 13, 2016 8:30 am

Re: OSError 19 (ENODEV)

Post by QuAzI » Sun Nov 13, 2016 8:43 am

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]

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: OSError 19 (ENODEV)

Post by Roberthh » Sun Nov 13, 2016 9:06 am

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.

Post Reply