[Sonoff S20] Micropython on Sonoff S20

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
RobH
Posts: 14
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

[Sonoff S20] Micropython on Sonoff S20

Post by RobH » Sat Jun 30, 2018 2:20 pm

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...

User avatar
pythoncoder
Posts: 3079
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: [Sonoff S20] Micropython on Sonoff S20

Post by pythoncoder » Sun Jul 01, 2018 12:32 pm

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.
Peter Hinch

RobH
Posts: 14
Joined: Fri Mar 23, 2018 3:37 pm
Location: Netherlands
Contact:

Re: [Sonoff S20] Micropython on Sonoff S20

Post by RobH » Sun Jul 01, 2018 6:55 pm

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.

Post Reply