N00b question: Flashing a Sonoff S20 outlet

I am new to Arduino, so please excuse my naivety.

I am in the process of deploying a Home Assistant-based home automation system. Based on various posts and suggestions, I decided to use ESP-8266 based Sonoff S20 WiFi outlets running custom firmware, specifically the KmanSonoff firmware. I read numerous sites and believe that I followed instructions properly, but I cannot flash the device. The error message I am getting is:

Build options changed, rebuilding all
Archiving built core (caching) in: C:\Users\Gerry\AppData\Local\Temp\arduino_cache_220198\core\core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_dio,UploadSpeed_115200,FlashSize_512K64,ResetMethod_ck,Debug_Disabled,DebugLevel_None_____1107ea9c19db07b2b555edee88bff85e.a
Sketch uses 254427 bytes (58%) of program storage space. Maximum is 434160 bytes.
Global variables use 34824 bytes (42%) of dynamic memory, leaving 47096 bytes for local variables. Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed

Let me walk you through what I have done and hopefully you can spot my mistake.

Step 1: I purchased a USB-to-serial device, the Sparkfun Serial Basic Breakout - CH340G. I then built a cable to connect the breakout device to the Sonoff S20, see image below.

Step 2: I tested the above by shorting the TX and RX pins and typing into a terminal window. This worked as expected.

Step 3: I soldered a header into the switch. This is a S20_US V1.3 and with this version, the PCB cannot be readily removed from the housing (I suspect one would have to desolder the AC connections to to this). The soldering job is not pretty, but I looked at each joint with my loupe and all appear to be okay. Note: I only had a five pin header floating around - the pin furthest from the button is cut-off.

Step 4: I plugged the Sonoff S20 into the programmer and plugged that into the computer. I observed the green LED flashing, which suggests that power/ground are correctly wired. I then unplugged it, held down the button, and plugged it back into the computer. I clicked Tools->Get Bard info and saw the following:

BN: Unknown board
VID: 1A86
PID: 7523
SN: Upload any sketch to obtain it

To me, this suggests that the devices are communicating. I also tried the Serial Monitor, but there was no response when I entered AT.

Step 5: I then confirmed the Arduino settings, see below, and clicked upload. The error messages were are shown above.

![|396x500](https://pairofdocs.net/sites/default/files/pictures/Arduino_ Settings.jpg)

At this point, I am stuck. Please suggest what I might try next. Thank you.

An update for those who may run into similar problems. It turns out that there were both hardware and configuration problems with my setup:

Hardware: For some reason that still baffles me, for this version of the Sonoff switch, the connection is Tx<->Tx and Rx<->Rx. This is completely bass-ackwards, but once the wires were flipped, I was able to communicate with the device.

It was also pointed out (thanks to KmanOz) that one needs to set the board as Generic ESP8285 module and the Flash Size as 1M(64K SPIFFS).