Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:xoseperez/espurna into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xoseperez committed May 3, 2018
2 parents 0c18c3c + bd9a897 commit 3a1df3e
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
//#define HELTEC_TOUCHRELAY
//#define ZHILDE_EU44_W
//#define LUANI_HVIO
//#define ALLNET_ESP8266_UP

//--------------------------------------------------------------------------------
// Features (values below are non-default values)
Expand Down
33 changes: 33 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -1997,6 +1997,39 @@
#define LED1_PIN 1
#define LED1_PIN_INVERSE 1

// -----------------------------------------------------------------------------
// Allnet 4duino ESP8266-UP-Relais
// http://www.allnet.de/de/allnet-brand/produkte/neuheiten/p/allnet-4duino-iot-wlan-relais-unterputz-esp8266-up-relais/
// -----------------------------------------------------------------------------

#elif defined(ALLNET_ESP8266_UP)

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

// Relays
#define RELAY1_PIN 14
#define RELAY1_RESET_PIN 12
#define RELAY1_TYPE RELAY_TYPE_LATCHED

// LEDs
#define LED1_PIN 0
#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 BUTTON2_PIN 5
#define BUTTON2_MODE BUTTON_PUSHBUTTON


// -----------------------------------------------------------------------------
// Luani HVIO
// https://luani.de/projekte/esp8266-hvio/
Expand Down
7 changes: 7 additions & 0 deletions code/espurna/migrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,13 @@ void migrate() {
setSetting("relayGPIO", 1, 5);
setSetting("relayType", 1, RELAY_TYPE_NORMAL);

#elif defined(ALLNET_ESP8266_UP)

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

#else

// Allow users to define new settings without migration config
Expand Down
9 changes: 9 additions & 0 deletions code/espurna/telnet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ void _telnetData(unsigned char clientId, void *data, size_t len) {

// Capture close connection
char * p = (char *) data;

// C-d is sent as two bytes (sometimes repeating)
if (len >= 2) {
if ((p[0] == 0xFF) && (p[1] == 0xEC)) {
_telnetClients[clientId]->close(true);
return;
}
}

if ((strncmp(p, "close", 5) == 0) || (strncmp(p, "quit", 4) == 0)) {
_telnetClients[clientId]->close();
return;
Expand Down
24 changes: 24 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2104,3 +2104,27 @@ upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}

[env:allnet-esp8266-up-relay]
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
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}

[env:allnet-esp8266-up-relay-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
upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}

0 comments on commit 3a1df3e

Please sign in to comment.