Page 1 of 1

Sonoff / ESP8266: No REPL [SOLVED]

Posted: Sat Feb 10, 2018 2:41 pm
by BigMan
Hi,
my Sonoff/ESP8266 is connected via an UART-converter to my Linux-PC (turned on while pressing the reset-button).

Erasing the Flash:

Code: Select all

$ esptool --port /dev/ttyUSB0 erase_flash
esptool.py v2.2
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 2.5s
Hard resetting...
I turn the Sonoff/ESP8266 off/on by disconnecting the UART-converter while pressing the reset-button.

Code: Select all

$ esptool --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=detect -fm dio 0 esp8266-20171101-v1.9.3.bin 
esptool.py v2.2
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Flash params set to 0x0220
Compressed 600888 bytes to 392073...
Wrote 600888 bytes (392073 compressed) at 0x00000000 in 34.8 seconds (effective 138.3 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...
Again, I turn the Sonoff/ESP8266 off/on by disconnecting the UART-converter, but this time, I do not press the reset-button.

When I start now picocom, it looks like hanging. It doesn't react to Crtl+d, Crtl+c. Only Crtl+a+x is working

Code: Select all

$ picocom --baud 115200 /dev/ttyUSB0
picocom v3.0

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready
Same with ampy. I also have a couple of "old" Sonoff/ESP8266, which I flashed a year ago. Those I can still access with picocom .

I tried flashing a lot of differnt fimrware versions (starting from v1.8.6). I tried flashing with different baud-rates and also with/without -fm dio. After flashing the firmware it always looked fine but from those newly flashed ESP8266, none I can access REPL.

Re: Sonoff / ESP8266: No REPL

Posted: Sun Feb 11, 2018 7:35 am
by pythoncoder
You might like to read my final report on the Sonoff devices.

tl;dr After a great deal of work I failed to get reliable operation. Old and new ones do indeed differ.

Re: Sonoff / ESP8266: No REPL [SOLVED]

Posted: Sun Feb 11, 2018 8:17 am
by BigMan
After countless attempts of searching for the solution:

Many thanks to the forum member "pythoncoder". It was not the 1st time, he gave me the hint, where to find the solution!
Indeed, the solution can be found here: viewtopic.php?f=16&t=3777

There, you find the answer (thanks to forum member sergio7654), that somehow different manufacturers are producting the ESP8266, and in my case

Code: Select all

# esptool --port /dev/ttyUSB0 flash_id
resulted in Manufacturer "5e". And it seems, in that case you have to flash with the following command:

Code: Select all

esptool --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 esp8266-20171101-v1.9.3.bin

Re: Sonoff / ESP8266: No REPL [SOLVED]

Posted: Sun Feb 11, 2018 8:22 am
by pythoncoder
Glad you're up and running. But before investing too much time in the Sonoff I suggest you do some basic tests to determine if they are going to work for you. Check that the WiFi range is adequate. And leave one running doing some simple WiFi task for (say) 24 hrs to see if it holds up.

After spending far too long struggling to get reliable operation I abandoned them as unfit for purpose.

Re: Sonoff / ESP8266: No REPL [SOLVED]

Posted: Thu Sep 20, 2018 7:43 pm
by marcwagner
[quote=BigMan post_id=25366 time=1518337067 user_id=2183]
After countless attempts of searching for the solution:
[/quote]


just to add to the body of knowledge: many instructions give
[code]esptool --port /dev/ttyUSB0 write_flash -fs 1MB 0 esp8266-20171101-v1.9.3.bin[/code] as the flash command. However,
[code]esptool --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 esp8266-20171101-v1.9.3.bin[/code] is correct. note 0x0 and -fm dout.

Re: Sonoff / ESP8266: No REPL [SOLVED]

Posted: Sun May 03, 2020 9:15 am
by TommasoPino
BigMan wrote:
Sun Feb 11, 2018 8:17 am
After countless attempts of searching for the solution:

Many thanks to the forum member "pythoncoder". It was not the 1st time, he gave me the hint, where to find the solution!
Indeed, the solution can be found here: viewtopic.php?f=16&t=3777

There, you find the answer (thanks to forum member sergio7654), that somehow different manufacturers are producting the ESP8266, and in my case

Code: Select all

# esptool --port /dev/ttyUSB0 flash_id
resulted in Manufacturer "5e". And it seems, in that case you have to flash with the following command:

Code: Select all

esptool --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 esp8266-20171101-v1.9.3.bin
Hi just love you :D