Problems connecting to ESP8266 with picocom

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
miririe
Posts: 7
Joined: Fri Nov 23, 2018 4:36 pm

Problems connecting to ESP8266 with picocom

Post by miririe » Tue Nov 27, 2018 11:38 am

I am new to work with ESP and unfortunately do not succeed getting to use micropython on the ESP via my terminal.
On my laptop I am using fedora and I want to use an ESP8266. I downloaded esptool. With that I think I can do erase_flash and write_flash. When setting the device to /dev/ttyUSB0 and choose a baudrate of 115200 the ESP is blinking and I don't get any error messages as an output. Then I am trying to speak to the ESP via picocom. Using "picocom /dev/ttyUSB0" and setting the baudrate to 115200 just nothing happens.
Is there something I am doing wrong or something I forgot?
I would be greatfull for help! Miri

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

Re: Problems connecting to ESP8266 with picocom

Post by Roberthh » Tue Nov 27, 2018 11:55 am

a) Did you upload the firmware? You mention write flash. Did you use a proper image for your board?
b) Dou you get any error messages like access restricted whan you try to access /dev/ttyUSB0. In that case try the good ol'e sledge hammer: run picocom with sudo.
c) Are you sure it's /dev/USB0. If you have more devices attched, it could be another /dev/USBx.
d) You can start picocom with teh proper baud rate, e.g.: picocom -b 115200 /dev/ttyUSB0
If you push reset at the ESP8266 with picocom open, you should at least see some garbage, and then the MicroPyhton boot-up prompt.
e)

miririe
Posts: 7
Joined: Fri Nov 23, 2018 4:36 pm

Re: Problems connecting to ESP8266 with picocom

Post by miririe » Tue Nov 27, 2018 12:21 pm

Thank you very much for your answer and sorry for not having written some information in my question before.

a) I downloaded this file "esp8266-20180511-v1.9.4.bin" and giving the path and filename when using write_flash
b) I am trying to acces /dev/ttyUSB0 using sudo, so I dont get and error message about access problems ;)
c) I actually do not know how to find out, what my device is. But I just guessed it is /dev/ttyUSB0. When using "esptool.py flash_id" some of the output is:
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
(...)
d) nothing happens when first setting the baudrate using picocom or first connect to the device and then set the baudrate...
e) there is something happening when pushing the reset button with picocom open! Indeed it looks like garbage:
��b�n

��nn�
�lp�n�
Is that what you meant?

Do you have any idea, how I could get to use micropython on my ESP?
Thanks already for your help!

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

Re: Problems connecting to ESP8266 with picocom

Post by Roberthh » Tue Nov 27, 2018 12:34 pm

��nn�
�lp�n�
Is that what you meant?
Yes. There is an initial message which is sent at 74880 baud. Normally that cannot be selected with linux. Windows can. Reading that message could give you some indication of the error. B.T.W.: Did you remove the GPIO0/GND jumper, which is need for flashing? Which make of ESP8266 module are you using? Some require other esptool settings for mode.

miririe
Posts: 7
Joined: Fri Nov 23, 2018 4:36 pm

Re: Problems connecting to ESP8266 with picocom

Post by miririe » Tue Nov 27, 2018 12:54 pm

If I try to use picocom with baud 74880, I get this message:
!! Settings mismatch !! Type [C-a] [C-v] to see actual port settings
Type [C-a] [C-h] to see available commands
Terminal ready

When checking on the port settings this is given for the baud rate: baud: 74880 (76800)

And when pushing the reset button there's this output:
load 0x40100000, len 31108, room 16
tail 4
chksum 0xef
load 0x00000000, len 0, room 4
tail 0
chksum 0xef
ho 12 tail 0 room 4
load 0x00000000, len 0, room 12
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c

About the jumper wire: I actually did not use one for flashing as a friend showed to me how he is using an ESP (exactly same ESP he just used his computer). So he just connected the ESP to the laptop with the usb cable, erased and wrote the flash (without any additional wiring) and then could micropython running using picocom.

I have the WEMOS D1 mini pro ESP-8266F.X

User avatar
philwilkinson40
Posts: 59
Joined: Tue Nov 14, 2017 3:11 am
Location: Perth, Australia

Re: Problems connecting to ESP8266 with picocom

Post by philwilkinson40 » Tue Nov 27, 2018 1:43 pm

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
as you are using a wemos d1 mini pro
then

Code: Select all

picocom /dev/ttyUSB0 --b 115200

miririe
Posts: 7
Joined: Fri Nov 23, 2018 4:36 pm

Re: Problems connecting to ESP8266 with picocom

Post by miririe » Tue Nov 27, 2018 1:54 pm

Thank you so much!!!
Having used these properties, I can use picocom at baud 115200 and directly get the micropython prompt.

How to know what different properties I need to use for different devices? (Just in case I'll have to use another type of ESP as well...)
Thanks again!!!

User avatar
philwilkinson40
Posts: 59
Joined: Tue Nov 14, 2017 3:11 am
Location: Perth, Australia

Re: Problems connecting to ESP8266 with picocom

Post by philwilkinson40 » Tue Nov 27, 2018 2:15 pm

like so many things related to Micropython, you can find amazing things by digging in this forum!
post viewtopic.php?t=3860 covers a few variants of ESP boards, including yours.

I recall seeing a similar thread covering lots of ESP32 variants but I cannot find it now!

Post Reply