Kesen Wifi Switch (KS-601)
Contents
Introduction
The Kesen KS-601 WiFi Switch is a touch controlled switch similar to the Sonoff touch. It houses an ESP8285 micro controller. Here we show the two gang version but there also exist one and three gang switches.
Hardware
- ESP chip version: ESP8285
- Flash size: 1M
- Onboard USB-TTL converter: No
- GPIOs broken out/available to free use: None
- GPIOs tied to buttons: 0 (top), 9 (bottom)
- GPIOs tied to relays: 12 (connector L1), 5 (connector L2)
- GPIO tied to wifi status LED: 13
- Switch status LEDs directly connected to the relay GPIOs
- Up to 1800W@230V (according to manufacturer)
- Antenna: onboard PCB antenna
Flashing
The switch has no USB-TTL programmer integrated so you need one. It must to support 3.3V or it will fry your switch. The contact pads for the serial interface are located on the top side of the circuit board. While three of them are visible immediately, the RX pad hides itself below the upper plastic piece of the touch button. You can pull off the plastic piece gently. I left the sticker on the board, but I cut off a bit to be able to solder without hassle.
For flashing you also have to connect GPIO 0 to ground. The easiest location to solder a wire to it is the second top left pin of the IC located on the back side. Connect it like this to the programmer:
Programmer ESP TX <--> RX RX <--> TX Power 3.3V <--> 3.3V GND <--> GND + GPIO 0
For flashing it is the easiest method to use esptool.py (https://github.com/espressif/esptool) and following command. Replace /dev/ttyUSB0 and the ESP Easy image name with the values from you flasher/image file:
python esptool.py --port /dev/ttyUSB0 write_flash -fm dout -fs 1MB 0x0 ESP_Easy_v2.0-20180206_dev_ESP8285_1024.bin
Front
Back
ESP Easy
Devices
Status LED
Switch 1
Switch 2
Switch + event rule for touch0
on touch0#switch do if [touch0#switch]=1 gpio,12,1 else gpio,12,0 endif endon on switchon0 do gpio,12,1 inputswitchstate 0,1 endon on switchoff0 do gpio,12,0 inputswitchstate 0,0 endon
Switch + event rule for touch1
on touch1#switch do if [touch1#switch]=1 gpio,5,1 else gpio,5,0 endif endon on switchon1 do gpio,5,1 inputswitchstate 1,1 endon on switchoff1 do gpio,5,0 inputswitchstate 1,0 endon