{"id":1015,"date":"2018-02-05T23:38:35","date_gmt":"2018-02-05T22:38:35","guid":{"rendered":"http:\/\/EvertDekker.com\/?p=1015"},"modified":"2022-12-31T14:55:56","modified_gmt":"2022-12-31T13:55:56","slug":"ewelink-touch-hack","status":"publish","type":"post","link":"https:\/\/evertdekker.com\/wp\/?p=1015","title":{"rendered":"EWelink touch hack"},"content":{"rendered":"<hr \/>\n<p>This time a hack on the EWelink wifi touch switch.<\/p>\n<p>The EWelink touch switch is a similar product as the Sonoff touch, but I find the look a bit nicer. It&#8217;s more streamlined and is also available with black front.<\/p>\n<p>The EWelink is sold in 1,2 and 3 gang version for the EU and US market.<br \/>\nI had only the 2 gang EU version, but it looks to me that the 1,2 and 3 gang EU version are the same. They left some parts out, but the pcb&#8217;s are all the same.<br \/>\nCan&#8217;t say anything about the US version, don&#8217;t have one to take apart.<br \/>\nThe hart of the EWelink touch switch is the PSF-B04 module. This module contains inside the well know ESP8285, that&#8217;s in fact an ESP8266 with build in 1M flash memory.<\/p>\n<p>Just like the hacks for the Sonoff products we need to connect Txd, Rxd, Vcc, Gnd and Gpio0 to the touch switch to make it possible to upload our own firmware.<br \/>\nBummer, EWelink didn&#8217;t provide us just like Sonoff with a header where most of the pins required are easy accessible.<br \/>\nTime to get the soldering iron and solder some header pins direct to the PSF-B04 module. Because you can&#8217;t and won&#8217;t program the touch pcb when it&#8217;s connected to the power pcb, you need to provide it also with 3.3V power.<br \/>\nFor the Gpio0 a simple wire will do the trick to get the ESP8285 in programming mode.<\/p>\n<p>Pin mapping:<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>Wifi Led<\/td>\n<td>Gpio-13<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"width: 259px;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 61.5px;\"><\/td>\n<td style=\"width: 88.5px;\">Touch input<\/td>\n<td style=\"width: 85px;\">Relay + led<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 61.5px;\">left<\/td>\n<td style=\"width: 88.5px;\">Gpio-0<\/td>\n<td style=\"width: 85px;\">Gpio-12<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 61.5px;\">middle<\/td>\n<td style=\"width: 88.5px;\">Gpio-10<\/td>\n<td style=\"width: 85px;\">Gpio-4<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 61.5px;\">right<\/td>\n<td style=\"width: 88.5px;\">Gpio-9<\/td>\n<td style=\"width: 85px;\">Gpio-5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The 1 gang uses the middle touch sensor, the 2 gang uses the left and right touch sensor and the 3 gang uses them all.<\/p>\n<p><strong>Note<\/strong>:It looks to me now that they place some resistors in other places for the 1,2 and 3 gang. Think they do that for example so touch1 is always connected\u00a0 to gpio0, but in the 1gang touch1 is in the middle and for the 2 gang the touch is at the left . Can&#8217;t verify this because I only have the 2 gang.<\/p>\n<p><b>Arduino ide settings:<\/b><br \/>\nGeneric Esp8285 Module<br \/>\nCPU Frequency: 80MHz<br \/>\nFlash Size: 1M (64K SPIFFS)<br \/>\nUpload Speed: 115200<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\"><strong>Important Note<\/strong><\/span>: As you can see in the last picture below they have placed a screw between the fase (L) and neutral (N) to hold the power pcb in place. The screw makes the isolation distance between the L and N to narrow. The minimum isolation distance requirement for 230V~ is 2.5mm and preferable\u00a0 &gt;3mm. With my Ewelink is was total 2.4mm, that&#8217;s not enough.<br \/>\nSimple solution, remove the screw, it doesn&#8217;t do anything. The power pcb can&#8217;t move because of the screw terminals and the other screws.<br \/>\n<strong>Do this all at your own risk<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"n2_ss_slider_publish__option_code\" dir=\"ltr\" data-mode=\"id\"><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This time a hack on the EWelink wifi touch switch. The EWelink touch switch is a similar product as the Sonoff touch, but I find the look a bit nicer. It&#8217;s more streamlined and is also available with black front. The EWelink is sold in 1,2 and 3 gang version for the EU and US [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128],"tags":[129,163,177,176,134],"class_list":["post-1015","post","type-post","status-publish","format-standard","hentry","category-esp8266","tag-esp8266","tag-esp8285","tag-ewelink","tag-psf-b04","tag-sonoff"],"_links":{"self":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1015"}],"version-history":[{"count":16,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1015\/revisions"}],"predecessor-version":[{"id":1678,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1015\/revisions\/1678"}],"wp:attachment":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}