Home of the Squeezebox™ & Transporter® network music players.
Page 40 of 41 FirstFirst ... 3038394041 LastLast
Results 391 to 400 of 404
  1. #391
    Quote Originally Posted by sle118 View Post
    If anyone is familiar enough with bash, feel free to propose an approach (for example with sed).
    I'm fairly decent with Bash. What do you want, a piece of code that reads the partitions.csv file and outputs the flash commands/instructions for recovery flash and recover+squeezelite flash? Does it just need to edit the existing flash_cmd.txt file?

  2. #392
    Senior Member
    Join Date
    Dec 2009
    Location
    Quebec City, Canada
    Posts
    161
    Quote Originally Posted by thomaspreece10 View Post
    I'm fairly decent with Bash. What do you want, a piece of code that reads the partitions.csv file and outputs the flash commands/instructions for recovery flash and recover+squeezelite flash? Does it just need to edit the existing flash_cmd.txt file?
    The current Jenkins script merely calls make to get the command, which does not output the OTA partition address. So ideally, the script should generate the full flash command with the appropriate addresses scrubbed from the partitions. While we're there, I'm thinking that the script should generate a couple of command lines in both bash and DOS CMD file if possible. Something like this:

    Code:
    export port= YourPortNumberHere
    export baud=115200
    export PATH=$PATH:YourPathToTheTools
    Python esptool.py --the command line here
    Three idea is to get a command line that would allow when newcomers to flash with relative simplicity. I wish that at some point we could package an executable file with the binaries, but I have not yet had a chance to evaluate and choose options.

    Thank you for your offer!
    LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
    SqueezeAmp!

  3. #393
    Quote Originally Posted by sle118 View Post
    The current Jenkins script merely calls make to get the command, which does not output the OTA partition address. So ideally, the script should generate the full flash command with the appropriate addresses scrubbed from the partitions. While we're there, I'm thinking that the script should generate a couple of command lines in both bash and DOS CMD file if possible. Something like this:

    Code:
    export port= YourPortNumberHere
    export baud=115200
    export PATH=$PATH:YourPathToTheTools
    Python esptool.py --the command line here
    Three idea is to get a command line that would allow when newcomers to flash with relative simplicity. I wish that at some point we could package an executable file with the binaries, but I have not yet had a chance to evaluate and choose options.

    Thank you for your offer!
    It's crude but should do the job
    Writes a linux bash file, a windows bat file and a readme on how to use them. The scripts will need testing but should work.

    Code:
    #!/bin/bash
    
    # Location of partitions.csv relative to this script
    partitionsCsv="./partitions.csv"
    
    # File to output readme instructions to
    outputReadme="./flash_cmd.txt"
    
    # File to output bash script to
    outputBashScript="./writeSequeezeEsp.sh"
    
    # File to output bat script to
    outputBatScript="./writeSequeezeEsp.bat"
    
    # The name of partitions to ignore from partitions.csv
    paritionsToIgnore=(
      "nvs"
      "phy_init"
      "storage"
      "coredump"
    )
    
    # Function that maps partition name to actual bin file
    # defaults to "[PARTION_NAME_FROM_CSV].bin"
    function partitionNameToBinFile {
      if [[ "$1" == "otadata" ]]; then
        echo "ota_data_initial.bin"
      elif [[ "$1" == "ota_0" || "$1" == "factory" ]]; then
        echo "squeezelite.bin"
      else
        echo $1.bin
      fi
    }
    
    # write parameters for esptool.py
    writeParameters="$writeParameters write_flash"
    writeParameters="$writeParameters --flash_mode dio --flash_freq 80m --flash_size detect"
    
    # bootloader.bin and partitions.bin not in partitions.csv so manually add here
    partitionsParameters=" 0x1000 bootloader/bootloader.bin"
    partitionsParameters="$partitionsParameters 0x8000 partitions.bin"
    
    # ==============================================================================
    
    # Loop over partitions.csv and add partition bins and offsets to partitionsParameters
    {
      read;
      read;
      while read -r line
      do
          partitionName=$(echo $line | awk -F', ' '{printf "%s", $1}' | tr -d '"')
          partitionOffset=$(echo $line | awk -F', ' '{printf "%s", $4}' | tr -d '"')
          partitionFile=$(partitionNameToBinFile $partitionName)
    
          if [[ " ${paritionsToIgnore[@]} " =~ " ${partitionName} " ]]; then
              continue
          fi
    
          partitionsParameters="$partitionsParameters $partitionOffset $partitionFile"
      done
    } < $partitionsCsv
    
    # Write README Instructions
    if [ ! -f "$outputReadme" ]; then
      touch $outputReadme
    fi
    
    echo "" >> $outputReadme
    echo "====LINUX====" >> $outputReadme
    echo "To flash sequeezelite run the following script:" >> $outputReadme
    echo "$outputBashScript [PORT_HERE] [BAUD_RATE]" >> $outputReadme
    echo "e.g. $outputBashScript /dev/ttyUSB0 115200" >> $outputReadme
    echo "" >> $outputReadme
    echo "====WINDOWS====" >> $outputReadme
    echo "To flash sequeezelite run the following script:" >> $outputReadme
    echo "$outputBatScript [PORT_HERE] [BAUD_RATE]" >> $outputReadme
    echo "e.g. $outputBatScript COM11 115200" >> $outputReadme
    echo "" >> $outputReadme
    echo "If you don't know how to run the BAT file with arguments then you can" >> $outputReadme
    echo "edit the bat file in Notepad. Open the file up and edit the following:" >> $outputReadme
    echo "Change 'set port=%1' to 'set port=[PORT_HERE]'. E.g. 'set port=COM11'" >> $outputReadme
    echo "Change 'set baud=%2' to 'set baud=[BAUD_RATE]'. E.g. 'set baud=115200'" >> $outputReadme
    echo "" >> $outputReadme
    echo "====MANUAL====" >> $outputReadme
    echo "Python esptool.py --port [PORT_HERE] --baud [BAUD_RATE] $writeParameters $partitionsParameters" >> $outputReadme
    
    # Write Linux BASH File
    if [ ! -f "$outputBashScript" ]; then
      touch $outputBashScript
    fi
    
    echo "#!/bin/bash" >> $outputBashScript
    echo >> $outputBashScript
    echo "port=\$1" >> $outputBashScript
    echo "baud=\$2" >> $outputBashScript
    linuxFlashCommand="Python esptool.py --port \$port --baud \$baud"
    echo "$linuxFlashCommand $writeParameters $partitionsParameters" >> $outputBashScript
    
    # Write Windows BAT File
    if [ ! -f "$outputBatScript" ]; then
      touch $outputBatScript
    fi
    
    echo "echo off" >> $outputBatScript
    echo "" >> $outputBatScript
    echo "set port=%1" >> $outputBatScript
    echo "set baud=%2" >> $outputBatScript
    windowsFlashCommand="Python esptool.py --port %port% --baud %baud%"
    echo "$windowsFlashCommand $writeParameters $partitionsParameters" >> $outputBatScript
    On a side note, I'm trying to compile the new versions and am struggling as I think there is some extra flags that the new branch needs? Have you got the Jenkins script committed anywhere as I think seeing that would be a great help for me to understand what I need to pass to make to get it to build properly.
    Last edited by thomaspreece10; 2019-10-05 at 16:09.

  4. #394
    Quote Originally Posted by daduke View Post
    oh yes you can flash both recovery and SL binaries via serial if you pay attention to the address values (see partition table).
    So I flashed using `esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader/bootloader.bin 0x8000 partitions.bin 0xD000 ota_data_initial.bin 0x10000 recovery.bin 0x150000 squeezelite.bin` and after setting up wifi it still tells me it's in recovery mode, is this a bug?

    (Tried it with squeezelite-esp32-Over_The_Air_Update-I2S-4MFlash-v0.2.108 release)

  5. #395
    Member
    Join Date
    Apr 2013
    Location
    Zurich, CH
    Posts
    98
    Quote Originally Posted by thomaspreece10 View Post
    So I flashed using `esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader/bootloader.bin 0x8000 partitions.bin 0xD000 ota_data_initial.bin 0x10000 recovery.bin 0x150000 squeezelite.bin` and after setting up wifi it still tells me it's in recovery mode, is this a bug?

    (Tried it with squeezelite-esp32-Over_The_Air_Update-I2S-4MFlash-v0.2.108 release)
    you need to OTA flash squeezelite within recovery
    -----------------------------------------------
    1 x Touch, 2 x Radio, 2 x software player, LMS 7.9.0

  6. #396
    Senior Member
    Join Date
    Dec 2009
    Location
    Quebec City, Canada
    Posts
    161
    Quote Originally Posted by thomaspreece10 View Post
    So I flashed using `esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_mode dio --flash_freq 80m --flash_size detect 0x1000 bootloader/bootloader.bin 0x8000 partitions.bin 0xD000 ota_data_initial.bin 0x10000 recovery.bin 0x150000 squeezelite.bin` and after setting up wifi it still tells me it's in recovery mode, is this a bug?

    (Tried it with squeezelite-esp32-Over_The_Air_Update-I2S-4MFlash-v0.2.108 release)
    By default, the system will boot to recovery the first time. I'm going to have to think of a way to prevent this.

    For now, simply try rebooting from the system menu. The process should then locate the OTA partition, set it active and Boot from it. Watch console logs for messages.

    Also, below is the Jenkins snippet for building recovery vs squeezelite. We should update the readme on the nvs branch

    Code:
    export PROJECT_VER="${build_version_prefix}${BUILD_NUMBER}-IDF${esp_idf_version}-${config_target}"
    export PROJECT_NAME="recovery"
    make -j5 all EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1 -DSQUEEZELITE_ESP32_RELEASE_URL=\"https://github.com/sle118/squeezelite-esp32/releases\" '
    make print_flash_cmd EXTRA_CPPFLAGS="-DRECOVERY_APPLICATION=1" PROJECT_NAME="recovery.${config_target}">./build/flash_cmd.txt
    # now force a rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
    find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
    
    export PROJECT_NAME="squeezelite"
    make -j5 app EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=0 -DSQUEEZELITE_ESP32_RELEASE_URL=\"https://github.com/sle118/squeezelite-esp32/releases\" '
    LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
    SqueezeAmp!

  7. #397
    Senior Member
    Join Date
    Dec 2009
    Location
    Quebec City, Canada
    Posts
    161
    Quote Originally Posted by thomaspreece10 View Post
    On a side note, I'm trying to compile the new versions and am struggling as I think there is some extra flags that the new branch needs? Have you got the Jenkins script committed anywhere as I think seeing that would be a great help for me to understand what I need to pass to make to get it to build properly.
    I am traveling all week, so there will be some delays in my responses. I still haven't had a chance to implement your code in the Jenkins build system, but I'll try later tonight (PST).

    I have posted the following on Gitter. These are the command lines which I use right now to compile+flash recovery o

    Code:
    # switch to recovery compile+flash
    # force a rebuild of recovery specific files by touching all the files which may have a RECOVERY_APPLICATION compile logic
    find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
    export PROJECT_NAME="recovery"
    make -j5 all EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1 -DSQUEEZELITE_ESP32_RELEASE_URL=\"https://github.com/sle118/squeezelite-esp32/releases\" '
    python /opt/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port COM10 --baud 1152000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xd000 ./build/ota_data_initial.bin 0x1000 ./build/bootloader/bootloader.bin 0x10000 ./build/recovery.bin 0x8000 ./build/partitions.bin
    
    # switch to squeezelite compile+flash
    # now force a rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
    find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
    export PROJECT_NAME="squeezelite"
    make -j5 app EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=0 -DSQUEEZELITE_ESP32_RELEASE_URL=\"https://github.com/sle118/squeezelite-esp32/releases\" '
    python /opt/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port COM10 --baud 1152000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0x150000  ./build/squeezelite.bin
    LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
    SqueezeAmp!

  8. #398
    My ESP-A1S development board arrived today. It doesn't work out the box with SqueezeESP as the AC101 chip needs setting up but with some twiddling I've got it working . Will put in a PR soon.

  9. #399
    Senior Member
    Join Date
    Dec 2009
    Location
    Quebec City, Canada
    Posts
    161
    Quote Originally Posted by thomaspreece10 View Post
    My ESP-A1S development board arrived today. It doesn't work out the box with SqueezeESP as the AC101 chip needs setting up but with some twiddling I've got it working . Will put in a PR soon.
    Please check the build scripts folder and name sure you create a sdkconfile for the board. I will include it in the Jenkins build targets so you can OTA from GitHub.
    LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
    SqueezeAmp!

  10. #400
    Quote Originally Posted by thomaspreece10 View Post
    My ESP-A1S development board arrived today. It doesn't work out the box with SqueezeESP as the AC101 chip needs setting up but with some twiddling I've got it working . Will put in a PR soon.
    Is this your board?
    https://github.com/donny681/esp-adf/...2-lyrat-v4.rst

    as far as I found out this board has an es8388 codec on board
    https://community.hiveeyes.org/t/aud...r-modules/1183

    How is the quality of this chip compared to a UDA1334 module
    https://www.ebay.com/itm/CJMCU-1334-...wAAOSw19ddJJuk

    https://www.esp32.com/viewtopic.php?f=20&t=10811

    I can buy ESP32-A1S WiFi BT Audio Development Kit in my country for EUR 30

    But if the codec quality is not as good as the UDA1334 the I opt for a wrover & UDA1334 solution.
    Last edited by nietgiftig; 2019-10-10 at 06:26.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •