Browse Source

Preliminary support for Sonoff B1

fastled
Xose Pérez 7 years ago
parent
commit
e97e8c46cb
3 changed files with 42 additions and 1 deletions
  1. +12
    -0
      code/espurna/config/hardware.h
  2. +8
    -0
      code/espurna/hardware.ino
  3. +22
    -1
      code/platformio.ini

+ 12
- 0
code/espurna/config/hardware.h View File

@ -277,6 +277,18 @@
#define DUMMY_RELAY_COUNT 6 #define DUMMY_RELAY_COUNT 6
#define TRACK_RELAY_STATUS 0 #define TRACK_RELAY_STATUS 0
#elif defined(SONOFF_B1)
#define MANUFACTURER "ITEAD"
#define DEVICE "SONOFF_B1"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
#define DUMMY_RELAY_COUNT 1
#define MY9291_DI_PIN 13
#define MY9291_DCKI_PIN 15
#define MY9291_COMMAND MY9291_COMMAND_DEFAULT
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Electrodragon boards // Electrodragon boards
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------


+ 8
- 0
code/espurna/hardware.ino View File

@ -314,6 +314,14 @@ void hwUpwardsCompatibility() {
setSetting("relayLogic", 4, 0); setSetting("relayLogic", 4, 0);
#endif #endif
#ifdef SONOFF_B1
setSetting("board", 28);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_MY9192);
setSetting("myDIGPIO", 12);
setSetting("myDCKIGPIO", 14);
#endif
saveSettings(); saveSettings();
} }

+ 22
- 1
code/platformio.ini View File

@ -1,4 +1,4 @@
4ch[platformio]
[platformio]
env_default = d1-debug env_default = d1-debug
src_dir = espurna src_dir = espurna
data_dir = espurna/data data_dir = espurna/data
@ -283,6 +283,27 @@ upload_speed = 115200
upload_port = "192.168.4.1" upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266 upload_flags = --auth=fibonacci --port 8266
[env:sonoff-b1-debug]
platform = espressif8266
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} -DSONOFF_B1
[env:sonoff-b1-debug-ota]
platform = espressif8266
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} -DSONOFF_B1
upload_speed = 115200
upload_port = "192.168.4.1"
upload_flags = --auth=fibonacci --port 8266
[env:rfbridge-debug] [env:rfbridge-debug]
platform = espressif8266 platform = espressif8266
framework = arduino framework = arduino


Loading…
Cancel
Save