-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash -e | ||
|
||
# See: https://github.com/bareboat-necessities/bbn_esp32_gpio_sensors_hub | ||
|
||
usage() { | ||
echo "Usage: $0 -p ttyPort" | ||
echo -e "\t-p ttyPort of esp32 device ex: /dev/ttyACM1" | ||
exit 1 | ||
} | ||
|
||
while getopts "p:" opt | ||
do | ||
case "$opt" in | ||
p ) parameterP="$OPTARG" ;; | ||
? ) usage ;; | ||
esac | ||
done | ||
|
||
# Print helpFunction in case parameters are empty | ||
if [ -z "$parameterP" ] | ||
then | ||
echo "Option -p value is required"; | ||
usage | ||
fi | ||
|
||
m_dir=$(pwd) | ||
|
||
if [ -d /tmp/bbn_esp32_gpio_sensors_hub ]; then | ||
rm -rf /tmp/bbn_esp32_gpio_sensors_hub/ | ||
fi | ||
|
||
mkdir /tmp/bbn_esp32_gpio_sensors_hub && cd /tmp/bbn_esp32_gpio_sensors_hub | ||
|
||
wget https://github.com/bareboat-necessities/bbn_esp32_gpio_sensors_hub/releases/download/v0.0.1/bbn_esp32_gpio_sensors_hub_bin-2024-12-20.zip | ||
unzip bbn_esp32_gpio_sensors_hub_bin-2024-12-20.zip | ||
/srv/esphome/bin/esptool.py --chip esp32s3 \ | ||
--port "$parameterP" --baud 921600 \ | ||
--before default_reset --after hard_reset write_flash \ | ||
0x0 bbn_esp32_gpio_sensors_hub_firmware.bin | ||
|
||
cd "$m_dir" | ||
rm -rf /tmp/bbn_esp32_gpio_sensors_hub/ |