Browse Source

Added hardware config for Avatto NAS-WR01W (#2113)

Not a match to same model from Neo Coolcam
mcspr-patch-1
Anders Blockmar 4 years ago
committed by Max Prokhorov
parent
commit
55a73b1c6e
4 changed files with 60 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +39
    -0
      code/espurna/config/hardware.h
  3. +10
    -0
      code/espurna/migrate.ino
  4. +10
    -0
      code/platformio.ini

+ 1
- 0
code/espurna/config/arduino.h View File

@ -21,6 +21,7 @@
//#define ARILUX_E27
//#define ARNIEX_SWIFITCH
//#define AUTHOMETION_LYT8266
//#define AVATTO_NAS_WR01W
//#define BESTEK_MRJ1011
//#define BH_ONOFRE
//#define BLITZWOLF_BWSHPX


+ 39
- 0
code/espurna/config/hardware.h View File

@ -2805,6 +2805,45 @@
#define LED4_PIN_INVERSE 0
#define LED4_RELAY 1
// -----------------------------------------------------------------------------
// Avatto NAS-WR01W Wifi Smart Power Plug
// https://www.aliexpress.com/item/33011753732.html
// https://todo...
// -----------------------------------------------------------------------------
#elif defined(AVATTO_NAS_WR01W)
// Info
#define MANUFACTURER "AVATTO"
#define DEVICE "NAS_WR01W"
// Buttons
#define BUTTON1_PIN 0
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// Relays
#define RELAY1_PIN 14
#define RELAY1_TYPE RELAY_TYPE_NORMAL
// LEDs
#define LED1_PIN 13
#define LED1_PIN_INVERSE 1
// HJL01 / BL0937
#ifndef HLW8012_SUPPORT
#define HLW8012_SUPPORT 1
#endif
#define HLW8012_SEL_PIN 12
#define HLW8012_CF1_PIN 5
#define HLW8012_CF_PIN 4
#define HLW8012_SEL_CURRENT LOW
#define HLW8012_CURRENT_RATIO 25740
#define HLW8012_VOLTAGE_RATIO 313400
#define HLW8012_POWER_RATIO 3414290
#define HLW8012_INTERRUPT_ON FALLING
// -----------------------------------------------------------------------------
// NEO Coolcam NAS-WR01W Wifi Smart Power Plug
// https://es.aliexpress.com/item/-/32854589733.html?spm=a219c.12010608.0.0.6d084e68xX0y5N


+ 10
- 0
code/espurna/migrate.ino View File

@ -964,6 +964,16 @@ void migrate() {
setSetting("relayGPIO", 0, 5);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#elif defined(AVATTO_NAS_WR01W)
setSetting("board", 75);
setSetting("ledGPIO", 0, 13);
setSetting("ledLogic", 0, 1);
setSetting("btnGPIO", 0, 0);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 14);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
#elif defined(NEO_COOLCAM_NAS_WR01W)
setSetting("board", 75);


+ 10
- 0
code/platformio.ini View File

@ -1212,6 +1212,16 @@ build_flags = ${common.build_flags_1m0m} -DLUANI_HVIO
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:avatto-power-plug-wifi]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DAVATTO_NAS_WR01W
[env:avatto-power-plug-wifi-ota]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DAVATTO_NAS_WR01W
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}
[env:neo-coolcam-power-plug-wifi]
board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DNEO_COOLCAM_NAS_WR01W


Loading…
Cancel
Save