Unable to REPL with new NodeMCU

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
fovea1959
Posts: 3
Joined: Sun Sep 17, 2017 4:34 pm

Unable to REPL with new NodeMCU

Post by fovea1959 » Sun Sep 17, 2017 5:36 pm

I am just starting to explore micropython.

I have Micropython 1.9.2 working perfectly with 1.9.2 on a Adafruit Huzzah, using a Ubuntu 16.04 as a host machine and picocom as my terminal emulator.

I got brave and bought a couple of NodeMCUs off Amazon. The one I am working with has a Model ESP8266MOD chip on it. I erased the flash and burned Micropython to it using the same instructions (and vertified the burn).

wegscd@wegscd-hotbox:~/mp$ ~/.local/bin/esptool.py --port /dev/ttyUSB0 --baud 460800 chip_id
esptool.py v2.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Chip ID: 0x00290aae
Hard resetting...
wegscd@wegscd-hotbox:~/mp$ ~/.local/bin/esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.1s
Hard resetting...
wegscd@wegscd-hotbox:~/mp$ ~/.local/bin/esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --verify --flash_size=detect 0 ~/Downloads/esp8266-20170823-v1.9.2.bin
esptool.py v2.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266
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
Compressed 601136 bytes to 392067...
Wrote 601136 bytes (392067 compressed) at 0x00000000 in 8.8 seconds (effective 544.4 kbit/s)...
Hash of data verified.

Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Flash params set to 0x0040
Verifying 0x92c30 (601136) bytes @ 0x00000000 in flash against /home/wegscd/Downloads/esp8266-20170823-v1.9.2.bin...
-- verify OK (digest matched)
Hard resetting...


Using picocom, I am unable to get a REPL prompt; I get garbage. I have tried every baud rate from 9600 up to 921600 (doing a reset of the NodeMCU after each baud rate switch inside picocom), and each reset results in varying numers of garbage characters.

I am able to program the boards and run examples from the ESP8266 libraries (including web servers, and talking to the serial ports) using arduino 1.8.4 if I call them nodemcu 1.0, so I don't think I have defective hardware.

Any suggestions on what to try to get REPL working on these puppies?

stefanh
Posts: 5
Joined: Thu Jun 02, 2016 8:31 pm

Re: Unable to REPL with new NodeMCU

Post by stefanh » Wed Sep 20, 2017 5:39 pm

Hi,

I had the same problem with an cheap NodeMCU from eBay.

Using the esptool, I had to specify the --flash_mode parameter
https://github.com/espressif/esptool#flash-modes

Most tutorials say you have to use "dio" for NodeMCUs but for me the right choice was "qio".
I would recommend, just try all possible values (qio, qout, dio, dout).

I still don't understand why the verification step was successful, but I wasn't investigating further since now its working for me.

fovea1959
Posts: 3
Joined: Sun Sep 17, 2017 4:34 pm

Re: Unable to REPL with new NodeMCU

Post by fovea1959 » Sat Sep 23, 2017 1:13 am

That was it! --flash_mode dio did the trick!

Thank you. $9 NodeMCU working!

Post Reply