Browse Source

Add support for LinkSprite R4 (#2042)

* Add LinkSprite R4 def

* Platformio.ini def for linksprite r4

* LINKSPRITE_LINKNODE_R4
master
mpcusack 5 years ago
committed by Max Prokhorov
parent
commit
9c5dc67320
4 changed files with 45 additions and 1 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +21
    -0
      code/espurna/config/hardware.h
  3. +13
    -1
      code/espurna/migrate.ino
  4. +10
    -0
      code/platformio.ini

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

@ -95,6 +95,7 @@
//#define JORGEGARCIA_WIFI_RELAYS //#define JORGEGARCIA_WIFI_RELAYS
//#define KMC_70011 //#define KMC_70011
//#define LINGAN_SWA1 //#define LINGAN_SWA1
//#define LINKSPRITE_LINKNODE_R4
//#define LITESUN_LA_WF3 //#define LITESUN_LA_WF3
//#define LOHAS_9W //#define LOHAS_9W
//#define LOMBEX_LUX_NOVA2_TUNABLE_WHITE //#define LOMBEX_LUX_NOVA2_TUNABLE_WHITE


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

@ -4167,6 +4167,27 @@
#define SENSOR_ENERGY_UNITS ENERGY_KWH #define SENSOR_ENERGY_UNITS ENERGY_KWH
#define SENSOR_POWER_UNITS POWER_WATTS #define SENSOR_POWER_UNITS POWER_WATTS
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Linksprite R4
// http://linksprite.com/wiki/index.php?title=LinkNode_R4:_Arduino-compatible_WiFi_relay_controller
// -----------------------------------------------------------------------------
#elif defined(LINKSPRITE_LINKNODE_R4)
// Info
#define MANUFACTURER "LINKSPRITE"
#define DEVICE "LINKNODE_R4"
// Relays
#define RELAY1_PIN 12
#define RELAY2_PIN 13
#define RELAY3_PIN 14
#define RELAY4_PIN 16
#define RELAY1_TYPE RELAY_TYPE_NORMAL
#define RELAY2_TYPE RELAY_TYPE_NORMAL
#define RELAY3_TYPE RELAY_TYPE_NORMAL
#define RELAY4_TYPE RELAY_TYPE_NORMAL
// -----------------------------------------------------------------------------
#else #else


+ 13
- 1
code/espurna/migrate.ino View File

@ -1387,9 +1387,21 @@ void migrate() {
setSetting("chLogic", 3, 0); setSetting("chLogic", 3, 0);
setSetting("relays", 1); setSetting("relays", 1);
#elif defined(LINKSPRITE_LINKNODE_R4)
setSetting("board", 104);
setSetting("relayGPIO", 0, 12);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);
setSetting("relayGPIO", 1, 13);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);
setSetting("relayGPIO", 2, 14);
setSetting("relayType", 2, RELAY_TYPE_NORMAL);
setSetting("relayGPIO", 3, 16);
setSetting("relayType", 4, RELAY_TYPE_NORMAL);
#elif defined(GENERIC_E14) #elif defined(GENERIC_E14)
setSetting("board", 103);
setSetting("board", 104);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT); setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER); setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("chGPIO", 0, 4); setSetting("chGPIO", 0, 4);


+ 10
- 0
code/platformio.ini View File

@ -1692,3 +1692,13 @@ board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DHYKKER_SMART_HOME_POWER_PLUG build_flags = ${common.build_flags_1m0m} -DHYKKER_SMART_HOME_POWER_PLUG
upload_port = ${common.ota_upload_port} upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags} upload_flags = ${common.ota_upload_flags}
[env:linksprite-linknode-r4]
board = ${common.board_4m}
build_flags = ${common.build_flags_4m1m} -DLINKSPRITE_LINKNODE_R4
[env:linksprite-linknode-r4-ota]
board = ${common.board_4m}
build_flags = ${common.build_flags_4m1m} -DLINKSPRITE_LINKNODE_R4
upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags}

Loading…
Cancel
Save