diff --git a/doc/HardwareElectrodragon.md b/doc/HardwareElectrodragon.md new file mode 100644 index 000000000..3f3a7f03e --- /dev/null +++ b/doc/HardwareElectrodragon.md @@ -0,0 +1,22 @@ +BrewPiLess can run on [Electrodragon SDPT board](https://www.electrodragon.com/product/wifi-iot-relay-board-spdt-based-esp8266/). It uses ESP-12F, so you can deploy full nodemcuv2. Schematic is [available here](https://www.electrodragon.com/w/ESP_Relay_Board_SPDT). + +For flashing, hold down btn2 before plugging in. + + +| ESP8266 GPIO | NodeMcu Label | Connect to | +| -------------- |:-------------:| :--------------------| +| GPIO5 | D1 | I2C SCL | +| GPIO4 | D2 | I2C SDA | +| GPIO0 | D3 | UP Button (BTN2) or flash | +| GPIO2 | D4 | DOWN Button (BTN1) | +| GPIO14 | D5 | Temperature Sensors * | +| GPIO12 | D6 | Cooling Actuator | +| GPIO13 | D7 | Heating Actuator | +| GPIO15 | D8 | Available | + +*IO14 is marked as DHT on the board. It already has 10k pull-up resistor soldered correctly. + +When configuring the devices, D6 and D7 should be configured as "Not inverted". + +*** +[Index](index.md) \ No newline at end of file diff --git a/doc/index.md b/doc/index.md index 70f85bc1a..d6d33826d 100644 --- a/doc/index.md +++ b/doc/index.md @@ -2,6 +2,7 @@ * [Example#1](HardwareExample1.md) * [SONOFF](HarddwareSONOFF.md) * [Thorrax’s Board](https://github.com/thorrak/brewpi-esp8266) + * [Electrodragon](HardwareElectrodragon.md) * [Localization of web frontend](LocalizationWebPage.md) * [Flash layout and New Frontend](FlashLayoutAndNewUI.md) * [Software Installation](SoftwareInstallation.md) diff --git a/platformio.ini b/platformio.ini index e5f2608fd..81d790132 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,8 +10,9 @@ [platformio] #sonoff OTA no longer supported -default_envs = classic, classic-spanish, classic-portuguese-br, classic-slovak, classic-tw, classic-it, newui, newui-tw, newui-spanish, newui-portuguese-br, newui-slovak, newui-oled, newui-it, thorrax, sonoff, sonoff-esp8285 , thorrax-classic, esp32, d1pro, d1pro-classic -;default_envs = esp8266dev + +default_envs = classic, classic-spanish, classic-portuguese-br, classic-slovak, classic-tw, classic-it, newui, newui-tw, newui-spanish, newui-portuguese-br, newui-slovak, newui-oled, newui-it, thorrax, sonoff, sonoff-esp8285 , thorrax-classic, esp32, d1pro, d1pro-classic, electrodragon, electrodragon-classic +#default_envs = esp8266dev [common_env_data] lib_deps_external = @@ -310,3 +311,23 @@ lib_deps = ${common_env_data.lib_deps_external_esp8266} #build_flags = -Wl,-Tesp8266.flash.1m64.ld -DBOARD=Sonoff -DNO_SPIFFS -DUseClassicFrontEnd=true #lib_deps = ${common_env_data.lib_deps_external_esp8266} + +[env:electrodragon] +board_build.flash_mode = dout +platform = espressif8266@~2.2.0 +board = nodemcuv2 +framework = arduino +lib_extra_dirs = ./lib-esp8266 +build_flags = -Wl,-Tesp8266.flash.4m2m.ld -DBOARD=Electrodragon_SPDT + +lib_deps = ${common_env_data.lib_deps_external_esp8266} + +[env:electrodragon-classic] +board_build.flash_mode = dout +platform = espressif8266@~2.2.0 +board = nodemcuv2 +framework = arduino +lib_extra_dirs = ./lib-esp8266 +build_flags = -Wl,-Tesp8266.flash.4m2m.ld -DBOARD=Electrodragon_SPDT -DUseClassicFrontEnd=true + +lib_deps = ${common_env_data.lib_deps_external_esp8266} \ No newline at end of file diff --git a/src/Config.h b/src/Config.h index be92c32bd..d8f53f1e1 100644 --- a/src/Config.h +++ b/src/Config.h @@ -286,6 +286,7 @@ #define BrewShield 0 #define Sonoff 1 #define Thorrak_PCB 2 +#define Electrodragon_SPDT 3 #ifndef BOARD #define BOARD BrewShield @@ -410,6 +411,25 @@ #define UpButtonPin NODEMCU_PIN_D3 #define DownButtonPin NODEMCU_PIN_D4 +#elif BOARD == Electrodragon_SPDT + +// builtin +#define coolingPin NODEMCU_PIN_D6 // IO12 - Relay1 - built-in +#define heatingPin NODEMCU_PIN_D7 // IO13 - Relay2 - built-in +#define UpButtonPin NODEMCU_PIN_D3 // IO0 - Btn2 - built-in +#define DownButtonPin NODEMCU_PIN_D4 // IO2 - Btn1 - built-in + +// IO14 (marked DHT sometimes) already has a pull-up resistor +#define oneWirePin NODEMCU_PIN_D5 // IO14 + +// usable pins on electrodragon - IO05, IO04, IO15 +// pins 9 and 10 should not be used +#define doorPin NODEMCU_PIN_D8 +#define BuzzPin 10 //not really available, for compiling purposes + + + + #else #error "unknown board" #endif