Skip to content

Commit

Permalink
Changes to the ALLNET 4duino IoT WLAN relay
Browse files Browse the repository at this point in the history
  • Loading branch information
xoseperez committed May 3, 2018
1 parent 3a1df3e commit 9a41252
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
//#define HELTEC_TOUCHRELAY
//#define ZHILDE_EU44_W
//#define LUANI_HVIO
//#define ALLNET_ESP8266_UP
//#define ALLNET_4DUINO_IOT_WLAN_RELAIS

//--------------------------------------------------------------------------------
// Features (values below are non-default values)
Expand Down
29 changes: 19 additions & 10 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -2000,13 +2000,14 @@
// -----------------------------------------------------------------------------
// Allnet 4duino ESP8266-UP-Relais
// http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
// https://shop.allnet.de/fileadmin/transfer/products/148814.pdf
// -----------------------------------------------------------------------------

#elif defined(ALLNET_ESP8266_UP)
#elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)

// Info
#define MANUFACTURER "ALLNET"
#define DEVICE "ESP8266_UP_Relais"
#define DEVICE "4DUINO_IOT_WLAN_RELAIS"

// Relays
#define RELAY1_PIN 14
Expand All @@ -2018,16 +2019,24 @@
#define LED1_PIN_INVERSE 1

// Buttons
#define BUTTON1_PIN 4
#define BUTTON1_MODE BUTTON_PUSHBUTTON
#define BUTTON1_PRESS BUTTON_MODE_TOGGLE
#define BUTTON1_CLICK BUTTON_MODE_NONE
#define BUTTON1_DBLCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGCLICK BUTTON_MODE_NONE
#define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE
//#define BUTTON1_PIN 0
//#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH

#define BUTTON2_PIN 5
// Using pins labelled as SDA & SCL as buttons
#define BUTTON2_PIN 4
#define BUTTON2_MODE BUTTON_PUSHBUTTON
#define BUTTON2_PRESS BUTTON_MODE_TOGGLE
#define BUTTON2_CLICK BUTTON_MODE_NONE
#define BUTTON2_DBLCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGCLICK BUTTON_MODE_NONE
#define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE

#define BUTTON3_PIN 5
#define BUTTON3_MODE BUTTON_PUSHBUTTON

// Using pins labelled as SDA & SCL for I2C
//#define I2C_SDA_PIN 4
//#define I2C_SCL_PIN 5


// -----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions code/espurna/migrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,11 @@ void migrate() {
setSetting("relayGPIO", 1, 5);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);

#elif defined(ALLNET_ESP8266_UP)
#elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)

setSetting("board", 73);
setSetting("relayGPIO", 0, 14);
setSetting("relayResetGPIO", 1, 12);
setSetting("relayResetGPIO", 0, 12);
setSetting("relayType", 0, RELAY_TYPE_LATCHED);

#else
Expand Down
8 changes: 4 additions & 4 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2105,25 +2105,25 @@ upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}

[env:allnet-esp8266-up-relay]
[env:allnet-4duino-iot-wlan-relais]
platform = ${common.platform}
framework = arduino
board = esp12e
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DALLNET_ESP8266_UP
build_flags = ${common.build_flags_1m} -DALLNET_4DUINO_IOT_WLAN_RELAIS
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}

[env:allnet-esp8266-up-relay-ota]
[env:allnet-4duino-iot-wlan-relais-ota]
platform = ${common.platform}
framework = arduino
board = esp12e
board_flash_mode = dout
lib_deps = ${common.lib_deps}
lib_ignore = ${common.lib_ignore}
build_flags = ${common.build_flags_1m} -DALLNET_ESP8266_UP
build_flags = ${common.build_flags_1m} -DALLNET_4DUINO_IOT_WLAN_RELAIS
upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
Expand Down

0 comments on commit 9a41252

Please sign in to comment.