From 9018077e9a2d86c23702fdc0aa4326694a552fd3 Mon Sep 17 00:00:00 2001
From: Pavel Slama
Date: Wed, 11 Apr 2018 22:08:06 +0200
Subject: [PATCH 1/3] new board ESP_DIN
---
code/espurna/config/arduino.h | 1 +
code/espurna/config/hardware.h | 40 ++++++++++++++++++++++++++++++++++
code/espurna/migrate.ino | 12 ++++++++++
code/platformio.ini | 24 ++++++++++++++++++++
4 files changed, 77 insertions(+)
diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h
index d995139a..64f50c71 100644
--- a/code/espurna/config/arduino.h
+++ b/code/espurna/config/arduino.h
@@ -77,6 +77,7 @@
//#define GENERIC_ESP01S_DHT11_V10
//#define GENERIC_ESP01S_DS18B20_V10
//#define HELTEC_TOUCHRELAY
+//#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 53f5a9c0..fec6e28a 100644
--- a/code/espurna/config/hardware.h
+++ b/code/espurna/config/hardware.h
@@ -1902,6 +1902,46 @@
#endif
#define DALLAS_PIN 2
+// -----------------------------------------------------------------------------
+// ESP-01S DS18B20 v1.0
+// 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 16
+ #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
+
// -----------------------------------------------------------------------------
// 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 104ca56d..1b6fd60a 100644
--- a/code/espurna/migrate.ino
+++ b/code/espurna/migrate.ino
@@ -888,6 +888,18 @@ void migrate() {
setSetting("board", 69);
+ #elif defined(PILOTAK_ESP_DIN_V1)
+
+ setSetting("board", 70);
+ 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);
+
#else
// Allow users to define new settings without migration config
diff --git a/code/platformio.ini b/code/platformio.ini
index a103cbaa..263a6f3a 100644
--- a/code/platformio.ini
+++ b/code/platformio.ini
@@ -1993,3 +1993,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}
From 466883729fec3597433ea49ebed87c6579753a84 Mon Sep 17 00:00:00 2001
From: Pavel Slama
Date: Wed, 11 Apr 2018 22:11:34 +0200
Subject: [PATCH 2/3] desc correction
---
code/espurna/config/hardware.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h
index fec6e28a..57d2d9a5 100644
--- a/code/espurna/config/hardware.h
+++ b/code/espurna/config/hardware.h
@@ -1903,7 +1903,7 @@
#define DALLAS_PIN 2
// -----------------------------------------------------------------------------
-// ESP-01S DS18B20 v1.0
+// ESP-DIN relay board V1
// https://github.com/pilotak/esp_din
// -----------------------------------------------------------------------------
From c663e6ff2949493cdf4df5a102e2a2df90a8de49 Mon Sep 17 00:00:00 2001
From: Pavel Slama
Date: Wed, 16 May 2018 16:33:54 +0200
Subject: [PATCH 3/3] v1.1 update
---
code/espurna/config/hardware.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h
index 5069215c..5954ca2d 100644
--- a/code/espurna/config/hardware.h
+++ b/code/espurna/config/hardware.h
@@ -1965,7 +1965,7 @@
#define RELAY2_TYPE RELAY_TYPE_NORMAL
// LEDs
- #define LED1_PIN 16
+ #define LED1_PIN 15
#define LED1_PIN_INVERSE 0
#define I2C_SDA_PIN 12
@@ -1981,6 +1981,12 @@
#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