Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

OSError: [Errno 2] ENOENT: main.py (solved) #90

Closed
@mcauser

Description

@mcauser

Installed the latest micropython-esp32 on a new Wemos Lolin32 board.

On first boot, I noticed there was an ENOENT error:

>>> 
PYB: soft reboot
OSError: [Errno 2] ENOENT
MicroPython v1.8.6-1089-g1365f7f-dirty on 2017-05-16; ESP32 module with ESP32
Type "help()" for more information.

I thought the issue may have been baud related, so I tried 115200, 230400, 460800 and 921600.
Tried importing _boot to re-setup the /flash, but kept getting "FAT filesystem appears to be corrupted."
Tried using a different machine and a few different usb cables too.
Then I tried manually creating the main.py file, and the problem went away.

After make erase and make deploy, there appears to be no main.py file in /flash.
Should there be an empty / placeholder file, like with boot.py?

>>> import os
>>> os.listdir()
['boot.py']

So, I created a main.py:

>>> f = open("main.py", "w")
>>> f.write("print(\"main.py: Hello\")\n")
24
>>> f.close()
>>> os.listdir()
['boot.py', 'main.py']

And on soft and/or hard reboot, no more ENOENT error!

>>> 
PYB: soft reboot
main.py: Hello
MicroPython v1.8.6-1089-g1365f7f-dirty on 2017-05-16; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>> ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:3132
ho 0 tail 12 room 4
load:0x40078000,len:7788
load:0x40080000,len:252
entry 0x40080034
I (1321) cpu_start: Pro cpu up.
I (1321) cpu_start: Single core mode
I (1322) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1335) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1355) heap_alloc_caps: At 3FFD48C8 len 0000B738 (45 KiB): DRAM
I (1376) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1398) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1419) heap_alloc_caps: At 400998C8 len 00006738 (25 KiB): IRAM
I (1440) cpu_start: Pro cpu start user code
I (1501) cpu_start: Starting scheduler on PRO CPU.
main.py: Hello
MicroPython v1.8.6-1089-g1365f7f-dirty on 2017-05-16; ESP32 module with ESP32
Type "help()" for more information.
>>> 

FYI, version is showing dirty as I modified the Makefile with:

ESPIDF = /Users/mike/esp/esp-idf
PORT = /dev/tty.SLAB_USBtoUART
BAUD = 230400

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions