diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c604f0..dbe8d10 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,7 @@ name: ESPSomfy-RTS Release on: release: - types: published + types: [published] env: ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json" @@ -62,14 +62,15 @@ jobs: retention-days: 5 - name: Upload LittleFS - uses: actions/upload-release-asset@v1.0.2 + uses: shogo82148/actions-upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_name: SomfyController.littlefs.bin - asset_path: build/SomfyController.ino.bin - asset_content_type: application/zip + asset_path: SomfyController.littlefs.bin + overwrite: true + asset_content_type: application/octet-stream arduino: @@ -173,26 +174,27 @@ jobs: 0x290000 SomfyController.littlefs.bin - name: Upload Firmware ${{ matrix.name }} - uses: actions/upload-release-asset@v1.0.2 + uses: shogo82148/actions-upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_name: ${{ matrix.fwname }} asset_path: build/SomfyController.ino.bin - asset_content_type: application/zip + asset_content_type: application/octet-stream - name: ${{ matrix.name }} Compress Onboard Image run: | zip ${{ matrix.obname }}.zip ./${{ matrix.obname }} - name: Upload Onboard ${{ matrix.name }} - uses: actions/upload-release-asset@v1.0.2 + uses: shogo82148/actions-upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_name: ${{ matrix.obname }}.zip asset_path: ${{ matrix.obname }}.zip + overwrite: true asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index 38d2b0a..793095b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ debug_custom.json esp32.vsd esp32s3.svd debug.cfg -SomfyController.ino.esp32s3.bin + diff --git a/ConfigSettings.h b/ConfigSettings.h index c619ef6..5b9e9a3 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v2.2.3" +#define FW_VERSION "v2.2.4" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/GitOTA.cpp b/GitOTA.cpp index 73d66fb..4a89760 100644 --- a/GitOTA.cpp +++ b/GitOTA.cpp @@ -34,7 +34,7 @@ void GitRelease::setReleaseProperty(const char *key, const char *val) { } void GitRelease::setAssetProperty(const char *key, const char *val) { if(strcmp(key, "name") == 0) { - Serial.println(val); + //Serial.println(val); if(strstr(val, "littlefs.bin")) this->hasFS = true; else if(strstr(val, "ino.esp32.bin")) { if(strlen(this->hwVersions)) strcat(this->hwVersions, ","); @@ -94,6 +94,7 @@ int16_t GitRepo::getReleases(uint8_t num) { main->main = true; strcpy(main->version.name, "main"); strcpy(main->name, "Main"); + strcpy(main->hwVersions, "32,s3"); if(https.begin(*client, url)) { int httpCode = https.GET(); Serial.printf("[HTTPS] GET... code: %d\n", httpCode); @@ -127,7 +128,7 @@ int16_t GitRepo::getReleases(uint8_t num) { if(arrTok == 2 && strcmp(jsonElem, "assets") == 0) { inElem = inValue = awaitValue = false; inAss = true; - Serial.printf("%s: %d\n", jsonElem, arrTok); + //Serial.printf("%s: %d\n", jsonElem, arrTok); } else if(arrTok < 2) inAss = false; } @@ -336,7 +337,24 @@ void GitUpdater::emitDownloadProgress(uint8_t num, size_t total, size_t loaded, sockEmit.loop(); webServer.loop(); } - +void GitUpdater::setFirmwareFile() { + esp_chip_info_t ci; + esp_chip_info(&ci); + switch(ci.model) { + case esp_chip_model_t::CHIP_ESP32S3: + strcpy(this->currentFile, "SomfyController.ino.esp32s3.bin"); + break; + case esp_chip_model_t::CHIP_ESP32S2: + strcpy(this->currentFile, "SomfyController.ino.esp32s2.bin"); + break; + case esp_chip_model_t::CHIP_ESP32C3: + strcpy(this->currentFile, "SomfyController.ino.esp32c3.bin"); + break; + default: + strcpy(this->currentFile, "SomfyController.ino.esp32.bin"); + break; + } +} bool GitUpdater::beginUpdate(const char *version) { Serial.println("Begin update called..."); @@ -345,7 +363,7 @@ bool GitUpdater::beginUpdate(const char *version) { strcpy(this->targetRelease, version); this->emitUpdateCheck(); - strcpy(this->currentFile, "SomfyController.ino.esp32.bin"); + this->setFirmwareFile(); this->partition = U_FLASH; this->cancelled = false; this->error = 0; diff --git a/GitOTA.h b/GitOTA.h index bb1b104..459a89d 100644 --- a/GitOTA.h +++ b/GitOTA.h @@ -51,6 +51,7 @@ class GitUpdater { bool beginUpdate(const char *release); bool endUpdate(); int8_t downloadFile(); + void setFirmwareFile(); void setCurrentRelease(GitRepo &repo); void loop(); void toJSON(JsonObject &obj); diff --git a/Somfy.cpp b/Somfy.cpp index 3d6fc7f..35c4fd6 100644 --- a/Somfy.cpp +++ b/Somfy.cpp @@ -1508,6 +1508,8 @@ void SomfyShade::unpublish(uint8_t id) { SomfyShade::unpublish(id, "tiltDirection"); SomfyShade::unpublish(id, "tiltPosition"); SomfyShade::unpublish(id, "tiltTarget"); + SomfyShade::unpublish(id, "windy"); + SomfyShade::unpublish(id, "sunny"); } } void SomfyGroup::unpublish(uint8_t id) { @@ -4157,6 +4159,43 @@ void transceiver_config_t::removeNVSKey(const char *key) { } } void transceiver_config_t::load() { + esp_chip_info_t ci; + esp_chip_info(&ci); + switch(ci.model) { + case esp_chip_model_t::CHIP_ESP32S3: + Serial.println("Setting S3 Transceiver Defaults..."); + this->TXPin = 15; + this->RXPin = 14; + this->MOSIPin = 11; + this->MISOPin = 13; + this->SCKPin = 12; + this->CSNPin = 10; + break; + case esp_chip_model_t::CHIP_ESP32S2: + this->TXPin = 15; + this->RXPin = 14; + this->MOSIPin = 35; + this->MISOPin = 37; + this->SCKPin = 36; + this->CSNPin = 34; + break; + case esp_chip_model_t::CHIP_ESP32C3: + this->TXPin = 13; + this->RXPin = 12; + this->MOSIPin = 16; + this->MISOPin = 17; + this->SCKPin = 15; + this->CSNPin = 14; + break; + default: + this->TXPin = 13; + this->RXPin = 12; + this->MOSIPin = 23; + this->MISOPin = 19; + this->SCKPin = 18; + this->CSNPin = 5; + break; + } pref.begin("CC1101"); this->type = pref.getUChar("type", 56); this->TXPin = pref.getUChar("TXPin", this->TXPin); diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index 86e76dd..260455b 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.ino.esp32s3.bin b/SomfyController.ino.esp32s3.bin new file mode 100644 index 0000000..0290fda Binary files /dev/null and b/SomfyController.ino.esp32s3.bin differ diff --git a/data/appversion b/data/appversion index 6b4d157..0476155 100644 --- a/data/appversion +++ b/data/appversion @@ -1 +1 @@ -2.2.3 \ No newline at end of file +2.2.4 \ No newline at end of file diff --git a/data/index.html b/data/index.html index 9806a7a..08a27c4 100644 --- a/data/index.html +++ b/data/index.html @@ -3,11 +3,11 @@
- - - + + + - +