OSError: [Errno 2] ENOENT

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
spain_iot
Posts: 3
Joined: Sun Oct 15, 2017 10:17 pm

OSError: [Errno 2] ENOENT

Post by spain_iot » Sun Oct 15, 2017 11:10 pm

Hello!

Before I quick it off, congrats on this very useful software, very promising and thank you!

Ok, now I'm just getting started and running into some issues on Mac Sierra.

Here is what I get when I boot the board:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OK
>ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:4268
load:0x40078000,len:0
load:0x40078000,len:10648
entry 0x4007a56c
I (983) cpu_start: Pro cpu up.
I (983) cpu_start: Single core mode
I (985) heap_init: Initializing. RAM available for dynamic allocation:
I (995) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1013) heap_init: At 3FFD4158 len 0000BEA8 (47 KiB): DRAM
I (1033) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1052) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1073) heap_init: At 4008F3A8 len 00010C58 (67 KiB): IRAM
I (1092) cpu_start: Pro cpu start user code
I (1153) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.2-279-g090b6b80 on 2017-10-15; ESP32 module with ESP32
Type "help()" for more information.
>>>

All the samples fail with error.

Here is what I did to get the board running:

esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 115200 erase_flash
esptool.py v2.1
Connecting........___
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 0.9s
Hard resetting...

esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 115200 write_flash -z 0x1000 firmware.bin
esptool.py v2.1
Connecting........_
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 903392 bytes to 567400...
Wrote 903392 bytes (567400 compressed) at 0x00001000 in 50.1 seconds (effective 144.2 kbit/s)...
Hash of data verified.

esptool.py --port /dev/tty.SLAB_USBtoUART flash_id
esptool.py v2.1
Connecting........____
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4016
Detected flash size: 4MB
Hard resetting...

Fixed the boot issues, simply just reflashed at lower baud rate,

But I still get errors with the examples on the documentation:

>>>pyb.LED(1).on()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pyb' is not defined

Here is the correct boot:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:4268
load:0x40078000,len:0
load:0x40078000,len:10648
entry 0x4007a56c
I (982) cpu_start: Pro cpu up.
I (983) cpu_start: Single core mode
I (984) heap_init: Initializing. RAM available for dynamic allocation:
I (994) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1013) heap_init: At 3FFD4158 len 0000BEA8 (47 KiB): DRAM
I (1032) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1052) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1072) heap_init: At 4008F3A8 len 00010C58 (67 KiB): IRAM
I (1091) cpu_start: Pro cpu start user code
I (1152) cpu_start: Starting scheduler on PRO CPU.
OSError: [Errno 2] ENOENT
MicroPython v1.9.2-279-g090b6b80 on 2017-10-15; ESP32 module with ESP32
Type "help()" for more information.

Well, as I was typing this, I caught a OSError: [Errno 2] ENOENT... help?

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

Re: OSError: [Errno 2] ENOENT

Post by pythoncoder » Mon Oct 16, 2017 7:25 am

The pyb module is specific to the Pyboard so cannot be imported on any other platform. You need to use machine on ESP32 (and other ports).
Peter Hinch
Index to my micropython libraries.

spain_iot
Posts: 3
Joined: Sun Oct 15, 2017 10:17 pm

Re: OSError: [Errno 2] ENOENT

Post by spain_iot » Mon Oct 16, 2017 12:09 pm

Hello, thank you for the feedback, that was not apparent to me.

I did try this though and it failed...

>>>import machine:
>>>pyb.LED(1).on()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pyb' is not defined

Now I have to figure out how can I upload a simple main.py to the board to test it on a file, still learning the right flows but I'm more conformable than going through the IDE and C. :).

gepd
Posts: 12
Joined: Sat Oct 14, 2017 8:13 pm

Re: OSError: [Errno 2] ENOENT

Post by gepd » Mon Oct 16, 2017 2:50 pm

create the main.py file to remove the 'OSError: [Errno 2] ENOENT' and try this examples http://docs.micropython.org/en/latest/e ... ckref.html it's the documentation for esp8266 but the esp32 API is similar so you will be able to run most of the examples.

spain_iot
Posts: 3
Joined: Sun Oct 15, 2017 10:17 pm

Re: OSError: [Errno 2] ENOENT

Post by spain_iot » Wed Oct 18, 2017 1:16 pm

Thank you, figured things out, now I'm up and running... able to get Wifi, onboard LED, parsing text, and pretty much all my needs met, thank you Dev Team!

Post Reply