From 2511b520b87ed40dd69b9af2e6d609ff18ae1b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 20 Aug 2017 01:08:43 +0200 Subject: [PATCH] Untested support for WiOn 50055 Wifi Wall Outlet & Tap --- code/build.sh | 1 + code/esp8266.flash.1m0.ld | 2 +- code/espurna/config/hardware.h | 27 +++++++++++++++++++++++++++ code/espurna/hardware.ino | 10 ++++++++++ code/platformio.ini | 21 +++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/code/build.sh b/code/build.sh index 661075cf..307a0ad6 100755 --- a/code/build.sh +++ b/code/build.sh @@ -18,6 +18,7 @@ ALL_ENVIRONMENTS=" aithinker-ai-light magichome-led-controller huacanxing-h801 + wion-50055 " if [ $# -eq 0 ]; then environments=$ALL_ENVIRONMENTS diff --git a/code/esp8266.flash.1m0.ld b/code/esp8266.flash.1m0.ld index 46a16e17..1f9b56a8 100644 --- a/code/esp8266.flash.1m0.ld +++ b/code/esp8266.flash.1m0.ld @@ -1,5 +1,5 @@ /* Flash Split for 1M chips */ -/* sketch 1004KB */ +/* sketch 999KB */ /* eeprom 20KB */ MEMORY diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index cd389e2e..f9ae9a42 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -758,6 +758,33 @@ #define LED1_PIN 16 #define LED1_PIN_INVERSE 0 +// ----------------------------------------------------------------------------- +// WiOn 50055 Indoor Wi-Fi Wall Outlet & Tap +// https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50050-Indoor-Wi-Fi-Outlet-Wireless-Switch-Programmable-Timer-%2F263112281551 +// https://rover.ebay.com/rover/1/711-53200-19255-0/1?icep_id=114&ipn=icep&toolid=20004&campid=5338044841&mpre=http%3A%2F%2Fwww.ebay.com%2Fitm%2FWiOn-50055-Indoor-Wi-Fi-Wall-Tap-Monitor-Energy-Usage-Wireless-Smart-Switch-%2F263020837777 +// ----------------------------------------------------------------------------- + +#elif defined(WION_50055) + + // Currently untested, does not support energy monitoring + + // Info + #define MANUFACTURER "WION" + #define DEVICE "50055" + + // Buttons + #define BUTTON1_PIN 13 + #define BUTTON1_RELAY 1 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + + // Relays + #define RELAY1_PIN 15 + #define RELAY1_PIN_INVERSE 0 + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 0 + // ----------------------------------------------------------------------------- // Unknown hardware // ----------------------------------------------------------------------------- diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index edb70108..4965d97e 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -400,6 +400,16 @@ void hwUpwardsCompatibility() { setSetting("relayGPIO", 1, 12); setSetting("relayLogic", 1, 0); + #elif defined(WION_50055) + + setSetting("board", 34); + setSetting("ledGPIO", 1, 2); + setSetting("ledLogic", 1, 0); + setSetting("btnGPIO", 1, 13); + setSetting("btnRelay", 1,1); + setSetting("relayGPIO", 1, 15); + setSetting("relayLogic", 1, 0); + #else #error "UNSUPPORTED HARDWARE!" diff --git a/code/platformio.ini b/code/platformio.ini index 04f67a64..10d7951b 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -651,3 +651,24 @@ build_flags = ${common.build_flags_1m} -DITEAD_BN_SZ01 upload_speed = 115200 upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 + +[env:wion-50055] +platform = espressif8266 +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} -DWION_50055 + +[env:wion-50055-ota] +platform = espressif8266 +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} -DWION_50055 +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266