User Tools

Site Tools


projects:sonoff-s20-esp8266-wifi-smart-socket

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

projects:sonoff-s20-esp8266-wifi-smart-socket [2017-09-30 21:20]
trinitor created
projects:sonoff-s20-esp8266-wifi-smart-socket [2017-11-21 19:34] (current)
trinitor
Line 1: Line 1:
 ====== Sonoff S20 ESP8266 WiFi Smart Socket ====== ====== Sonoff S20 ESP8266 WiFi Smart Socket ======
 +
 +|Description   |Switch power socket over  |
 +|Project Owner |Trinitor |
 +|Project Start |2017-09-31 |
 +|Status        |in progress |
  
 ===== Overview ===== ===== Overview =====
Line 31: Line 36:
     * {{https://github.com/arendst/arendst.github.io/raw/master/media/s20b.jpg}}     * {{https://github.com/arendst/arendst.github.io/raw/master/media/s20b.jpg}}
  
-===== Flash =====+===== Arduino IDE Config =====
  
-  * download ESPEasy +  * Preferences 
-    * https://github.com/letscontrolit/ESPEasy/releases +    * Additional Board Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json 
-  * pip install esptool +  * Tools -> Board -> Board Manager 
-  hold down the button and plugin the USB port = flash mode +    add esp8266
-  * esptool.py --port /dev/cu.usbserial-00000000 write_flash 0x000 ESPEasy_v2.0.0-dev12_normal_1024.bin -fs 8m+
  
-===== Network Config =====+===== Tasmota Firmware =====
  
-  * Connect to device AP+git clone https://github.com/arendst/Sonoff-Tasmota.git \\ 
-    * SSID: ESP_Easy_0 +edit settings in Sonoff-Tasmota/sonoff/user_config.h 
-    * password: configesp +<code> 
-  * browse to http://192.168.4.1 +#define STA_SSID1              "yourSSID1" 
-    * configure wireless LAN settings+#define STA_PASS1              "12345678" 
 +#define STA_SSID2              "yourSSID2" 
 +#define STA_PASS2              "12345678" 
 +#define SYS_LOG_HOST           "syslog" 
 +#define OTA_URL                "http://webserver:80/api/arduino/" PROJECT ".ino.bin" 
 +#define MQTT_HOST              "yourMQTTserver" 
 +#define MQTT_USER              "username" 
 +#define MQTT_PASS              "12345678" 
 +#define WEB_PASSWORD           "12345678" 
 +#define FRIENDLY_NAME          "power02" 
 +</code>
  
-===== Basic Config =====+===== ESP8266 Board config ====
  
-  * connect to normal /dev/base wifi +To gain as much code space as possible from the available 1M flash memory Tasmota provides a linker file without SPIFFS area 
-    * browse to http://192.168.11.+<code> 
-      * Config +cp Sonoff-S20-Tasmota/Sonoff-Tasmota/arduino/version\ 2.3.0/tools/sdk/ld/eagle.flash.1m0.ld ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/tools/sdk/ld 
-        * Unit Name: power01 +cp Sonoff-S20-Tasmota/Sonoff-Tasmota/arduino/version\ 2.3.0/boards.txt ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.3.0/boards.txt
-        * Admin Password: xxx +
-      * Hardware +
-        * Wifi Status Led: GPIO-13 (D7) +
-        * Pin mode (D3): Input +
-      * Devices +
-        * 1 +
-          * Device: Switch input +
-          * Name: Button +
-          * Enabled: Checked +
-          * Internal PullUp: Checked +
-          * 1st GPIO: GPIO-0 (D3) +
-          * Value 1: State +
-        * 2 +
-          * Device: Switch input +
-          * Name: Relay +
-          * Enabled: Checked +
-          * Internal PullUp: Unchecked +
-          * 1st GPIO: GPIO-12 (D6) +
-          * Value 1: State        +
-      * Tools +
-        * Advanced +
-          * Rules: Checked +
-      * Rules +
-        * Rule Set 1 +
-          * <code> +
-on Button#State=1 do +
-  if [Relay#State]=0 +
-    gpio,12,1 +
-  else +
-    gpio,12,0 +
-  endif +
-endon+
 </code> </code>
  
-===== Test ===== +===== Flash ===== 
- +  * Upload Using: Serial 
-  * press hardware button +  * Flash Mode: DOUT 
-  * curl "http://192.168.11.x/control?cmd=GPIO,12,1" +  * Flash Frequency40MHz 
-  * curl "http://192.168.11.x/control?cmd=GPIO,12,0"+  * CPU Frequency80MHz 
 +  * Flash Size: 1M (no SPIFFS) 
 +  * Debug Port: Disabled 
 +  * Debug Level: None 
 +  * Reset Method: ck 
 +  * Upload Speed: 115200 
 +  * Port: Your COM port connected to sonoff
  
projects/sonoff-s20-esp8266-wifi-smart-socket.1506806410.txt.gz · Last modified: 2017-09-30 21:20 by trinitor