Can't get REPL or flash files, but board is working

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
bp100
Posts: 1
Joined: Sun Aug 02, 2020 4:26 pm

Can't get REPL or flash files, but board is working

Post by bp100 » Sun Aug 02, 2020 4:35 pm

My D1 mini esp8266 is partly working - I am able to flash an image, and when I hit the reset button main.py runs correctly. verify_flash also appears to be working:

Code: Select all

$ esptool.py --port /dev/cu.usbserial-1430 --baud 460800 verify_flash 0 esp8266-20191220-v1.12.bin
esptool.py v2.8
Serial port /dev/cu.usbserial-1430
Connecting........__
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 50:02:91:7a:03:7f
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0040
Verifying 0x97534 (619828) bytes @ 0x00000000 in flash against esp8266-20191220-v1.12.bin...
-- verify OK (digest matched)
Hard resetting via RTS pin...
However, I can no longer open a repl or flash files from PyCharm, even though I could earlier. When trying to open a repl right now it doesn't finish loading. I see:

Code: Select all

Device path /dev/cu.usbserial-1430
Quit: Ctrl+] | Stop program: Ctrl+C | Reset: Ctrl+D
Type 'help()' (without the quotes) then press ENTER.
When trying to Flash a file, it just stops loading. I see:

Code: Select all

/usr/local/bin/python3.7 "/Users/benp/Library/Application Support/JetBrains/PyCharmCE2020.1/plugins/intellij-micropython/scripts/microupload.py" -C /Users/benp/projects/tuple-weather-example/tuple-weather -v /dev/cu.usbserial-1430 /Users/benp/projects/tuple-weather-example/tuple-weather/main.py
Connecting to /dev/cu.usbserial-1430
Uploading files: 0% (0/1)
/Users/benp/projects/tuple-weather-example/tuple-weather/main.py -> main.py
If I unplug the esp8266 at this point I see:

Code: Select all

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 493, in read
    buf = os.read(self.fd, size - len(read))
OSError: [Errno 6] Device not configured

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/benp/Library/Application Support/JetBrains/PyCharmCE2020.1/plugins/intellij-micropython/scripts/microupload.py", line 138, in <module>
    main(sys.argv[1:])
  File "/Users/benp/Library/Application Support/JetBrains/PyCharmCE2020.1/plugins/intellij-micropython/scripts/microupload.py", line 79, in main
    files.put(remote_path, fd.read())
  File "/usr/local/lib/python3.7/site-packages/ampy/files.py", line 208, in put
    self._pyboard.enter_raw_repl()
  File "/usr/local/lib/python3.7/site-packages/ampy/pyboard.py", line 189, in enter_raw_repl
    data = self.read_until(1, b'raw REPL; CTRL-B to exit\r\n>')
  File "/usr/local/lib/python3.7/site-packages/ampy/pyboard.py", line 155, in read_until
    data = self.serial.read(min_num_bytes)
  File "/usr/local/lib/python3.7/site-packages/serial/serialposix.py", line 509, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: [Errno 6] Device not configured
How can I tell what's going on here? Why can't I get a repl or write any files?

Post Reply