This commit is contained in:
2024-10-29 04:16:50 -06:00
parent 112cefbe00
commit 69da723d3c
11 changed files with 70 additions and 75 deletions
Regular → Executable
View File
Regular → Executable
+25 -30
View File
@@ -1,31 +1,26 @@
#!/bin/bash echo "\nChanging ESPBAUD\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\n"
read -p baud
echo -e "\nChanging ESPBAUD\n" if [[ $baud == "1" ]]; then
read -p "Select New Baudrate:\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000\nDefault: ${ESPBAUD}" baud selection=9600
elif [[ $baud == "2" ]]; then
baud=${baud:-$ESPBAUD} selection=115200
elif [[ $baud == "3" ]]; then
echo "Select New Baudrate:\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000" selection=230400
read baud elif [[ $baud == "4" ]]; then
if [ "${baud}" == 1 ]; then selection=460800
selection=9600 elif [[ $baud == "5" ]]; then
elif [ "${baud}" == 2 ]; then selection=1152000
selection=115200 elif [[ $baud == "5" ]]; then
elif [ "${baud}" == 3 ]; then selection=1152000
selection=230400 elif [[ $baud == "6" ]]; then
elif [ "${baud}" == 4 ]; then selection=1500000
selection=460800 else
elif [ "${baud}" == 5 ]; then echo "\nBad Selection\n"
selection=1152000 return
elif [ "${baud}" == 5 ]; then fi
selection=1152000
elif [ "${baud}" == 6 ]; then echo "\n$selection\n"
selection=1500000
else export ESPBAUD=$selection
echo "\nBad Selection\n"
return
fi
export ESPBAUD=$selection
echo "\nAll done :3\n" echo "\nAll done :3\n"
Regular → Executable
+7 -7
View File
@@ -1,8 +1,8 @@
echo "\nChanging ESPTARGET\n" echo "\nChanging ESPTARGET\n"
echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)" echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)"
read esp read esp
export ESPTARGET="${esp}" export ESPTARGET="${esp}"
echo "\nESPTARGET set to ${ESPTARGET}\n" echo "\nESPTARGET set to ${ESPTARGET}\n"
echo "\nall done :3\n" echo "\nall done :3\n"
Regular → Executable
+15 -15
View File
@@ -1,16 +1,16 @@
echo "\nChanging ESPPORT\n" echo "\nChanging ESPPORT\n"
echo "TTY devices found in dmesg:" echo "TTY devices found in dmesg:"
COUNTER=0 COUNTER=0
devarr=() devarr=()
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
echo "$COUNTER /dev/$line" echo "$COUNTER /dev/$line"
devarr+=("/dev/$line") devarr+=("/dev/$line")
COUNTER=$((COUNTER+1)) COUNTER=$((COUNTER+1))
done done
echo "\nEnter TTY Number You'd Like:" echo "\nEnter TTY Number You'd Like:"
read tty read tty
ttyselect=$devarr[(($tty+1))] ttyselect=$devarr[(($tty+1))]
export ESPPORT="${ttyselect}" export ESPPORT="${ttyselect}"
echo "\nESPPORT set to ${ESPPORT}\n" echo "\nESPPORT set to ${ESPPORT}\n"
echo "\nall done :3\n" echo "\nall done :3\n"
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+23 -23
View File
@@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
runningDir="$( cd "$( dirname "$0" )" && pwd )"
echo -e "\n===== LFGGGGGGGG ======\n" echo -e "\n===== LFGGGGGGGG ======\n"
echo -e "\n"
read -p "Enter directory to install/reinstall to (default ${HOME}/esp):" installDir
installDir=${installDir:-$HOME/esp}
echo -e "\nInstalling prerequisites\n" echo -e "\nInstalling prerequisites\n"
sudo apt install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 sudo apt install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
echo -e "\n" runningDir="$( cd "$( dirname "$0" )" && pwd )"
read -p "Enter directory to install/reinstall to (default ${HOME}/esp):" installDir
installDir=${installDir:-$HOME/esp}
idfDir="${installDir}/esp-idf" idfDir="${installDir}/esp-idf"
espressifLocation="${HOME}/.espressif"
customBinLocation="${installDir}/.custom_bin"
customBinFrom="${runningDir}/custom_bin"
echo -e "\nInstalling to ${installDir} esp-idf path will be ${idfDir}\n" echo -e "\nInstalling to ${installDir} esp-idf path will be ${idfDir}\n"
echo -e "\nCleaning up environment\n" echo -e "\nCleaning up environment\n"
if ! [ -d $installDir ]; then if ! [ -d "${installDir}" ]; then
echo -e "\n${installDir} not found, creating\n" echo -e "\n${installDir} not found, creating\n"
mkdir $installDir mkdir "${installDir}"
else else
echo -e "\n${installDir} found, skipping delete\n" echo -e "\n${installDir} found, skipping delete\n"
fi fi
@@ -32,23 +32,23 @@ else
echo -e "\n${idfDir} not found, skipping delete\n" echo -e "\n${idfDir} not found, skipping delete\n"
fi fi
if [ -d "${HOME}/.espressif" ]; then if [ -d "${espressifLocation}" ]; then
echo -e "\n${HOME}/.espressif found, deleting\n" echo -e "\n${espressifLocation} found, deleting\n"
rm -rf "${HOME}/.espressif" rm -rf "${espressifLocation}"
else else
echo -e "\n${HOME} not found, skipping delete\n" echo -e "\n${espressifLocation} not found, skipping delete\n"
fi fi
if [ -d "${installDir}/.custom_bin" ]; then if [ -d "${customBinLocation}" ]; then
echo -e "\n${installDir}/.custom_bin found, deleting\n" echo -e "\n${customBinLocation} found, deleting\n"
rm -rf "${installDir}/.custom_bin" rm -rf "${customBinLocation}"
else else
echo -e "\n${installDir}/.custom_bin not found, skipping delete\n" echo -e "\n${customBinLocation} not found, skipping delete\n"
fi fi
echo -e "\nPlacing and enabeling custom bins\n" echo -e "\nPlacing and enabeling custom scripts at ${customBinLocation}\n"
cp -r "${runningDir}/custom_bin" "${installDir}/.custom_bin" cp -r "${customBinFrom}" "${customBinLocation}"
chmod -R +x "${installDir}/.custom_bin" chmod -R +x "${customBinLocation}"
echo -e "\nPulling latest esp-idf code from github\n" echo -e "\nPulling latest esp-idf code from github\n"
git clone --recursive --jobs 5 https://github.com/espressif/esp-idf.git $idfDir git clone --recursive --jobs 5 https://github.com/espressif/esp-idf.git $idfDir
@@ -80,8 +80,8 @@ cat "${runningDir}/add-to-export-sh.txt" >> "${idfDir}/export.sh"
echo -e "\nCreating version/commit and date file at ${idfDir}/version-date.txt\n" echo -e "\nCreating version/commit and date file at ${idfDir}/version-date.txt\n"
datestamp=$(date +"%A, %B %-d %Y at %r %Z (epoch %s)") datestamp=$(date +"%A, %B %-d %Y at %r %Z (epoch %s)")
commitHash=$(git -C "${idfDir}" rev-parse HEAD) commitHash=$(git -C $idfDir rev-parse HEAD)
gitBranch=$(git -C "${idfDir}" rev-parse --abbrev-ref HEAD) gitBranch=$(git -C $idfDir rev-parse --abbrev-ref HEAD)
echo -e "Installed at:\n\t${datestamp}\n\tat commit ${commitHash}\n\tfrom branch ${gitBranch}\n\tsource: https://github.com/espressif/esp-idf" > "${idfDir}/version-data.txt" echo -e "Installed at:\n\t${datestamp}\n\tat commit ${commitHash}\n\tfrom branch ${gitBranch}\n\tsource: https://github.com/espressif/esp-idf" > "${idfDir}/version-data.txt"