mid dev savepoint

This commit is contained in:
2024-10-29 02:36:54 -06:00
parent 31bd4ca351
commit 112cefbe00
14 changed files with 83 additions and 20 deletions
+1
View File
@@ -0,0 +1 @@
test-scratch.sh
+6 -1
View File
@@ -1,3 +1,8 @@
# esp-idf custom installer/reinstaller
installs/reinstalls full esp-idf with my own additions on linux.
pulls from master so its the very latest
pulls from master so its the very latest
built for debian-like systems
`git clone https://github.com/PrincessPi3/esp-install-custom.git ~`
`bash ~/reinstall-esp-idf.sh`
+12 -11
View File
@@ -24,20 +24,21 @@ ttyselect=$devarr[(($tty+1))]
echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)"
read esp
ESPPORT="$ttyselect"
# ESPPORT="${ttyselect}"
echo "Setting environment variables"
echo "Adding Custom bins to PATH:"
export PATH=~/esp/.custom_bin:$PATH
echo "ESPPORT = $ESPPORT"
export ESPPORT
export ESPBAUD=921600
echo "ESPBAUD = $ESPBAUD"
export ESPTARGET=$esp
echo "ESPTARGET = $ESPTARGET"
echo "Adding Custom bins to PATH"
export PATH="${HOME}/esp/.custom_bin:${PATH}"
echo "ESPPORT = ${ESPPORT}"
export ESPPORT="${ttyselect}"
export ESPBAUD=460800
echo "Changing dir to ~/esp"
cd ~/esp
echo "ESPBAUD = ${ESPBAUD}"
export ESPTARGET=$esp
echo "ESPTARGET = ${ESPTARGET}"
echo "Changing dir to ${HOME}/esp"
cd "${HOME}/esp"
echo "\nAll done :3\n"
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
echo -e "\nChanging ESPBAUD\n"
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
baud=${baud:-$ESPBAUD}
echo "Select New Baudrate:\n\t1: 9600\n\t2: 115200\n\t3: 230400\n\t4: 460800\n\t5: 1152000\n\t6: 1500000"
read baud
if [ "${baud}" == 1 ]; then
selection=9600
elif [ "${baud}" == 2 ]; then
selection=115200
elif [ "${baud}" == 3 ]; then
selection=230400
elif [ "${baud}" == 4 ]; then
selection=460800
elif [ "${baud}" == 5 ]; then
selection=1152000
elif [ "${baud}" == 5 ]; then
selection=1152000
elif [ "${baud}" == 6 ]; then
selection=1500000
else
echo "\nBad Selection\n"
return
fi
export ESPBAUD=$selection
echo "\nAll done :3\n"
+8
View File
@@ -0,0 +1,8 @@
echo "\nChanging ESPTARGET\n"
echo "Set esp target (esp32, esp32s3, esp32c6, esp8266, etc)"
read esp
export ESPTARGET="${esp}"
echo "\nESPTARGET set to ${ESPTARGET}\n"
echo "\nall done :3\n"
+16
View File
@@ -0,0 +1,16 @@
echo "\nChanging ESPPORT\n"
echo "TTY devices found in dmesg:"
COUNTER=0
devarr=()
for line in $(dmesg | tail -50 | grep -o -E "tty[A-Z]{3}[0-9]{0,2}" | sort -u); do
echo "$COUNTER /dev/$line"
devarr+=("/dev/$line")
COUNTER=$((COUNTER+1))
done
echo "\nEnter TTY Number You'd Like:"
read tty
ttyselect=$devarr[(($tty+1))]
export ESPPORT="${ttyselect}"
echo "\nESPPORT set to ${ESPPORT}\n"
echo "\nall done :3\n"
+9 -8
View File
@@ -1,5 +1,4 @@
#!/bin/bash
set -e # exit on any error
runningDir="$( cd "$( dirname "$0" )" && pwd )"
@@ -18,6 +17,7 @@ idfDir="${installDir}/esp-idf"
echo -e "\nInstalling to ${installDir} esp-idf path will be ${idfDir}\n"
echo -e "\nCleaning up environment\n"
if ! [ -d $installDir ]; then
echo -e "\n${installDir} not found, creating\n"
mkdir $installDir
@@ -47,27 +47,28 @@ else
fi
echo -e "\nPlacing and enabeling custom bins\n"
cp -r "${runningDir}/.custom_bin" $installDir
chmod +x "${installDir}/.custom_bin/"*
cp -r "${runningDir}/custom_bin" "${installDir}/.custom_bin"
chmod -R +x "${installDir}/.custom_bin"
echo -e "\nPulling latest esp-idf code from github\n"
git clone --recursive --jobs 5 https://github.com/espressif/esp-idf.git $idfDir
echo -e "\nRunning install script\n"
bash "${idfDir}/install.sh all"
bash $idfDir/install.sh all
echo -e "\nInstalling optional tools\n"
python "${idfDir}/tools/idf_tools.py install all"
python $idfDir/tools/idf_tools.py install all
if ! [ -z $(alias | grep get_idf) ]; then
echo -e "\nget_idf alias not found, appending to ${HOME}/.zshrc\n"
echo "alias get_idf='. ${idfDir}export.sh'" >> ~/.zshrc
echo "alias get_idf='. ${idfDir}/export.sh'" >> "${HOME}/.zshrc"
else
echo -e "\nget_idf alias already installed, skipping\n"
fi
echo -e "\nMaking a backup of ${idfDir}/export.sh to
${idfDir}/export.sh.bak\n"
cp "${idfDir}/export.sh" "${idfDir}/export.sh.bak"
echo -e "\nEditing ${idfDir}/export.sh\n"
@@ -79,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"
datestamp=$(date +"%A, %B %-d %Y at %r %Z (epoch %s)")
commitHash=$(git -C "${idfDir} rev-parse HEAD")
gitBranch=$(git -C "${idfDir} rev-parse --abbrev-ref HEAD")
commitHash=$(git -C "${idfDir}" rev-parse 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"