diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index e770fe20..ae43569b 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -84,6 +84,7 @@ //#define TONBUX_MOSQUITO_KILLER //#define NEO_COOLCAM_POWER_PLUG_WIFI //#define ESTINK_WIFI_POWER_STRIP +//#define PILOTAK_ESP_DIN_V1 //-------------------------------------------------------------------------------- // Features (values below are non-default values) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index e4594a17..d8361c4f 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1945,6 +1945,52 @@ #endif #define DALLAS_PIN 2 +// ----------------------------------------------------------------------------- +// ESP-DIN relay board V1 +// https://github.com/pilotak/esp_din +// ----------------------------------------------------------------------------- + +#elif defined(PILOTAK_ESP_DIN_V1) + + // Info + #define MANUFACTURER "PILOTAK" + #define DEVICE "ESP_DIN_V1" + + // Buttons + #define BUTTON1_PIN 0 + #define BUTTON1_RELAY 1 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + + // Relays + #define RELAY1_PIN 4 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + #define RELAY2_PIN 5 + #define RELAY2_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 15 + #define LED1_PIN_INVERSE 0 + + #define I2C_SDA_PIN 12 + #define I2C_SCL_PIN 13 + + #ifndef DALLAS_SUPPORT + #define DALLAS_SUPPORT 1 + #endif + #define DALLAS_PIN 2 + + #ifndef RF_SUPPORT + #define RF_SUPPORT 1 + #endif + #define RF_PIN 14 + + #ifndef DIGITAL_SUPPORT + #define DIGITAL_SUPPORT 1 + #endif + #define DIGITAL_PIN 16 + #define DIGITAL_PIN_MODE INPUT + // ----------------------------------------------------------------------------- // Heltec Touch Relay // https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180408043114&SearchText=esp8266+touch+relay diff --git a/code/espurna/migrate.ino b/code/espurna/migrate.ino index 5ea604b3..6ba12d6a 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -962,6 +962,18 @@ void migrate() { setSetting("btnRelay", 0, 0); setSetting("relayGPIO", 0, 12); setSetting("relayType", 0, RELAY_TYPE_NORMAL); + + #elif defined(PILOTAK_ESP_DIN_V1) + + setSetting("board", 76); + setSetting("ledGPIO", 0, 16); + setSetting("ledLogic", 0, 0); + setSetting("btnGPIO", 0, 0); + setSetting("btnRelay", 0, 0); + setSetting("relayGPIO", 0, 4); + setSetting("relayGPIO", 1, 5); + setSetting("relayType", 0, RELAY_TYPE_NORMAL); + setSetting("relayType", 1, RELAY_TYPE_NORMAL); #elif defined(ESTINK_WIFI_POWER_STRIP) diff --git a/code/platformio.ini b/code/platformio.ini index 384223a2..9fe2e893 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -2200,3 +2200,27 @@ upload_speed = 115200 upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 extra_scripts = ${common.extra_scripts} + +[env:pilotak-esp-din-v1] +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} -DPILOTAK_ESP_DIN_V1 +monitor_baud = 115200 +extra_scripts = ${common.extra_scripts} + +[env:pilotak-esp-din-v1-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} -DPILOTAK_ESP_DIN_V1 +upload_speed = 115200 +upload_port = "${env.ESPURNA_IP}" +upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 +extra_scripts = ${common.extra_scripts}