v1.8-52-gbc04dc2 could not open file 'boot.py' for reading - .DS_Store to blame

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

v1.8-52-gbc04dc2 could not open file 'boot.py' for reading - .DS_Store to blame

Post by mcauser » Thu May 12, 2016 6:37 am

Something has happened in the last few days and my WeMos D1 mini now will not import (/scripts) files.
I tried rolling back to last known working git revision and it still does not import files.

I had two WeMos D1 minis running v1.8.1 and v1.8.9 and after upgrading to v1.8.52 (and downgrading and upgrading) they all get the same error.
Seems to be software related.

Code: Select all

Traceback (most recent call last):
  File "_boot", line 1
SyntaxError: invalid syntax
could not open file 'boot.py' for reading
could not open file 'main.py' for reading
Built on Mac OSX 10.10.5 (Yosemite)
Updated to the latest esp-open-sdk, including submodules
Built on a case sensitive HFS filesystem (mounted .dmg) in Standalone=Y mode
make receives error:
> Installing pass-2 core C compiler
> no member named 'ptrdiff_t' in the global namespace
Applied comment fix: https://github.com/pfalcon/esp-open-sdk ... -217081166
Running make again completes successfully.
xtensa-lx106 bin dir added to $PATH
esp-open-sdk is using ESP8266_NONOS_SDK_V1.5.2_16_01_29.zip

Update micropython to latest version, including submodules

Code: Select all

make clean
make axtls
make
esptool.py --port /dev/tty.wchusbserial1420 erase_flash
esptool.py --baud 230400 --port /dev/tty.wchusbserial1420 write_flash -fm dio -fs 32m -ff 40m --verify 0x00000 build/firmware-combined.bin
-- verify OK
(sometimes verify fails and another write_flash fixes it)

Code: Select all

Verifying 0x774bc (488636) bytes @ 0x00000000 in flash against build/firmware-combined.bin...
A fatal error occurred: Invalid end of packet (sflash read)
After writing, the board needs to be reset to see the new firmware.
Hardware reset button pressed.

Code: Select all

screen /dev/tty.wchusbserial1420 115200

(some characters)
don't use rtc mem data
(some characters)
Traceback (most recent call last):
  File "_boot", line 1
SyntaxError: invalid syntax
could not open file 'boot.py' for reading
could not open file 'main.py' for reading
#4 ets_task(401002fc, 3, 3fff5180, 4)
MicroPython v1.8-9-gdf2b1a4 on 2016-05-12; ESP module with ESP8266
Type "help()" for more information.
After rolling forward.

Code: Select all

PYB: soft reboot
Traceback (most recent call last):
  File "_boot", line 1
SyntaxError: invalid syntax
could not open file 'boot.py' for reading
could not open file 'main.py' for reading
#4 ets_task(401002fc, 3, 3fff6190, 4)
MicroPython v1.8-52-gbc04dc2 on 2016-05-12; ESP module with ESP8266
Tried uploading an Arduino sketch to replace the firmware. Didn't fix it.

Any clues?
Last edited by mcauser on Thu May 12, 2016 2:41 pm, edited 2 times in total.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by mcauser » Thu May 12, 2016 6:47 am

Perhaps something to do with frozen modules
viewtopic.php?t=1671
https://github.com/micropython/micropyt ... 8254a35b79

Code: Select all

LINK build/firmware.elf
   text	   data	    bss	    dec	    hex	filename
 485038	   1048	  56208	 542294	  84656	build/firmware.elf
Create build/firmware-combined.bin
esptool.py v1.0.1
('flash    ', 34352)
('padding  ', 2512)
('irom0text', 451772)
('total    ', 488636)

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

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by deshipu » Thu May 12, 2016 7:50 am

Looks like your flashing was interrupted (due to interference?) and didn't finish properly, and so the _boot.py module has garbage in it. Please try flashing again, this time make sure it completes properly. If it doesn't, try flashing at slower speed, and try a different USB cable and USB port on your computer.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by mcauser » Thu May 12, 2016 12:15 pm

I tried:
* dropping the baud rate 230400, 115200, 57600
* different usb cables
* different usb port
* reboot osx.
* flash kickstarter v1.8.0 esp8266-2016-05-03-v1.8.bin

Code: Select all

esptool.py --baud 115200 --port /dev/tty.wchusbserial1410 write_flash -fm dio -fs 8m --verify 0 esp8266-2016-05-03-v1.8.bin
The -- verify OK leads me to believe either the binary contains invalid data, or the reset button press post write_flash is breaking it.

When I upload the KS v1.8.0 firmware and open a screen before pressing the reset button, I see:

Code: Select all

(characters)
don't use rtc mem data
(characters)
Bootloader Flash size appear to have been set incorrectly, trying to fix
bcn 0
del if1
usl

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 30616, room 16 
tail 8
chksum 0x35
load 0x3ffe8000, len 1040, room 0 
tail 0
chksum 0x21
load 0x3ffe8410, len 2652, room 8 
tail 4
chksum 0x00
csum 0x00
(characters)
don't use rtc mem data
(characters)
WebREPL daemon started on ws://192.168.4.1:8266
Started webrepl in setup mode
could not open file 'main.py' for reading
#4 ets_task(401002fc, 3, 3fff5180, 4)
MicroPython v1.8-3-gcf139c6 on 2016-05-03; ESP module with ESP8266
Type "help()" for more information.
The Kickstarter firmware allows me to import neopixel and import boot without error.
However, I still see "don't use rtc mem data" where I didn't before.

I'll try reinstalling from fresh clones of esp-open-sdk and micropython from GitHub.

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

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by deshipu » Thu May 12, 2016 12:23 pm

The "don't use rtc mem data" is a bootloader's message, and it's perfectly normal. As well as all the other garbage you get there on boot/restart.

Looks like you got it to work!

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by mcauser » Thu May 12, 2016 1:43 pm

Rebuilt latest esp-open-sdk and micropython and now runs v1.8-59-ga314b84 without error!

Code: Select all

MicroPython v1.8-59-ga314b84 on 2016-05-12; ESP module with ESP8266
Thanks deshipu

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by mcauser » Thu May 12, 2016 2:11 pm

Figured out what the problem was...
Hidden Mac OS X .DS_Store file in /esp8266/scripts was being added to /esp8266/build/frozen.c!

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

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading

Post by deshipu » Thu May 12, 2016 2:13 pm

Thank you Steve Jobs!


Peter.Kenyon
Posts: 70
Joined: Wed Oct 14, 2015 5:07 pm

Re: v1.8-52-gbc04dc2 could not open file 'boot.py' for reading - .DS_Store to blame

Post by Peter.Kenyon » Fri May 13, 2016 6:22 am

been caught out by that a few times, user inserts a usb stick into a mac and it comes back littered with hidden crap

Post Reply