diff --git a/.github/workflows/update_ota_repo.yml b/.github/workflows/update_ota_repo.yml new file mode 100644 index 00000000..b3274911 --- /dev/null +++ b/.github/workflows/update_ota_repo.yml @@ -0,0 +1,72 @@ +name: Update OTA Repository + +on: + workflow_run: + workflows: ["build"] + branches: [develop] + types: + - completed + +jobs: + update-ota: + runs-on: ubuntu-latest + steps: + - name: Checkout OTA Updates Repository + uses: actions/checkout@v4 + with: + repository: 'doudar/OTAUpdates' + token: ${{ secrets.OTA_TOKEN }} # Use your secret token here + path: 'OTAUpdates' + + - name: Get Latest Release from SmartSpin2k + id: get-release + uses: actions/github-script@v7 + with: + script: | + const repo = { + owner: 'doudar', + repo: 'SmartSpin2k', + }; + const response = await github.rest.repos.getLatestRelease(repo); + const assets = response.data.assets.filter(asset => asset.name.includes('.bin.zip')); + if (assets.length === 0) { + core.setFailed('No .bin.zip assets found in the latest release.'); + return; // This stops the script execution if no assets are found + } + const url = assets[0].browser_download_url; + const tag_name = response.data.tag_name; + core.setOutput('url', url); + core.setOutput('tag_name', tag_name); + + - name: Download Artifacts + if: steps.get-release.outputs.url + run: | + curl -L "${{ steps.get-release.outputs.url }}" -o firmware.zip + mkdir firmware/ + unzip firmware.zip -d firmware + ls -R firmware # List files for diagnostics + + - name: Process Version and Files + run: | + VERSION_TAG="${{ steps.get-release.outputs.tag_name }}" + PROCESSED_VERSION="${VERSION_TAG%-*}" + echo $PROCESSED_VERSION > version.txt + ls + # Copy the .bin files directly as they are now confirmed to be in the 'firmware' directory + cp ./firmware/*.bin ./ + + # Ensure we're listing files here for a final check, remove in the final workflow + ls -la + working-directory: ./OTAUpdates + + - name: Commit and Push Updates to OTAUpdates Repository + uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: 'Update firmware and LittleFS with version ${{ steps.get-release.outputs.tag_name }}' + add: './*' + cwd: './OTAUpdates' + pull_strategy: 'NO-PULL' + push: true + env: + GITHUB_TOKEN: ${{ secrets.OTA_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 458edc6a..d9f657e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - added test for invalid Peloton data to keep stepper from running away without resistance information. - Fixed a bug with Trainer Day and rapid ERG sending. - Many updates and bug fixes which enable the Config App to communicate with SmartSpin2k. +- Scanned devices no longer saved to filesystem. The new scanning method would keep snowballing them otherwise. - increased MTU for android ### Hardware diff --git a/src/HTTP_Server_Basic.cpp b/src/HTTP_Server_Basic.cpp index 79f16ab1..e1a03f93 100644 --- a/src/HTTP_Server_Basic.cpp +++ b/src/HTTP_Server_Basic.cpp @@ -76,14 +76,13 @@ void startWifi() { // Couldn't connect to existing network, Create SoftAP if (WiFi.status() != WL_CONNECTED) { - String t_pass = DEFAULT_PASSWORD; - if (String(userConfig->getSsid()) == DEVICE_NAME) { + if (strcmp(userConfig->getSsid(), DEVICE_NAME) == 0) { // If default SSID is still in use, let the user // select a new password. // Else Fall Back to the default password (probably "password") - String t_pass = String(userConfig->getPassword()); - } - WiFi.softAP(userConfig->getDeviceName(), t_pass.c_str()); + WiFi.softAP(userConfig->getDeviceName(), userConfig->getPassword()); + }else{ + WiFi.softAP(userConfig->getDeviceName(), DEFAULT_PASSWORD);} vTaskDelay(50); myIP = WiFi.softAPIP(); /* Setup the DNS server redirecting all the domains to the apIP */ diff --git a/src/SmartSpin_parameters.cpp b/src/SmartSpin_parameters.cpp index d0b90fd0..51b10fef 100644 --- a/src/SmartSpin_parameters.cpp +++ b/src/SmartSpin_parameters.cpp @@ -142,7 +142,7 @@ void userParameters::saveToLittleFS() { doc["connectedPowerMeter"] = connectedPowerMeter; doc["connectedHeartMonitor"] = connectedHeartMonitor; doc["connectedRemote"] = connectedRemote; - doc["foundDevices"] = foundDevices; + //doc["foundDevices"] = foundDevices; doc["maxWatts"] = maxWatts; doc["minWatts"] = minWatts; doc["shifterDir"] = shifterDir; @@ -193,8 +193,10 @@ void userParameters::loadFromLittleFS() { setPassword(doc["password"]); setConnectedPowerMeter(doc["connectedPowerMeter"]); setConnectedHeartMonitor(doc["connectedHeartMonitor"]); - setFoundDevices(doc["foundDevices"]); - if (doc["ERGSensitivity"]) { // If statements to upgrade old versions of config.txt that didn't include these + //setFoundDevices(doc["foundDevices"]); + + // If statements to upgrade old versions of config.txt that didn't include these + if (doc["ERGSensitivity"]) { setERGSensitivity(doc["ERGSensitivity"]); } if (doc["maxWatts"]) {