Skip to content

Commit 272ed8c

Browse files
committed
[Shelly1] Add first test build for Shelly1 nodes
[Shelly1 Open Source (ESP8266-2MB)](https://shelly.cloud/shelly1-open-source/) This is a preliminary test version as I have not yet received my ordered modules. Also there is a [feature request](esp8266/Arduino#5096 (comment)) out for adding proper flash layout for these 2M flash modules which allow proper OTA.
1 parent a9e473d commit 272ed8c

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

before_deploy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ for ENV in \
2121
dev_ESP8266PUYA_1024\
2222
dev_ESP8266PUYA_1024_VCC\
2323
hard_SONOFF_POW\
24+
hard_Shelly_1\
2425
esp32dev;\
2526
do
2627
echo

platformio.ini

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ platform = https://github.com/platformio/platform-espressif8266
6666
[core_esp32_0_12_0]
6767
6868

69-
[core_esp32_1_3_0]
70-
71-
7269
[core_esp32_1_2_0]
7370
7471

72+
[core_esp32_1_3_0]
73+
74+
7575
[core_esp32_stage]
7676
platform = https://github.com/platformio/platform-espressif32.git#feature/stage
7777

@@ -176,6 +176,12 @@ board = esp_wroom_02
176176
build_unflags = ${common.build_unflags}
177177
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld
178178

179+
[esp8266_2M]
180+
board_build.flash_mode = dio
181+
board_build.f_cpu = ${common.board_build.f_cpu}
182+
build_unflags = ${common.build_unflags}
183+
build_flags = ${common.build_flags} -Wl,-Tesp8266.flash.2m.ld
184+
179185
[esp8266_4M]
180186
board_build.flash_mode = dio
181187
board_build.f_cpu = ${common.board_build.f_cpu}
@@ -637,6 +643,25 @@ build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_POW_R2
637643
;build_unflags = ${Sonoff.build_unflags}
638644
;build_flags = ${Sonoff.build_flags} -D PLUGIN_SET_SONOFF_TOUCH
639645

646+
; Shelly1 Open Source (ESP8266-2MB)
647+
; https://shelly.cloud/shelly1-open-source/
648+
; GPIO04 Relay (non inverted)
649+
; GPIO05 Button
650+
[env:hard_Shelly_1]
651+
upload_speed = ${common.upload_speed}
652+
monitor_speed = ${common.monitor_speed}
653+
framework = ${common.framework}
654+
platform = ${common.platform}
655+
lib_deps = ${common.lib_deps}
656+
lib_ignore = ${common.lib_ignore}
657+
lib_ldf_mode = ${common.lib_ldf_mode}
658+
lib_archive = ${common.lib_archive}
659+
board_build.f_cpu = ${esp8266_2M.board_build.f_cpu}
660+
board_build.flash_mode = ${esp8266_2M.board_build.flash_mode}
661+
board = ${common.board}
662+
build_unflags = ${esp8266_2M.build_unflags}
663+
build_flags = ${esp8266_2M.build_flags} -D PLUGIN_SET_SHELLY_1
664+
640665

641666

642667
; LED Strips ; ****; ****; ****; ****; ****; ****;

src/define_plugin_sets.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ To create/register a plugin, you have to :
136136
#define PLUGIN_SET_ONLY_SWITCH
137137
#endif
138138

139+
// Shelly ----------------------------
140+
#ifdef PLUGIN_SET_SHELLY_1
141+
#define PLUGIN_SET_ONLY_SWITCH
142+
#define CONTROLLER_SET_STABLE
143+
#define NOTIFIER_SET_STABLE
144+
145+
#undef DEFAULT_PIN_I2C_SDA
146+
#undef DEFAULT_PIN_I2C_SCL
147+
#define DEFAULT_PIN_I2C_SDA 6 // GPIO4 conflicts with relay control.
148+
#define DEFAULT_PIN_I2C_SCL 7 // GPIO5 conflicts with SW input
149+
#endif
150+
139151
// Easy ----------------------------
140152
#ifdef PLUGIN_SET_EASY_TEMP
141153
#define PLUGIN_SET_ONLY_TEMP_HUM

0 commit comments

Comments
 (0)