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 9, 2018
2 parents 6a12c02 + 9f90f77 commit 32ef595
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,15 @@ Here is the list of supported hardware. For more information please refer to the
|**Heltec Touch Relay**|**Generic Relay v4.0**|**Generic RGBLed v1.0**|
|![Generic DHT11 v1.0](images/devices/generic-dht11-10.jpg)|![Generic DS18B20 v1.0](images/devices/generic-ds18b20-10.jpg)||
|**Generic DHT11 v1.0**|**Generic DS18B20 v1.0**||
|![Tonbux Mosquito Killer](images/devices/tonbux-mosquito-killer.jpg)|||
|**Tonbux Mosquito Killer**|||

**Other supported boards:**
IteadStudio Sonoff S31, IteadStudio Sonoff POW R2, Zhilde ZLD-EU55-W, Luani HVIO

**Other supported boards (beta):**
KMC 4 Outlet, Gosund WS1, Smart Dual Plug, MakerFocus Intelligent Module LM33 for Lamps

## License

Copyright (C) 2016-2018 by Xose Pérez (@xoseperez)
Expand Down
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
//#define ZHILDE_EU44_W
//#define LUANI_HVIO
//#define ALLNET_4DUINO_IOT_WLAN_RELAIS
//#define TONBUX_MOSQUITO_KILLER

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

// -----------------------------------------------------------------------------
// Tonbux 50-100M Smart Mosquito Killer USB
// https://www.aliexpress.com/item/Original-Tonbux-50-100M-Smart-Mosquito-Killer-USB-Plug-No-Noise-Repellent-App-Smart-Module/32859330820.html
// -----------------------------------------------------------------------------

#elif defined(TONBUX_MOSQUITO_KILLER)

// Info
#define MANUFACTURER "TONBUX"
#define DEVICE "MOSQUITO_KILLER"

// Buttons
#define BUTTON1_PIN 2
#define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1

// Relays
#define RELAY1_PIN 5 // not a relay, fan
#define RELAY1_TYPE RELAY_TYPE_NORMAL

// LEDs
#define LED1_PIN 15 // blue led
#define LED1_PIN_INVERSE 1
#define LED1_MODE LED_MODE_WIFI
#define LED2_PIN 14 // red led
#define LED2_PIN_INVERSE 1
#define LED2_MODE LED_MODE_RELAY

#define LED3_PIN 12 // UV leds (1-2-3-4-5-6-7-8)
#define LED3_PIN_INVERSE 0
#define LED3_RELAY 1
#define LED4_PIN 16 // UV leds (9-10-11)
#define LED4_PIN_INVERSE 0
#define LED4_RELAY 1

// -----------------------------------------------------------------------------
// TEST boards (do not use!!)
// -----------------------------------------------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions code/espurna/migrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,22 @@ void migrate() {
setSetting("relayResetGPIO", 0, 12);
setSetting("relayType", 0, RELAY_TYPE_LATCHED);

#elif defined(TONBUX_MOSQUITO_KILLER)

setSetting("board", 74);
setSetting("ledGPIO", 0, 15);
setSetting("ledLogic", 0, 1);
setSetting("ledGPIO", 1, 14);
setSetting("ledLogic", 1, 1);
setSetting("ledGPIO", 2, 12);
setSetting("ledLogic", 2, 0);
setSetting("ledGPIO", 3, 16);
setSetting("ledLogic", 3, 0);
setSetting("btnGPIO", 0, 2);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 5);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);

#else

// Allow users to define new settings without migration config
Expand Down
24 changes: 24 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2128,3 +2128,27 @@ upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}

[env:tonbux-mosquito-killer]
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} -DTONBUX_MOSQUITO_KILLER
monitor_baud = 115200
extra_scripts = ${common.extra_scripts}

[env:tonbux-mosquito-killer-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} -DTONBUX_MOSQUITO_KILLER
upload_speed = 115200
upload_port = "${env.ESPURNA_IP}"
upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266
extra_scripts = ${common.extra_scripts}
Binary file added images/devices/tonbux-mosquito-killer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 32ef595

Please sign in to comment.