From e5edd1bbd357ae0c576048ffa5451d312dbba5cb Mon Sep 17 00:00:00 2001 From: irriden Date: Thu, 8 Jun 2023 15:37:16 +0000 Subject: [PATCH 1/3] doc: add node to run broker against LSS --- broker/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/broker/README.md b/broker/README.md index b36730b..ae0956c 100644 --- a/broker/README.md +++ b/broker/README.md @@ -45,3 +45,6 @@ cargo run --bin sphinx-key-tester -- --log ##### find pid ps aux | grep -i sphinx-key-broker + +### Run against LSS +export VLS_LSS=http://127.0.0.1:55551 From ad7c4f433b564b6efe7521b54164ddafe8ea95cc Mon Sep 17 00:00:00 2001 From: irriden Date: Thu, 8 Jun 2023 17:43:02 +0000 Subject: [PATCH 2/3] build: create release and debug modes for deployment scripts --- deploy.sh | 14 +++++++++++--- sphinx-key/up.sh | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/deploy.sh b/deploy.sh index 5fd7341..5e7a2d5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,4 @@ +MODE=debug check_exists() { command -v "$1" > /dev/null } @@ -65,7 +66,14 @@ git pull && cd factory && cargo espflash --release $PORT && cd ../sphinx-key && -cargo build --release && -esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key && -esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/release/sphinx-key.bin && + +if [ $MODE = "release" ] +then + cargo build --release +else + cargo build +fi && + +esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/$MODE/sphinx-key && +esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/$MODE/sphinx-key.bin && cargo espflash serial-monitor $PORT diff --git a/sphinx-key/up.sh b/sphinx-key/up.sh index bd293d4..f24150a 100755 --- a/sphinx-key/up.sh +++ b/sphinx-key/up.sh @@ -1,3 +1,7 @@ +MODE=debug +# MODE=release +SSID=sphinx +PASS=sphinxkey check_exists() { command -v "$1" > /dev/null } @@ -60,7 +64,12 @@ then echo "Make sure the ESP is connected with a data USB cable, and try again." exit 1 fi -cargo build --release && -esptool.py --chip esp32c3 elf2image target/riscv32imc-esp-espidf/release/sphinx-key && -esptool.py --chip esp32c3 -p $PORT -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x10000 target/riscv32imc-esp-espidf/release/sphinx-key.bin && -espmonitor $PORT +if [ $MODE = "release" ] +then + cargo build --release +else + cargo build +fi && +esptool.py --chip esp32-c3 elf2image target/riscv32imc-esp-espidf/$MODE/sphinx-key && +esptool.py --chip esp32c3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x80000 target/riscv32imc-esp-espidf/$MODE/sphinx-key.bin && +cargo espflash serial-monitor $PORT From 11009d00250bf885c93631f661c313aebf272b50 Mon Sep 17 00:00:00 2001 From: irriden Date: Thu, 8 Jun 2023 17:45:13 +0000 Subject: [PATCH 3/3] nit --- deploy.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy.sh b/deploy.sh index 5e7a2d5..03d2203 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,4 +1,5 @@ MODE=debug +# MODE=release check_exists() { command -v "$1" > /dev/null }