ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware

I hope you remove the programming wires before using it in earnest.
The slot in the PCB through which they pass is an air gap to separate the low voltage and mains voltage areas of the board.

Could you tell us which color is for what? :slight_smile:

3,3V: ??
GND: ??
UTX (TRN): ??
URX (RCV): ??

and where is GPIO0?

In my setup:

Red is 3.3
Brown is GND
Orange and Yello are TX/RX (not sure which is which).
Green is GPIO0.

However, a few posts before I added a link to the datasheet, so it is possible to figure it out too.

On the other hand - if anyone manages to flash ESP-Easy, please tell me how.

FYI - I flashed it with ARDUINO.
You need to use -DOUT mode to flash it.

@NDR008: Thank you… Also for the hint with the manual :wink:
I will try this evening or tomorrow flashing with ESP_Easy, because the modul I got almost for free. I’ll report.

Regards
Michael

Gave it a go yet?

Instead of asking for help I will contribute.

After I have spent 3 evenings installing OpenHab I found it useful to post my own guide, and highlight parts I’ve spent most of my time on:

Project. Sonoff S20 - OpenHab2 - Siri integration

  1. Openhabianpi is installed on Raspberry Pi as per instructions (easy, no troubles, instruction is clear)
  2. Install drivers for USB-to-Pin adapter (CP2102 in my case)
  3. Flash Sonoff S20 as described here
  4. Install Mosquitto
  5. Set-up MQTT on Sonoff as per instruction
  • Note ClientID should be different from one you give in 5.
  • Host should be external IP address (to check this, do following from terminal):
ping openhabianpi
  1. Install Homekit addon, but change port number to 51826 as suggested here
  2. Install Openhab cloud

Till now no success with flashing TASMOTA

Using PlatformIO and Arduino. Sketch will be compiled, but uploading hangs. If I start the module in normal mode, I see something on the Serial Monitor, but only garbage.
Speed is 115200. Is this correct? I also set the mode to DOUT

In Arduino I select “Generic ESP”

I am having issues to reflash too even though I managed last time.

Check your Arduino settings against this:

Describe the hangs too.

It works. Your wiring is wrong. On the photo the GREEN is not on GPIO0. Here’s the correct wiring.

Nevertheless… Thank you.

Next I try ESP_Easy. Be patient. :slight_smile:

Awesome.

Actually the first time I programmed it was with temp wires.

You are right! I didn’t realise I flipped the gpio0 second time around. Thanks!!!

I wonder if esp-easy is too big.

As an FYI I couldn’t flash esp-easy onto a sonoff S22 socket (my first device), some posts I came across seem to inidcate it’s because of an upgrade to the chip used, it needs to have the flashmode set to DOUT and the esp-easy packages are set to DIN? Apparently the 8285 packages did have DOUT set and worked, but I couldn’t get it to flash on mine after multiple attempts and hours wasted.
Note that this was over the course of the last few weeks, it may well have been rectified now, but I’ve since jumped ship to tasmota because I could actually get it to flash and work. esp-easy sounded, well, easier, but I guess I’m in the tasmota camp now.

The ESP-Easy guys told me to flash the pre-compiled bin file using DOUT.
I have not tried since I had it mis-wired one of the pins.

Success…

First I tried to flash with a flash-tool for LINUX, no success.

Then I made an OTA-Update from Tasmota with ESP_EASY.bin (Version 120, 1MB size), which is running now on the faked SONOFF.

After that I tried to make OTA-Update inside ESP_EASY to the latest version, no success

Tasmota, then using Tasmota to upload ESP_EASY.bin version 120 worked?
I think upload to latest ESP_EASY from ESP_EASY is impossible due to the high space needed since ESP v2.

Did you re-try Arduino build and upload of ESP_EASY directly?
Did you try the ESP8265 build instead? I think that is designed for lower memory.

I feel we are getting closer.

Cool.

By the way - did you try the DOUT mode when using the linux flash too?
What tool was it? esptool.py?

Thanks.

How did you get TASMOTA on it first? Arduino OR flash tool.

Tasmota I flashed with platformIO, but I think Arduino should also work.
The flashtool is a script for ESP_Easy https://www.letscontrolit.com/wiki/index.php/Flash_script_linux

To be honest; I’ll not spend more time in it, because Tasmota is working fine for me and ESP_Easy is overloaded for a relay-switch.

Yeah. My mind is same as yours but I want to document want we succeeded.

I flashed tasmora via Arduino so at least 2 methods worked.

I finally got the 1MB ESP-Easy to flash!!!

I finally got it to work.

I do not know why, but it seems I hard to start the flash within a short window of powering it on:

python esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dout -ff 20m 0x0 ESP_Easy_v2.0-20180116_normal_ESP8266_1024.bin 
esptool.py v2.3-dev
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 0x0322
Compressed 574976 bytes to 378527...
Wrote 574976 bytes (378527 compressed) at 0x00000000 in 33.5 seconds (effective 137.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...

When I tried to do it while taking my time, this always happened:

python esptool.py -p /dev/ttyUSB0 write_flash --flash_mode dout -ff 20m 0x0 ESP_Easy_v2.0-20180116_normal_ESP8266_1024.bin 
esptool.py v2.3-dev
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header