[solved]Serial REPL connection not 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
Ginner
Posts: 2
Joined: Tue Nov 27, 2018 5:00 pm

[solved]Serial REPL connection not working

Post by Ginner » Tue Nov 27, 2018 6:36 pm

Hi!

I have a Wemos D1 mini that I'm trying to connect to, from my Manjaro Linux machine. I've succesfully installed esptools and `esptool.py --port /dev/ttyUSB0 erase_flash` successfully returns:

esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.5.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 18:fe:34:db:e9:53
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 27.1s
Hard resetting via RTS pin...

Now flashing micropython on to the Wemos with 'esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=detect 0 /home/ginner/micropython/esp8266-20180511-v1.9.4.bin --verify' returns the following:

esptool.py v2.5.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 18:fe:34:db:e9:53
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 16MB
Flash params set to 0x0090
Compressed 604872 bytes to 394893...
Wrote 604872 bytes (394893 compressed) at 0x00000000 in 34.9 seconds (effective 138.5 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 0x0090
Verifying 0x93ac8 (604872) bytes @ 0x00000000 in flash against /home/ginner/micropython/esp8266-20180511-v1.9.4.bin...
-- verify OK (digest matched)
Hard resetting via RTS pin...

After this I try to connect with 'picocom /dev/ttyUSB0 -b 11520' and see this: https://imgur.com/a/U17e9lB

I've tried with different baud rates, '--flash_mode=dout' as I've read somewhere on here, '-fm dio' as I've read elsewhere bu to no avail... I really hope someone is able to help.

Thank you.
Last edited by Ginner on Tue Nov 27, 2018 7:18 pm, edited 1 time in total.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Serial REPL connection not working

Post by Roberthh » Tue Nov 27, 2018 7:00 pm

In the firmware update, you have to set the flash size manually to 4 MB. Try:

Code: Select all

esptool.py -p /dev/ttyUSB0 --baud 115200 write_flash --flash_mode=dio --flash_size=4MB 0 esp8266-20180511-v1.9.4.bin
See also this post: viewtopic.php?t=3860
Using 16MB requires more changes.

Ginner
Posts: 2
Joined: Tue Nov 27, 2018 5:00 pm

Re: Serial REPL connection not working

Post by Ginner » Tue Nov 27, 2018 7:16 pm

Wow! That did it! Thank you so much :)

HermannSW
Posts: 197
Joined: Wed Nov 01, 2017 7:46 am
Contact:

Re: [solved]Serial REPL connection not working

Post by HermannSW » Tue Nov 27, 2018 10:17 pm

> After this I try to connect with 'picocom /dev/ttyUSB0 -b 11520' and see this: https://imgur.com/a/U17e9lB
>
You need to specify the correct baudrate 115200, then you will see correct REPL.

I just flashed Wemos D1 minis without specifying the flash size, and verify as well as serial console REPL worked fine.
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w

Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454

webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell

Post Reply