From 7aa39483de83336cf94dfe882e0c0edcf4a0e886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Tue, 2 Sep 2025 14:35:20 +0200 Subject: [PATCH] SP111 --- partitions.csv | 6 ++++++ platformio.ini | 18 +++++++++++++++++- src/io.cpp | 2 ++ src/io.h | 2 ++ src/main.cpp | 1 + src/wifi.cpp | 2 ++ upload.sh | 4 ++-- 7 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 partitions.csv diff --git a/partitions.csv b/partitions.csv new file mode 100644 index 0000000..c0618e6 --- /dev/null +++ b/partitions.csv @@ -0,0 +1,6 @@ +#Name,Type,SubType,Offset,Size,Flags +nvs,data,nvs,0x9000,0x4000, +otadata,data,ota,0xd000,0x2000, +app0,app,ota_0,0x10000,0x3C000, +app1,app,ota_1,,0x3C000, +spiffs,data,spiffs,,0x0E000, diff --git a/platformio.ini b/platformio.ini index 05275d3..d11a965 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,16 +32,32 @@ build.filesystem = ${common.build.filesystem} lib_deps = ${common.lib_deps} build_flags = -D Sonoff4ChPro -D ESP32_TESTBOARD -D CORE_DEBUG_LEVEL=0 -[env:GosundSP111] +[env:GosundSP111_USB] platform = ${common.platform} board = ${common.board} framework = ${common.framework} upload_speed = ${common.upload_speed} monitor_speed = ${common.monitor_speed} +board_build.partitions = partitions.csv +build.filesystem = ${common.build.filesystem} +lib_deps = ${common.lib_deps} +build_flags = -D GosundSP111 + +[env:GosundSP111_02] +platform = ${common.platform} +board = ${common.board} +framework = ${common.framework} +upload_speed = ${common.upload_speed} +monitor_speed = ${common.monitor_speed} +board_build.partitions = partitions.csv build.filesystem = ${common.build.filesystem} lib_deps = ${common.lib_deps} upload_port = 10.0.0.179 build_flags = -D GosundSP111 +; -Os +; -flto +; -fno-exceptions +; -fno-rtti [env:GosundSP111_ESP32] platform = espressif32 diff --git a/src/io.cpp b/src/io.cpp index e8838c4..e991708 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -11,6 +11,8 @@ Button button0(13, true, true, [](const ButtonEvent event) { buttonCallback(rela Relay relay0(0, "fallback/relay0", "RELAY #0", 15, false, true); +Output relay0Led("relay0Led", 2, STATUS_INVERT, false); + #endif #ifdef Sonoff4ChPro diff --git a/src/io.h b/src/io.h index ff6ace4..aa694e0 100644 --- a/src/io.h +++ b/src/io.h @@ -12,6 +12,8 @@ extern Button button0; extern Relay relay0; +extern Output relay0Led; + #ifdef Sonoff4ChPro extern Button button1; diff --git a/src/main.cpp b/src/main.cpp index 47a0c73..aa4ee81 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,4 +19,5 @@ void loop() { wifiLoop(); ioLoop(); ArduinoOTA.handle(); + relay0Led.set(relay0.get()); } diff --git a/src/wifi.cpp b/src/wifi.cpp index e7b75a5..c5d9d08 100644 --- a/src/wifi.cpp +++ b/src/wifi.cpp @@ -7,7 +7,9 @@ #define CONFIG_WIFI_SSID "/wifi/ssid" #define CONFIG_WIFI_PASSWORD "/wifi/password" +#ifndef DEFAULT_HOSTNAME #define DEFAULT_HOSTNAME "PatrixSonoff4ChPro" +#endif #define DEFAULT_WIFI_SSID "HappyNet" #define DEFAULT_WIFI_PASSWORD "1Grausame!Sackratte7" diff --git a/upload.sh b/upload.sh index 63d2314..e9c4792 100644 --- a/upload.sh +++ b/upload.sh @@ -10,5 +10,5 @@ minify index.html | sed 's|http://10.42.0.204||g' > index.html.min || exit 2 #curl -s 'http://10.0.0.178/upload/index' -F "file=@index.html.min" #curl -s 'http://10.0.0.178/upload/icon' -F "file=@icon.svg" -curl -s 'http://10.0.0.174/upload/index' -F "file=@index.html.min" -curl -s 'http://10.0.0.174/upload/icon' -F "file=@icon.svg" +curl -s 'http://10.0.0.179/upload/index' -F "file=@index.html.min" +curl -s 'http://10.0.0.179/upload/icon' -F "file=@icon.svg"