From f9790c0bbd3ebfd2d9859738e05be61469678aab Mon Sep 17 00:00:00 2001 From: dido18 Date: Thu, 13 Nov 2025 00:09:21 +0100 Subject: [PATCH 1/5] feat: add Python watch and upload tasks for auto-restart and Arduino monitoring --- Taskfile.yaml | 195 ++++++++++++++++++++++++++++++++++++++++++++++ sketch/sketch.ino | 4 +- 2 files changed, 198 insertions(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 470e4ce..576e41a 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -86,3 +86,198 @@ tasks: fi - echo "Creating zip with version {{.APP_VERSION}}" - cd build && zip -r scratch-arduino-app-{{.APP_VERSION}}.zip scratch-arduino-app && cd .. + + python:watch: + desc: "Watch Python folder for changes and auto-upload/restart" + cmds: + - echo "👀 Watching python/ folder for changes..." + - echo "Press Ctrl+C to stop watching" + - | + # Check if inotify-tools is available + if ! command -v inotifywait &> /dev/null; then + echo "❌ inotifywait not found. Please install inotify-tools manually" + exit 1 + fi + - | + while true; do + echo "🔍 Waiting for changes in python/ folder..." + + # Watch for modify, create, delete, move events in python folder + inotifywait -r -e modify,create,delete,move python/ 2>/dev/null || { + echo "❌ inotifywait failed" + sleep 2 + continue + } + + echo "📝 Change detected in python/ folder!" + echo "⏳ Waiting 1 second for file writes to complete..." + sleep 1 + + echo "🚀 Uploading and restarting..." + task python:upload-and-restart || { + echo "❌ Upload/restart failed, continuing to watch..." + continue + } + + echo "✅ Upload and restart completed!" + echo "---" + done + + python:upload-and-restart: + desc: "Upload Python files and restart container" + cmds: + - echo "Uploading Python files..." + - adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/ + - echo "Python files uploaded successfully" + - echo "🔍 Searching for Arduino app container..." + - | + CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") + if [ -n "$CONTAINER_ID" ]; then + echo "📦 Found container: $CONTAINER_ID" + adb shell "docker restart $CONTAINER_ID" + echo "✅ Container restarted successfully" + else + echo "⚠️ No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" + fi + + sketch:monitor: + desc: "Open serial monitor for Arduino debugging" + cmds: + - echo "📺 Opening serial monitor (Press Ctrl+C to exit)..." + - | + echo "🔍 Detecting Arduino board..." + BOARD_JSON=$(arduino-cli board list --json 2>/dev/null) + if [ $? -ne 0 ] || [ -z "$BOARD_JSON" ]; then + echo "❌ Failed to detect boards. Make sure arduino-cli is installed and Arduino is connected." + exit 1 + fi + + # Use jq for proper JSON parsing if available, otherwise fallback + if command -v jq &> /dev/null; then + # Only use serial ports (USB connection) + PORT_ADDRESS=$(echo "$BOARD_JSON" | jq -r ' + .detected_ports[] | + select(.port.protocol == "serial") | + .port.address' 2>/dev/null | head -1) + else + # Fallback to grep method for serial ports only + PORT_ADDRESS=$(echo "$BOARD_JSON" | grep -A10 '"protocol":"serial"' | grep '"address"' | head -1 | cut -d'"' -f4) + fi + + if [ -z "$PORT_ADDRESS" ] || [ "$PORT_ADDRESS" = "null" ]; then + echo "❌ No Arduino boards detected. Make sure your Arduino UNO Q is connected." + exit 1 + fi + echo "📡 Connecting to Arduino at: $PORT_ADDRESS" + arduino-cli monitor -p "$PORT_ADDRESS" + + sketch:watch: + desc: "Watch sketch folder for changes and auto-compile/upload" + cmds: + - echo "👀 Watching sketch/ folder for changes..." + - echo "Press Ctrl+C to stop watching" + - | + if ! command -v arduino-cli &> /dev/null; then + echo "❌ arduino-cli not found. Installing..." + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh + echo "✅ arduino-cli installed. Please restart this task." + exit 1 + fi + - | + if ! command -v inotifywait &> /dev/null; then + echo "❌ inotifywait not found. Please install inotify-tools manually" + exit 1 + fi + - | + # Start watching for changes in sketch folder + while true; do + echo "🔍 Waiting for changes in sketch/ folder..." + + # Watch for modify, create, delete events in sketch folder + inotifywait -r -e modify,create,delete sketch/ --include '\.(ino|cpp|h|c)$' 2>/dev/null || { + echo "❌ inotifywait failed, falling back to polling..." + sleep 2 + continue + } + + echo "📝 Arduino code change detected!" + echo "⏳ Waiting 1 second for file writes to complete..." + sleep 1 + + echo "🔨 Compiling and uploading..." + if task sketch:compile-and-upload; then + echo "✅ Arduino sketch deployed successfully!" + echo "📺 You can run 'task sketch:serial' in another terminal to see serial output" + else + echo "❌ Compilation or upload failed, continuing to watch..." + fi + + echo "---" + done + + sketch:compile-and-upload: + desc: "Compile and upload Arduino sketch" + cmds: + - task: sketch:compile + - task: sketch:upload + - echo "🚀 Arduino sketch deployed successfully!" + + sketch:compile: + desc: "Compile Arduino sketch without uploading" + cmds: + - echo "🔨 Compiling Arduino sketch..." + - | + if [ ! -d "sketch" ]; then + echo "❌ sketch/ folder not found" + exit 1 + fi + - arduino-cli compile -b arduino:zephyr:unoq sketch/ + - echo "✅ Compilation completed successfully" + + + sketch:upload: + desc: "Upload Arduino sketch to board" + cmds: + - echo "📤 Uploading Arduino sketch to board..." + - | + echo "🔍 Detecting Arduino boards..." + BOARD_JSON=$(arduino-cli board list --json 2>/dev/null) + if [ $? -ne 0 ] || [ -z "$BOARD_JSON" ]; then + echo "❌ Failed to detect boards. Make sure arduino-cli is installed and Arduino is connected." + exit 1 + fi + + # Check if jq is available, if not install it + if ! command -v jq &> /dev/null; then + echo "📦 Installing jq for JSON parsing..." + sudo apt-get update && sudo apt-get install -y jq 2>/dev/null || { + echo "❌ Could not install jq. Using fallback method..." + # Fallback to grep method for the nested structure + PORT_ADDRESS=$(echo "$BOARD_JSON" | grep -A10 '"port"' | grep '"address"' | head -1 | cut -d'"' -f4) + BOARD_FQBN=$(echo "$BOARD_JSON" | grep -A5 '"matching_boards"' | grep '"fqbn"' | head -1 | cut -d'"' -f4) + } + fi + + # Use jq for proper JSON parsing if available + if command -v jq &> /dev/null; then + # Only use serial ports (USB connection) + PORT_ADDRESS=$(echo "$BOARD_JSON" | jq -r ' + .detected_ports[] | + select(.port.protocol == "serial") | + .port.address' 2>/dev/null | head -1) + + BOARD_FQBN=$(echo "$BOARD_JSON" | jq -r ' + .detected_ports[] | + select(.port.protocol == "serial") | + .matching_boards[0].fqbn' 2>/dev/null | head -1) + fi + + if [ -z "$PORT_ADDRESS" ] || [ "$PORT_ADDRESS" = "null" ]; then + echo "❌ No Arduino boards detected. Make sure your Arduino UNO Q is connected." + echo "💡 Run 'arduino-cli board list' to see available boards" + exit 1 + fi + + echo "📡 Found Arduino board at: $PORT_ADDRESS (FQBN: $BOARD_FQBN)" + arduino-cli upload -p "$PORT_ADDRESS" -b arduino:zephyr:unoq sketch/ + - echo "✅ Upload completed successfully" diff --git a/sketch/sketch.ino b/sketch/sketch.ino index cdeda9c..7624915 100644 --- a/sketch/sketch.ino +++ b/sketch/sketch.ino @@ -6,6 +6,8 @@ Arduino_LED_Matrix matrix; ModulinoButtons buttons; void setup() { + Monitor.begin(9600); + Monitor.println(""); matrix.begin(); Bridge.begin(); Modulino.begin(Wire1); @@ -54,7 +56,7 @@ void matrix_draw(String frame){ } for (int i = 0; i < 104; i++) { if (frame.charAt(i) == '1') { - shades[i] = 7; + shades[i] = 7; } else{ shades[i] = 0; } From 68216e9fb2ef863cf11dfdb124d7aa171f9a2cfd Mon Sep 17 00:00:00 2001 From: dido18 Date: Thu, 13 Nov 2025 00:44:06 +0100 Subject: [PATCH 2/5] ignore + sketch watch --- .gitignore | 1 + Taskfile.yaml | 17 ++--------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 40793c1..8e6cfa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ scratch-editor build/ .bin/ +.cache/ \ No newline at end of file diff --git a/Taskfile.yaml b/Taskfile.yaml index 576e41a..8c69cd0 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -206,7 +206,6 @@ tasks: echo "🔨 Compiling and uploading..." if task sketch:compile-and-upload; then - echo "✅ Arduino sketch deployed successfully!" echo "📺 You can run 'task sketch:serial' in another terminal to see serial output" else echo "❌ Compilation or upload failed, continuing to watch..." @@ -217,13 +216,6 @@ tasks: sketch:compile-and-upload: desc: "Compile and upload Arduino sketch" - cmds: - - task: sketch:compile - - task: sketch:upload - - echo "🚀 Arduino sketch deployed successfully!" - - sketch:compile: - desc: "Compile Arduino sketch without uploading" cmds: - echo "🔨 Compiling Arduino sketch..." - | @@ -231,13 +223,8 @@ tasks: echo "❌ sketch/ folder not found" exit 1 fi - - arduino-cli compile -b arduino:zephyr:unoq sketch/ + - arduino-cli compile --build-path .cache -b arduino:zephyr:unoq sketch/ --profile default - echo "✅ Compilation completed successfully" - - - sketch:upload: - desc: "Upload Arduino sketch to board" - cmds: - echo "📤 Uploading Arduino sketch to board..." - | echo "🔍 Detecting Arduino boards..." @@ -279,5 +266,5 @@ tasks: fi echo "📡 Found Arduino board at: $PORT_ADDRESS (FQBN: $BOARD_FQBN)" - arduino-cli upload -p "$PORT_ADDRESS" -b arduino:zephyr:unoq sketch/ + arduino-cli upload -p "$PORT_ADDRESS" -b arduino:zephyr:unoq:flash_mode=ram sketch/ --input-dir .cache - echo "✅ Upload completed successfully" From 0a61407a43e0255d08bd9bbae66ad2d10178bca7 Mon Sep 17 00:00:00 2001 From: dido18 Date: Thu, 13 Nov 2025 23:16:51 +0100 Subject: [PATCH 3/5] refac: streamline Python watch and upload tasks; add serial monitor for Arduino --- Taskfile.yaml | 171 +++++++++++--------------------------------------- 1 file changed, 37 insertions(+), 134 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 8c69cd0..7c85db9 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -90,181 +90,84 @@ tasks: python:watch: desc: "Watch Python folder for changes and auto-upload/restart" cmds: - - echo "👀 Watching python/ folder for changes..." - echo "Press Ctrl+C to stop watching" - - | - # Check if inotify-tools is available - if ! command -v inotifywait &> /dev/null; then - echo "❌ inotifywait not found. Please install inotify-tools manually" - exit 1 - fi - | while true; do - echo "🔍 Waiting for changes in python/ folder..." - - # Watch for modify, create, delete, move events in python folder + echo "Waiting for changes in python/ folder..." inotifywait -r -e modify,create,delete,move python/ 2>/dev/null || { - echo "❌ inotifywait failed" + echo "inotifywait failed, retrying..." sleep 2 continue } - echo "📝 Change detected in python/ folder!" - echo "⏳ Waiting 1 second for file writes to complete..." - sleep 1 + sleep 1 #W aiting 1 second for file writes to complete..." - echo "🚀 Uploading and restarting..." task python:upload-and-restart || { - echo "❌ Upload/restart failed, continuing to watch..." + echo "Upload/restart failed, continuing to watch..." continue } - echo "✅ Upload and restart completed!" - echo "---" + echo "[ok] Upload and restart completed!" done python:upload-and-restart: desc: "Upload Python files and restart container" cmds: - - echo "Uploading Python files..." - - adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/ - - echo "Python files uploaded successfully" - - echo "🔍 Searching for Arduino app container..." - | + adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/ + echo "Python files uploaded successfully" + CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") if [ -n "$CONTAINER_ID" ]; then - echo "📦 Found container: $CONTAINER_ID" adb shell "docker restart $CONTAINER_ID" - echo "✅ Container restarted successfully" - else - echo "⚠️ No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" - fi - - sketch:monitor: - desc: "Open serial monitor for Arduino debugging" - cmds: - - echo "📺 Opening serial monitor (Press Ctrl+C to exit)..." - - | - echo "🔍 Detecting Arduino board..." - BOARD_JSON=$(arduino-cli board list --json 2>/dev/null) - if [ $? -ne 0 ] || [ -z "$BOARD_JSON" ]; then - echo "❌ Failed to detect boards. Make sure arduino-cli is installed and Arduino is connected." - exit 1 - fi - - # Use jq for proper JSON parsing if available, otherwise fallback - if command -v jq &> /dev/null; then - # Only use serial ports (USB connection) - PORT_ADDRESS=$(echo "$BOARD_JSON" | jq -r ' - .detected_ports[] | - select(.port.protocol == "serial") | - .port.address' 2>/dev/null | head -1) + echo "[ok] Container restarted successfully" else - # Fallback to grep method for serial ports only - PORT_ADDRESS=$(echo "$BOARD_JSON" | grep -A10 '"protocol":"serial"' | grep '"address"' | head -1 | cut -d'"' -f4) + echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" fi - if [ -z "$PORT_ADDRESS" ] || [ "$PORT_ADDRESS" = "null" ]; then - echo "❌ No Arduino boards detected. Make sure your Arduino UNO Q is connected." - exit 1 - fi - echo "📡 Connecting to Arduino at: $PORT_ADDRESS" - arduino-cli monitor -p "$PORT_ADDRESS" sketch:watch: desc: "Watch sketch folder for changes and auto-compile/upload" cmds: - - echo "👀 Watching sketch/ folder for changes..." - - echo "Press Ctrl+C to stop watching" - - | - if ! command -v arduino-cli &> /dev/null; then - echo "❌ arduino-cli not found. Installing..." - curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh - echo "✅ arduino-cli installed. Please restart this task." - exit 1 - fi - | - if ! command -v inotifywait &> /dev/null; then - echo "❌ inotifywait not found. Please install inotify-tools manually" - exit 1 - fi - - | - # Start watching for changes in sketch folder + echo "Press Ctrl+C to stop watching" while true; do - echo "🔍 Waiting for changes in sketch/ folder..." - - # Watch for modify, create, delete events in sketch folder + echo "Waiting for changes in sketch folder..." inotifywait -r -e modify,create,delete sketch/ --include '\.(ino|cpp|h|c)$' 2>/dev/null || { - echo "❌ inotifywait failed, falling back to polling..." + echo "inotifywait failed, retrying..." sleep 2 continue } - echo "📝 Arduino code change detected!" - echo "⏳ Waiting 1 second for file writes to complete..." - sleep 1 - - echo "🔨 Compiling and uploading..." - if task sketch:compile-and-upload; then - echo "📺 You can run 'task sketch:serial' in another terminal to see serial output" - else - echo "❌ Compilation or upload failed, continuing to watch..." - fi + sleep 1 # Waiting 1 second for file writes to complete - echo "---" + task sketch:compile-and-upload|| { + echo "Compile/upload failed, continuing to watch..." + continue + } done sketch:compile-and-upload: desc: "Compile and upload Arduino sketch" cmds: - - echo "🔨 Compiling Arduino sketch..." - - | - if [ ! -d "sketch" ]; then - echo "❌ sketch/ folder not found" - exit 1 - fi - - arduino-cli compile --build-path .cache -b arduino:zephyr:unoq sketch/ --profile default - - echo "✅ Compilation completed successfully" - - echo "📤 Uploading Arduino sketch to board..." - - | - echo "🔍 Detecting Arduino boards..." - BOARD_JSON=$(arduino-cli board list --json 2>/dev/null) - if [ $? -ne 0 ] || [ -z "$BOARD_JSON" ]; then - echo "❌ Failed to detect boards. Make sure arduino-cli is installed and Arduino is connected." - exit 1 - fi - - # Check if jq is available, if not install it - if ! command -v jq &> /dev/null; then - echo "📦 Installing jq for JSON parsing..." - sudo apt-get update && sudo apt-get install -y jq 2>/dev/null || { - echo "❌ Could not install jq. Using fallback method..." - # Fallback to grep method for the nested structure - PORT_ADDRESS=$(echo "$BOARD_JSON" | grep -A10 '"port"' | grep '"address"' | head -1 | cut -d'"' -f4) - BOARD_FQBN=$(echo "$BOARD_JSON" | grep -A5 '"matching_boards"' | grep '"fqbn"' | head -1 | cut -d'"' -f4) - } - fi - - # Use jq for proper JSON parsing if available - if command -v jq &> /dev/null; then - # Only use serial ports (USB connection) - PORT_ADDRESS=$(echo "$BOARD_JSON" | jq -r ' - .detected_ports[] | - select(.port.protocol == "serial") | - .port.address' 2>/dev/null | head -1) + - arduino-cli compile --build-path .cache -b arduino:zephyr:unoq sketch/ + - arduino-cli upload -p /dev/ttyACM0 -b arduino:zephyr:unoq:flash_mode=ram --input-dir .cache sketch/ - BOARD_FQBN=$(echo "$BOARD_JSON" | jq -r ' - .detected_ports[] | - select(.port.protocol == "serial") | - .matching_boards[0].fqbn' 2>/dev/null | head -1) - fi - - if [ -z "$PORT_ADDRESS" ] || [ "$PORT_ADDRESS" = "null" ]; then - echo "❌ No Arduino boards detected. Make sure your Arduino UNO Q is connected." - echo "💡 Run 'arduino-cli board list' to see available boards" - exit 1 - fi + sketch:monitor: + desc: "Open serial monitor for Arduino debugging" + cmds: + - echo "Opening serial monitor (Press Ctrl+C to exit)..." + - arduino-cli monitor -p /dev/ttyACM0 - echo "📡 Found Arduino board at: $PORT_ADDRESS (FQBN: $BOARD_FQBN)" - arduino-cli upload -p "$PORT_ADDRESS" -b arduino:zephyr:unoq:flash_mode=ram sketch/ --input-dir .cache - - echo "✅ Upload completed successfully" + python:monitor: + desc: "Watch sketch folder for changes and auto-compile/upload" + cmds: + - | + while true; do + CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") + if [ -n "$CONTAINER_ID" ]; then + adb shell "docker logs -f $CONTAINER_ID" + else + echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" + fi + done \ No newline at end of file From 0d92982eef6d84dd13394003da72b45968c132cd Mon Sep 17 00:00:00 2001 From: dido18 Date: Thu, 13 Nov 2025 23:28:56 +0100 Subject: [PATCH 4/5] refac: improve Python and sketch watch tasks for better readability and maintainability --- Taskfile.yaml | 95 +++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 7c85db9..6b840bd 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -92,60 +92,59 @@ tasks: cmds: - echo "Press Ctrl+C to stop watching" - | - while true; do - echo "Waiting for changes in python/ folder..." - inotifywait -r -e modify,create,delete,move python/ 2>/dev/null || { - echo "inotifywait failed, retrying..." - sleep 2 - continue - } + while true; do + echo "Waiting for changes in python/ folder..." + inotifywait -r -e modify,create,delete,move python/ 2>/dev/null || { + echo "inotifywait failed, retrying..." + sleep 2 + continue + } - sleep 1 #W aiting 1 second for file writes to complete..." + sleep 1 #W aiting 1 second for file writes to complete..." - task python:upload-and-restart || { - echo "Upload/restart failed, continuing to watch..." - continue - } + task python:upload-and-restart || { + echo "Upload/restart failed, continuing to watch..." + continue + } - echo "[ok] Upload and restart completed!" - done + echo "[ok] Upload and restart completed!" + done python:upload-and-restart: desc: "Upload Python files and restart container" cmds: - | - adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/ - echo "Python files uploaded successfully" - - CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") - if [ -n "$CONTAINER_ID" ]; then - adb shell "docker restart $CONTAINER_ID" - echo "[ok] Container restarted successfully" - else - echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" - fi + adb push ./python/ /home/arduino/ArduinoApps/scratch-arduino-app/ + echo "Python files uploaded successfully" + CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") + if [ -n "$CONTAINER_ID" ]; then + adb shell "docker restart $CONTAINER_ID" + echo "[ok] Container restarted successfully" + else + echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" + fi sketch:watch: desc: "Watch sketch folder for changes and auto-compile/upload" cmds: - | - echo "Press Ctrl+C to stop watching" - while true; do - echo "Waiting for changes in sketch folder..." - inotifywait -r -e modify,create,delete sketch/ --include '\.(ino|cpp|h|c)$' 2>/dev/null || { - echo "inotifywait failed, retrying..." - sleep 2 - continue - } - - sleep 1 # Waiting 1 second for file writes to complete - - task sketch:compile-and-upload|| { - echo "Compile/upload failed, continuing to watch..." - continue - } - done + echo "Press Ctrl+C to stop watching" + while true; do + echo "Waiting for changes in sketch folder..." + inotifywait -r -e modify,create,delete sketch/ --include '\.(ino|cpp|h|c)$' 2>/dev/null || { + echo "inotifywait failed, retrying..." + sleep 2 + continue + } + + sleep 1 # Waiting 1 second for file writes to complete + + task sketch:compile-and-upload|| { + echo "Compile/upload failed, continuing to watch..." + continue + } + done sketch:compile-and-upload: desc: "Compile and upload Arduino sketch" @@ -163,11 +162,11 @@ tasks: desc: "Watch sketch folder for changes and auto-compile/upload" cmds: - | - while true; do - CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") - if [ -n "$CONTAINER_ID" ]; then - adb shell "docker logs -f $CONTAINER_ID" - else - echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" - fi - done \ No newline at end of file + while true; do + CONTAINER_ID=$(adb shell "docker ps -q --filter 'ancestor=ghcr.io/arduino/app-bricks/python-apps-base:0.5.0'") + if [ -n "$CONTAINER_ID" ]; then + adb shell "docker logs -f $CONTAINER_ID" + else + echo "[warning] No running container found with image ghcr.io/arduino/app-bricks/python-apps-base" + fi + done From bc698d21ea77a22d8c9b5b5206dec7571f272ec2 Mon Sep 17 00:00:00 2001 From: dido18 Date: Thu, 13 Nov 2025 23:32:00 +0100 Subject: [PATCH 5/5] refac: remove unnecessary serial monitor initialization in setup --- sketch/sketch.ino | 2 -- 1 file changed, 2 deletions(-) diff --git a/sketch/sketch.ino b/sketch/sketch.ino index 7624915..4ad2f14 100644 --- a/sketch/sketch.ino +++ b/sketch/sketch.ino @@ -6,8 +6,6 @@ Arduino_LED_Matrix matrix; ModulinoButtons buttons; void setup() { - Monitor.begin(9600); - Monitor.println(""); matrix.begin(); Bridge.begin(); Modulino.begin(Wire1);