diff --git a/.github/workflows/compile_generics.yml b/.github/workflows/compile_all.yml similarity index 55% rename from .github/workflows/compile_generics.yml rename to .github/workflows/compile_all.yml index 7462a234..1b123cf9 100644 --- a/.github/workflows/compile_generics.yml +++ b/.github/workflows/compile_all.yml @@ -11,8 +11,6 @@ jobs: strategy: matrix: target: - # sd_spi_cs_pin: 23, sd_spi_clk_pin: 19, sd_spi_miso_pin: 20, sd_spi_mosi_pin: 18, gps_uart_rx_pin: 15, gps_uart_tx_pin: 14 - # Generic configurations (no LED, no screen support) - { name: "esp32-generic", idf_target: "esp32", sdkconfig_file: "configs/sdkconfig.default.esp32", zip_name: "esp32-generic.zip" } - { name: "esp32s2-generic", idf_target: "esp32s2", sdkconfig_file: "configs/sdkconfig.default.esp32s2", zip_name: "esp32s2-generic.zip"} - { name: "esp32s3-generic", idf_target: "esp32s3", sdkconfig_file: "configs/sdkconfig.default.esp32s3", zip_name: "esp32s3-generic.zip" } @@ -55,7 +53,6 @@ jobs: with: python-version: '3.9' - # Manual ESP-IDF Installation - name: Install ESP-IDF run: | sudo apt-get update @@ -70,93 +67,73 @@ jobs: - name: Set up ESP-IDF and Target run: | . ~/esp-idf/export.sh - echo "FLAPPY_GHOST_WEB_HOOK=${{ secrets.FLAPPY_GHOST_WEB_HOOK }}" >> $GITHUB_ENV - echo "IDF_TARGET=${{ matrix.target.idf_target }}" >> $GITHUB_ENV export IDF_TARGET=${{ matrix.target.idf_target }} - echo "IDF_TARGET is set to $IDF_TARGET" - - - name: Verify SDK Config Options - run: | - echo "Checking if configurations exist in sdkconfig.defaults" - grep -E "CONFIG_WITH_SCREEN|CONFIG_TFT_WIDTH|CONFIG_TFT_HEIGHT|CONFIG_USE_TOUCHSCREEN|CONFIG_USE_JOYSTICK|CONFIG_USE_CARDPUTER|CONFIG_IS_GHOST_BOARD|CONFIG_USE_7_INCHER|CONFIG_Waveshare_LCD|CONFIG_Crowtech_LCD|CONFIG_Sunton_LCD|CONFIG_USE_ILI9341_2" sdkconfig.defaults || echo "One or more options not found in sdkconfig.defaults" - - - name: Clean and Remove Previous SDK Config - run: | - # Remove any previously generated sdkconfig file to avoid conflicts - rm -f sdkconfig - . ~/esp-idf/export.sh - idf.py clean + echo "IDF_TARGET=${{ matrix.target.idf_target }}" >> $GITHUB_ENV - - name: Build Project with sdkconfig.defaults + - name: Clean and Build Project env: SDKCONFIG_DEFAULTS: "sdkconfig.defaults" run: | . ~/esp-idf/export.sh + idf.py clean idf.py build - - name: Verify SDK Config Options - run: | - echo "Checking if configurations exist in sdkconfig.defaults" - grep -E "CONFIG_WITH_SCREEN|CONFIG_TFT_WIDTH|CONFIG_TFT_HEIGHT|CONFIG_USE_TOUCHSCREEN|CONFIG_USE_JOYSTICK|CONFIG_USE_CARDPUTER|CONFIG_IS_GHOST_BOARD|CONFIG_USE_7_INCHER|CONFIG_Waveshare_LCD|CONFIG_Crowtech_LCD|CONFIG_Sunton_LCD|CONFIG_USE_ILI9341_2" sdkconfig.defaults || echo "One or more options not found in sdkconfig.defaults" - - - name: Download Correct Bootloader + - name: Download Bootloader run: | BOOTLOADER_URL="https://cdn.spookytools.com/bootloaders/${{ matrix.target.idf_target }}.bin" - BOOTLOADER_PATH="packaged_artifacts/bootloader.bin" - echo "Downloading bootloader from $BOOTLOADER_URL" - mkdir -p packaged_artifacts + BOOTLOADER_PATH="build/bootloader.bin" + echo "Downloading bootloader from $BOOTLOADER_URL..." curl -L -o "$BOOTLOADER_PATH" "$BOOTLOADER_URL" if [ ! -f "$BOOTLOADER_PATH" ]; then - echo "Error: Bootloader could not be downloaded from $BOOTLOADER_URL" + echo "Error: Bootloader could not be downloaded." exit 1 else - echo "Bootloader downloaded successfully to $BOOTLOADER_PATH" + echo "Bootloader downloaded successfully." fi - - name: Package Build Artifacts + - name: Package Artifacts into ZIP run: | - . ~/esp-idf/export.sh - PARTITION_TABLE_BIN=build/partition_table/partition-table.bin - GHOST_ESP_IDF_BIN=build/Ghost_ESP_IDF.bin - if [ ! -f "$PARTITION_TABLE_BIN" ]; then - echo "Error: $PARTITION_TABLE_BIN not found!" - exit 1 - fi - if [ ! -f "$GHOST_ESP_IDF_BIN" ]; then - echo "Error: $GHOST_ESP_IDF_BIN not found!" - exit 1 - fi - cp "$PARTITION_TABLE_BIN" packaged_artifacts/ - cp "$GHOST_ESP_IDF_BIN" packaged_artifacts/ - ZIP_NAME="${{ matrix.target.zip_name }}" - cd packaged_artifacts - zip "$ZIP_NAME" bootloader.bin partition-table.bin Ghost_ESP_IDF.bin + ARTIFACT_DIR="packaged_artifacts" + ZIP_FILE="${{ matrix.target.zip_name }}" + mkdir -p "$ARTIFACT_DIR" + cp build/partition_table/partition-table.bin "$ARTIFACT_DIR/" + cp build/*.bin "$ARTIFACT_DIR/" + echo "Packaging into zip: $ZIP_FILE" + cd "$ARTIFACT_DIR" + zip "../$ZIP_FILE" ./* cd .. + echo "Zip file $ZIP_FILE created." + ls -lh "$ZIP_FILE" - - name: Get the Latest Release ID (Including Pre-releases) - id: get_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - latest_release=$(curl -s \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/releases" | jq '[.[] | select(.draft == false)] | .[0]') - release_id=$(echo "$latest_release" | jq -r '.id') - echo "Latest release ID (including pre-releases) is $release_id" - echo "::set-output name=release_id::$release_id" + - name: Upload Build Artifacts to GitHub + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.target.zip_name }} + path: ${{ matrix.target.zip_name }} - - name: Upload to Latest Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + upload_all: + name: Upload All to Cloudflare R2 and GitHub Release + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download All Artifacts + uses: actions/download-artifact@v3 + with: + path: all_artifacts + + - name: Verify and Flatten Artifacts run: | - zip_file="packaged_artifacts/${{ matrix.target.zip_name }}" - release_id=${{ steps.get_release.outputs.release_id }} - curl -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Content-Type: application/zip" \ - --data-binary @"$zip_file" \ - "https://uploads.github.com/repos/${{ github.repository }}/releases/$release_id/assets?name=$(basename $zip_file)" + echo "Checking and flattening artifacts..." + mkdir -p flat_artifacts + if [ -d "all_artifacts" ] && [ "$(ls -A all_artifacts)" ]; then + find all_artifacts -type f -exec cp {} flat_artifacts/ \; + echo "Flattened artifacts:" + ls -lh flat_artifacts + else + echo "No artifacts found or directory is empty." + exit 1 + fi - name: Install rclone run: | @@ -168,21 +145,62 @@ jobs: R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }} run: | mkdir -p ~/.config/rclone - echo "[cloudflare_r2]" > ~/.config/rclone/rclone.conf - echo "type = s3" >> ~/.config/rclone/rclone.conf - echo "provider = Cloudflare" >> ~/.config/rclone/rclone.conf - echo "access_key_id = $R2_ACCESS_KEY" >> ~/.config/rclone/rclone.conf - echo "secret_access_key = $R2_SECRET_KEY" >> ~/.config/rclone/rclone.conf - echo "endpoint = https://fb5f7d31bedfe4f3538ddfa6db491962.r2.cloudflarestorage.com" >> ~/.config/rclone/rclone.conf - - - name: Upload Artifacts to Cloudflare R2 + cat < ~/.config/rclone/rclone.conf + [cloudflare_r2] + type = s3 + provider = Cloudflare + access_key_id = $R2_ACCESS_KEY + secret_access_key = $R2_SECRET_KEY + endpoint = https://fb5f7d31bedfe4f3538ddfa6db491962.r2.cloudflarestorage.com + EOF + + - name: Upload All Artifacts to Cloudflare R2 env: R2_BUCKET: "spooksapi" R2_PATH: "GhostESPBins" run: | - rclone copy "packaged_artifacts/${{ matrix.target.zip_name }}" "cloudflare_r2:${R2_BUCKET}/${R2_PATH}" --progress + echo "Uploading artifacts to Cloudflare R2..." + for file in flat_artifacts/*; do + if [ -f "$file" ]; then + echo "Uploading $file..." + rclone copy "$file" "cloudflare_r2:${R2_BUCKET}/${R2_PATH}" --progress --s3-no-check-bucket + else + echo "Skipping $file as it is not a valid file." + fi + done + echo "All artifacts uploaded successfully." - - name: Notify Discord of Successful Release + - name: Get the Latest Release ID (Including Pre-releases) + id: get_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + latest_release=$(curl -s \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/releases" | jq '[.[] | select(.draft == false)] | .[0]') + release_id=$(echo "$latest_release" | jq -r '.id') + echo "Latest release ID (including pre-releases) is $release_id" + echo "::set-output name=release_id::$release_id" + + - name: Upload Artifacts to Latest Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for file in flat_artifacts/*; do + if [ -f "$file" ] && [ -s "$file" ]; then + echo "Uploading $file to GitHub Release..." + curl -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Content-Type: application/zip" \ + --data-binary @"$file" \ + "https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.get_release.outputs.release_id }}/assets?name=$(basename $file)" + else + echo "Skipping $file as it is either empty or not a valid file." + fi + done + + - name: Notify Discord of Successful Upload if: success() env: DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} @@ -191,39 +209,16 @@ jobs: { "embeds": [ { - "title": "🎉 New Release for Ghost ESP!", - "description": "A new release for Ghost ESP has been successfully compiled and is now available! Check out the latest release for details.", - "url": "${{ github.server_url }}/${{ github.repository }}/releases/latest", + "title": "🎉 New Build Artifacts Uploaded!", + "description": "All build artifacts have been successfully uploaded to Cloudflare R2 and GitHub Release.", "color": 5814783, - "fields": [ - { - "name": "Repository", - "value": "${{ github.repository }}", - "inline": true - }, - { - "name": "Version", - "value": "${{ github.event.release.tag_name }}", - "inline": true - }, - { - "name": "Commit", - "value": "${{ github.sha }}", - "inline": true - } - ], - "footer": { - "text": "GitHub Actions Bot", - "icon_url": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" - }, "timestamp": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" } ] } EOF ) - curl -X POST \ -H "Content-Type: application/json" \ -d "$payload" \ - "$DISCORD_WEBHOOK_URL" + "$DISCORD_WEBHOOK_URL" \ No newline at end of file diff --git a/README.md b/README.md index af2ec909..974f3ae6 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,16 @@ Due to the **alpha** status, users should expect potential limitations, feature ## Getting Started -To install and configure Ghost ESP, follow our [Flashing Guide](https://github.com/Spooks4576/Ghost_ESP/blob/main/docs/HOWTOFLASH.md) for step-by-step instructions. Be sure to check for any known limitations specific to your ESP32 model before proceeding. +To install and configure Ghost ESP, follow our [Flashing Guide](https://github.com/Spooks4576/Ghost_ESP/wiki) for step-by-step instructions. Be sure to check for any known limitations specific to your ESP32 model before proceeding. + +Make sure to check out our discord [Discord](https://discord.gg/PkdjxqYKe4) + +## What Makes this different than ESP32 Marauder +This table should explain the key differences between ghost esp and ESP32 Marauder + +![Ghost_VS_Marauder](https://cdn.spookytools.com/assets/GhostESP_vs_Marauder_Comparison_Dark_Theme.png) + -[![Flashing Tutorial](https://img.shields.io/badge/Tutorial-Flashing-blue)](https://github.com/Spooks4576/Ghost_ESP/wiki) ## Special Acknowledgments diff --git a/configs/sdkconfig.ghostboard b/configs/sdkconfig.ghostboard index d5c65a55..320f630a 100644 --- a/configs/sdkconfig.ghostboard +++ b/configs/sdkconfig.ghostboard @@ -541,6 +541,77 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table +# +# Ghost ESP Options +# + +# +# LED Options +# +CONFIG_USE_NEOPIXEL=y +CONFIG_LED_DATA_PIN=10 +CONFIG_NUM_LEDS=3 +# end of LED Options + +# +# Display Options +# +# CONFIG_WITH_SCREEN is not set +# CONFIG_USE_TOUCHSCREEN is not set +# CONFIG_USE_JOYSTICK is not set +# CONFIG_USE_CARDPUTER is not set +# CONFIG_USE_7_INCHER is not set +# CONFIG_Waveshare_LCD is not set +# CONFIG_Crowtech_LCD is not set +# CONFIG_Sunton_LCD is not set +# CONFIG_USE_ILI9341_2 is not set +# end of Display Options + +# +# Ghost Board Config +# +CONFIG_IS_GHOST_BOARD=y +# CONFIG_GHOST_GPS_MODE is not set +# CONFIG_GHOST_MARAUDER_MODE is not set +# end of Ghost Board Config + +# +# GPS Configuration +# +CONFIG_HAS_GPS=y +CONFIG_GPS_UART_RX_PIN=2 +CONFIG_NMEA_PARSER_RING_BUFFER_SIZE=1024 +CONFIG_NMEA_PARSER_TASK_STACK_SIZE=3072 +CONFIG_NMEA_PARSER_TASK_PRIORITY=2 + +# +# NMEA Statement Support +# + +# +# At least one statement must be selected +# +CONFIG_NMEA_STATEMENT_GGA=y +CONFIG_NMEA_STATEMENT_GSA=y +CONFIG_NMEA_STATEMENT_GSV=y +CONFIG_NMEA_STATEMENT_RMC=y +CONFIG_NMEA_STATEMENT_GLL=y +CONFIG_NMEA_STATEMENT_VTG=y +# end of NMEA Statement Support +# end of GPS Configuration + +# +# SPI and MMC Configuration +# +CONFIG_USING_SPI=y +# CONFIG_USING_MMC is not set +CONFIG_SD_SPI_CS_PIN=23 +CONFIG_SD_SPI_CLK_PIN=19 +CONFIG_SD_SPI_MISO_PIN=20 +CONFIG_SD_SPI_MOSI_PIN=18 +# end of SPI and MMC Configuration +# end of Ghost ESP Options + # # Compiler options # @@ -1567,6 +1638,7 @@ CONFIG_LOG_DEFAULT_LEVEL_WARN=y # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set CONFIG_LOG_DEFAULT_LEVEL=2 CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set CONFIG_LOG_MAXIMUM_LEVEL=2 @@ -2143,58 +2215,6 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y # CONFIG_WIFI_PROV_STA_FAST_SCAN is not set # end of Wi-Fi Provisioning Manager -# -# Ghost ESP Options -# - -# -# LED Options -# -CONFIG_USE_NEOPIXEL=y -CONFIG_LED_DATA_PIN=10 -CONFIG_NUM_LEDS=3 -# end of LED Options - -# -# Display Options -# -# CONFIG_WITH_SCREEN is not set -# CONFIG_USE_TOUCHSCREEN is not set -# CONFIG_USE_JOYSTICK is not set -# CONFIG_USE_CARDPUTER is not set -# CONFIG_USE_7_INCHER is not set -# CONFIG_Waveshare_LCD is not set -# CONFIG_Crowtech_LCD is not set -# CONFIG_Sunton_LCD is not set -# CONFIG_USE_ILI9341_2 is not set -# end of Display Options - -# -# Ghost Board Config -# -CONFIG_IS_GHOST_BOARD=y -# CONFIG_GHOST_GPS_MODE is not set -# CONFIG_GHOST_MARAUDER_MODE is not set -# end of Ghost Board Config - -# -# GPS Configuration -# -# CONFIG_HAS_GPS is not set -# end of GPS Configuration - -# -# SPI and MMC Configuration -# -CONFIG_USING_SPI=y -# CONFIG_USING_MMC is not set -CONFIG_SD_SPI_CS_PIN=23 -CONFIG_SD_SPI_CLK_PIN=19 -CONFIG_SD_SPI_MISO_PIN=20 -CONFIG_SD_SPI_MOSI_PIN=18 -# end of SPI and MMC Configuration -# end of Ghost ESP Options - # # LVGL configuration # @@ -2641,8 +2661,8 @@ CONFIG_MDNS_PREDEF_NETIF_ETH=y # CONFIG_NO_BLOBS is not set # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set -# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set -CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +CONFIG_LOG_BOOTLOADER_LEVEL_WARN=y +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set CONFIG_LOG_BOOTLOADER_LEVEL=2 @@ -2827,4 +2847,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -# End of deprecated options \ No newline at end of file +# End of deprecated options