From 9d77948c2036d54c7a0a7a8700b70a475fc3d534 Mon Sep 17 00:00:00 2001 From: Mikhail Grushinskiy Date: Sat, 7 Dec 2024 10:11:42 -0500 Subject: [PATCH] upd --- m5stack-tools/bbn-flash-m5-wave.sh | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 m5stack-tools/bbn-flash-m5-wave.sh diff --git a/m5stack-tools/bbn-flash-m5-wave.sh b/m5stack-tools/bbn-flash-m5-wave.sh new file mode 100644 index 00000000..02c4acc7 --- /dev/null +++ b/m5stack-tools/bbn-flash-m5-wave.sh @@ -0,0 +1,42 @@ +#!/bin/bash -e + +# See: https://github.com/bareboat-necessities/bbn-wave-period-esp32 + +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-flash-m5-wave ]; then + rm -rf /tmp/bbn-flash-m5-wave/ +fi + +mkdir /tmp/bbn-flash-m5-wave && cd /tmp/bbn-flash-m5-wave + +wget https://github.com/bareboat-necessities/bbn-wave-period-esp32/releases/download/v0.9.9/bbn_wave_freq_m5atomS3_bin-2024-12-07.zip +unzip bbn_wave_freq_m5atomS3_bin-2024-12-07.zip +/srv/esphome/bin/esptool.py --chip esp32s3 \ + --port "$parameterP" --baud 921600 \ + --before default_reset --after hard_reset write_flash \ + 0x0 bbn_wave_freq_m5atomS3_firmware.bin + +cd "$m_dir" +rm -rf /tmp/bbn-flash-m5-wave/