Page 1 of 1

[Sonoff S20] Micropython on Sonoff S20

Posted: Sat Jun 30, 2018 2:20 pm
by RobH
I feel myself comfortable with Micropython on ESP8266, ESP32 and PyBoards and would like to load and run one of my python programs on a Sonoff S20. Since a Sonoff S20 reports itself as an ESP8266EX with 1MB, I thought I could load a regular esp8266-image of Micropython. Esptool.py seems to work like on a 'real' esp8266 (erase_flash and write_flash), but after that the python prompt doesn't appear, nor do Ctrl-C and Ctrl-D give any reaction by the S20. I tried several -fm parameters, but that didn't help.
What could I have done wrong? Any suggestions?
Regards, Rob.

BTW easy-esp works pretty well on an S20, but I want something different...

Re: [Sonoff S20] Micropython on Sonoff S20

Posted: Sun Jul 01, 2018 12:32 pm
by pythoncoder
This was the invocation line I used on a (different) Sonoff device:

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --verify --flash_size=detect -fm dout 0 build/firmware-combined.bin
I found that the long-term stability of the devices was poor, but the S20 may be better.

Re: [Sonoff S20] Micropython on Sonoff S20

Posted: Sun Jul 01, 2018 6:55 pm
by RobH
Thanks Peter, that did the trick!

Your command comes close to mine, with 2 differences:

(1) I did not use "--verify", but esptool.py (v2.4.0) reports:
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
So this parameter may not be the cause.

(2) "-fm dout" may be one of the variations I didn't try. On 'ordinary' 8266s I always use --fm dio

My 2 S20s didn't show instability (yet), but I haven't had 'm in use for long.

Regards, Rob.