From c65e60a825d2f34767e63fcf959bfd4cbc85c7ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 24 Oct 2017 11:30:34 +0200 Subject: [PATCH 1/2] Updated README --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b3fd2ac9..413e1564 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari ## Features +* *KRACK* vulnerability free * Support for **multiple ESP8266-based boards** ([check list](https://bitbucket.org/xoseperez/espurna/wiki/Hardware)) * Wifi **AP Mode** or **STA mode** * Up to 5 different networks can be defined @@ -35,7 +36,7 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari * [**Google Assistant**](http://tinkerman.cat/using-google-assistant-control-your-esp8266-devices/) integration using IFTTT and Webhooks (Google Home, Allo) * [**Domoticz**](https://domoticz.com/) integration via MQTT * [**Home Assistant**](https://home-assistant.io/) integration via MQTT - * Supports MQTT auto-discover feature + * Supports MQTT auto-discover feature (switches and lights) * [**InfluxDB**](https://www.influxdata.com/) integration via HTTP API * Support for different **sensors** * DHT11 / DHT22 / DHT21 / AM2301 (supports celsius & fahrenheit reporting) @@ -68,7 +69,7 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari * Change configuration * Run special commands * **Telnet support** - * Available only if connected to the AP interface + * Enable/disable via the web UI * Show debug info and allows to run terminal commands * **Unstable system check** * Detects unstable system (crashes on boot continuously) and defaults to a stable system @@ -103,8 +104,8 @@ Here is the list of supported hardware. For more information please refer to the |**IteadStudio Sonoff Touch**|**IteadStudio Sonoff T1**|| |![IteadStudio Slampher](images/devices/itead-slampher.jpg)|![AI-Thinker Wifi Light / Noduino OpenLight](images/devices/aithinker-ai-light.jpg)|![Itead Sonoff B1](images/devices/itead-sonoff-b1.jpg)| |**IteadStudio Slampher**|**AI-Thinker Wifi Light / Noduino OpenLight**|**IteadStudio Sonoff B1**| -|![MagicHome LED Controller](images/devices/magichome-led-controller.jpg)|![Huacanxing H801](images/devices/huacanxing-h801.jpg)|![Itead BN-SZ01](images/devices/itead-bn-sz01.jpg)| -|**MagicHome LED Controller**|**Huacanxing H801**|**Itead BN-SZ01**| +|![MagicHome LED Controller (1.0 and 2.0)](images/devices/magichome-led-controller.jpg)|![Huacanxing H801](images/devices/huacanxing-h801.jpg)|![Itead BN-SZ01](images/devices/itead-bn-sz01.jpg)| +|**MagicHome LED Controller (1.0 and 2.0)**|**Huacanxing H801**|**Itead BN-SZ01**| |![IteadStudio Sonoff SV](images/devices/itead-sonoff-sv.jpg)|![IteadStudio 1CH Inching](images/devices/itead-1ch-inching.jpg)|![IteadStudio Motor Clockwise/Anticlockwise](images/devices/itead-motor.jpg)| |**IteadStudio Sonoff SV**|**IteadStudio 1CH Inching**|**IteadStudio Motor Clockwise/Anticlockwise**| |![Wemos D1 Mini Relay Shield](images/devices/wemos-d1-mini-relayshield.jpg)|![Jan Goedeke Wifi Relay (NO/NC)](images/devices/jangoe-wifi-relay.png)|![Jorge García Wifi + Relays Board Kit](images/devices/jorgegarcia-wifi-relays.jpg)| @@ -112,6 +113,8 @@ Here is the list of supported hardware. For more information please refer to the |![EXS Wifi Relay v3.1](images/devices/exs-wifi-relay-v31.jpg)||| |**EXS Wifi Relay v3.1**||| +Other supported boards: Itead Sonoff LED, Huacanxing H802, WiOn 50055, ManCaveMade ESP-Live, InterMitTech QuinLED 2.6, Arilux AL-LC06, Xenon SM-PW702U, Authometion LYT8266. + ## License Copyright (C) 2016-2017 by Xose Pérez (@xoseperez) From 4b87ce223fc6bb01e30e48356c82afd54b26efc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 8 Nov 2017 18:47:29 +0100 Subject: [PATCH 2/2] Support for YJZK 2-gang switch --- code/espurna/config/general.h | 2 +- code/espurna/config/hardware.h | 34 ++++++++++++++++++++++++++++++++++ code/espurna/hardware.ino | 15 +++++++++++++++ code/platformio.ini | 23 +++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index d43e32e7..974c446a 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -246,7 +246,7 @@ PROGMEM const char* const custom_reset_string[] = { // All defined LEDs in the board can be managed through MQTT // except the first one when LED_AUTO is set to 1. -// If LED_AUTO is set to 1 the board will a defined LED to show wifi status. +// If LED_AUTO is set to 1 the board will use a defined LED to show wifi status. #define LED_AUTO 1 // LED # to use as WIFI status indicator diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 0a4d6cf2..eac36be8 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -602,6 +602,40 @@ #define LED1_PIN 13 #define LED1_PIN_INVERSE 1 + +// ----------------------------------------------------------------------------- +// YJZK +// ----------------------------------------------------------------------------- + +#elif defined(YJZK_SWITCH_2CH) + + // Info + #define MANUFACTURER "YJZK" + #define DEVICE "SWITCH_2CH" + + // Buttons + #define BUTTON1_PIN 0 + #define BUTTON2_PIN 9 + + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + + #define BUTTON1_RELAY 1 + #define BUTTON2_RELAY 2 + + // Relays + #define RELAY1_PIN 12 + #define RELAY2_PIN 5 + + #define RELAY1_TYPE RELAY_TYPE_NORMAL + #define RELAY2_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 13 + #define LED1_PIN_INVERSE 0 + #define LED_WIFI 0 + + // ----------------------------------------------------------------------------- // Electrodragon boards // ----------------------------------------------------------------------------- diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index f9c1b04a..b290deb6 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -566,6 +566,21 @@ void hwUpwardsCompatibility() { setSetting("myDCKIGPIO", 15); setSetting("relays", 1); + #elif defined(YJZK_SWITCH_2CH) + + setSetting("board", 47); + setSetting("ledGPIO", 1, 13); + setSetting("ledLogic", 1, 0); + setSetting("ledWifi", 0); + setSetting("btnGPIO", 1, 0); + setSetting("btnGPIO", 2, 9); + setSetting("btnRelay", 1, 1); + setSetting("btnRelay", 2, 2); + setSetting("relayGPIO", 1, 12); + setSetting("relayGPIO", 2, 5); + setSetting("relayType", 1, RELAY_TYPE_NORMAL); + setSetting("relayType", 2, RELAY_TYPE_NORMAL); + #else #error "UNSUPPORTED HARDWARE!" diff --git a/code/platformio.ini b/code/platformio.ini index 231ec307..886bf020 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1093,6 +1093,29 @@ upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 +[env:yjzk-switch-2ch] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DYJZK_SWITCH_2CH +monitor_baud = 115200 + +[env:yjzk-switch-2ch-ota] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DYJZK_SWITCH_2CH +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 + # ------------------------------------------------------------------------------ # GENERIC OTA ENVIRONMENTS # ------------------------------------------------------------------------------