diff --git a/01_download_factorytest.sh b/01_download_factorytest.sh new file mode 100644 index 0000000..809644d --- /dev/null +++ b/01_download_factorytest.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +bindir=FactoryTest/build/esp32.esp32.m5stack_stickc_plus2 +mkdir -p "$bindir" +baseurl="https://cit.istlab.info/f/FactoryTest.ino." + +echo "Downloading FactoryTest firmware files..." +for ext in bin bootloader.bin partitions.bin; do + url="${baseurl}${ext}" + echo "Downloading $url ..." + curl -L -o "$bindir/FactoryTest.${ext}" "$url" + if [ $? -ne 0 ]; then + echo "Failed to download $url" + exit 1 + fi +done + diff --git a/01_install_cli.sh b/01_install_cli.sh deleted file mode 100755 index 4eef263..0000000 --- a/01_install_cli.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -cd - -# git update-git-for-windows - -# if type -p arduino-cli >/dev/null; then -# echo "arduino-cli is installed." -# sleep 1 -# else -# install (or upgrade) arduino-cli - curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh -# fi - -arduino-cli update -arduino-cli upgrade -arduino-cli version - -# download m5scp2_exp (by miura) -if [ -d "m5scp2_exp" ]; then - echo "m5scp2_exp folder exists." - cd m5scp2_exp - git pull - ls -al - cd .. -else - git clone https://git.istlab.info/git/miura250/m5scp2_exp.git -fi diff --git a/02_install_cli_lib.sh b/02_install_cli_lib.sh deleted file mode 100755 index a1a3af6..0000000 --- a/02_install_cli_lib.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -arduino-cli update -arduino-cli upgrade -arduino-cli lib install M5Unified -arduino-cli core install esp32:esp32 -# arduino-cli core install esp32:esp32@2.0.17 --config-file arduino-cli.yaml - -# Optional for IRsend samples -arduino-cli lib install IRremoteESP8266 -arduino-cli lib install WiFi HttpClient -arduino-cli lib install Regexp Dictionary -arduino-cli lib install ArduinoJson -#arduino-cli lib install WiFiMulti_Generic -arduino-cli lib install "Adafruit SHT31 Library" -arduino-cli lib install "Adafruit BMP280 Library" -# arduino-cli lib install M5StickCPlus2 # M5Unified を使うので不要 - -## You can find other libraries as follows. -# arduino-cli lib search [keyword] -## if you get too much candidates, use grep to filter -# arduino-cli lib search [keyword] | grep -e "^Name" - -# Finally, just show board list -# 確認 -arduino-cli board listall | grep StickCPlus -arduino-cli core list - -echo "(for Windows user) 書き込みは主にUSBで行いますので、ネットワークアクセスの許可は、しなくてもよいです。" -echo "(for Windows user) Acceptance of Network setting is not mandatory." - diff --git a/03_compile_factorytest.sh b/03_compile_factorytest.sh deleted file mode 100755 index a8d322a..0000000 --- a/03_compile_factorytest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# arduino-cli compile -help -arduino-cli compile -b esp32:esp32:m5stack_stickc_plus2 -v -e FactoryTest - diff --git a/04_upload_factorytest.sh b/04_upload_factorytest.sh deleted file mode 100755 index f121116..0000000 --- a/04_upload_factorytest.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -echo "Finding serial ports..." -## get serial port via board list, choose lines including "USB", and pick up 1st word -serials=`arduino-cli board list | grep USB | awk '{print $1}'` - -# echo ${serials} -if [ -z "${serials}" ]; then - echo "No device connected." - echo "デバイスを接続しているのに認識しないときは、ドライバを入れてください。" - echo "https://ftdichip.com/drivers/vcp-drivers/ → Click here to download の hereをおす。ZIP解凍して実行。" - exit -fi - -## if multiple ports found, try uploading to all ports. -seriallist=($serials) - -## print the list -# echo ${seriallist[@]} - -for ser in ${seriallist[@]} ; do - echo ${ser} -# arduino-cli upload --fqbn esp32:esp32:m5stick-c -p ${ser} -v FactoryTest - arduino-cli upload --fqbn esp32:esp32:m5stack_stickc_plus2 -p ${ser} -v FactoryTest -done - - -if [[ "${#seriallist[@]}" -eq 1 ]]; then - arduino-cli monitor -p ${seriallist[0]} --config 115200 -fi - diff --git a/91_install_cli.sh b/91_install_cli.sh new file mode 100755 index 0000000..4eef263 --- /dev/null +++ b/91_install_cli.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +cd + +# git update-git-for-windows + +# if type -p arduino-cli >/dev/null; then +# echo "arduino-cli is installed." +# sleep 1 +# else +# install (or upgrade) arduino-cli + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh +# fi + +arduino-cli update +arduino-cli upgrade +arduino-cli version + +# download m5scp2_exp (by miura) +if [ -d "m5scp2_exp" ]; then + echo "m5scp2_exp folder exists." + cd m5scp2_exp + git pull + ls -al + cd .. +else + git clone https://git.istlab.info/git/miura250/m5scp2_exp.git +fi diff --git a/92_install_cli_lib.sh b/92_install_cli_lib.sh new file mode 100755 index 0000000..a1a3af6 --- /dev/null +++ b/92_install_cli_lib.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +arduino-cli update +arduino-cli upgrade +arduino-cli lib install M5Unified +arduino-cli core install esp32:esp32 +# arduino-cli core install esp32:esp32@2.0.17 --config-file arduino-cli.yaml + +# Optional for IRsend samples +arduino-cli lib install IRremoteESP8266 +arduino-cli lib install WiFi HttpClient +arduino-cli lib install Regexp Dictionary +arduino-cli lib install ArduinoJson +#arduino-cli lib install WiFiMulti_Generic +arduino-cli lib install "Adafruit SHT31 Library" +arduino-cli lib install "Adafruit BMP280 Library" +# arduino-cli lib install M5StickCPlus2 # M5Unified を使うので不要 + +## You can find other libraries as follows. +# arduino-cli lib search [keyword] +## if you get too much candidates, use grep to filter +# arduino-cli lib search [keyword] | grep -e "^Name" + +# Finally, just show board list +# 確認 +arduino-cli board listall | grep StickCPlus +arduino-cli core list + +echo "(for Windows user) 書き込みは主にUSBで行いますので、ネットワークアクセスの許可は、しなくてもよいです。" +echo "(for Windows user) Acceptance of Network setting is not mandatory." + diff --git a/93_compile_factorytest.sh b/93_compile_factorytest.sh new file mode 100755 index 0000000..a8d322a --- /dev/null +++ b/93_compile_factorytest.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# arduino-cli compile -help +arduino-cli compile -b esp32:esp32:m5stack_stickc_plus2 -v -e FactoryTest + diff --git a/94_upload_factorytest.sh b/94_upload_factorytest.sh new file mode 100755 index 0000000..f121116 --- /dev/null +++ b/94_upload_factorytest.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +echo "Finding serial ports..." +## get serial port via board list, choose lines including "USB", and pick up 1st word +serials=`arduino-cli board list | grep USB | awk '{print $1}'` + +# echo ${serials} +if [ -z "${serials}" ]; then + echo "No device connected." + echo "デバイスを接続しているのに認識しないときは、ドライバを入れてください。" + echo "https://ftdichip.com/drivers/vcp-drivers/ → Click here to download の hereをおす。ZIP解凍して実行。" + exit +fi + +## if multiple ports found, try uploading to all ports. +seriallist=($serials) + +## print the list +# echo ${seriallist[@]} + +for ser in ${seriallist[@]} ; do + echo ${ser} +# arduino-cli upload --fqbn esp32:esp32:m5stick-c -p ${ser} -v FactoryTest + arduino-cli upload --fqbn esp32:esp32:m5stack_stickc_plus2 -p ${ser} -v FactoryTest +done + + +if [[ "${#seriallist[@]}" -eq 1 ]]; then + arduino-cli monitor -p ${seriallist[0]} --config 115200 +fi + diff --git a/FactoryTest/FactoryTest.ino b/FactoryTest/FactoryTest.ino index 5d67e32..9cdfd26 100644 --- a/FactoryTest/FactoryTest.ino +++ b/FactoryTest/FactoryTest.ino @@ -160,7 +160,7 @@ { Disbuff.setTextSize(1); Disbuff.setTextColor(TFT_GREENYELLOW); - Disbuff.drawString("FactoryTest 2025", 10, 2, 1); + Disbuff.drawString("FactoryTest 2026", 10, 2, 1); Disbuff.setTextColor(TFT_WHITE); battery.batteryUpdate();