UNO Q - I don't get the Bridge and CLI Flash !

I recently got an uno q and examples and they all work, however, when I try and code myself a extremly basic test (cf end of post), it doesn’t work. I tried doing the update with the CLI thing, however, I don’t know which version to install and even by trying 3 different for windows, it still doesn’t work (2x out of 3 the file had a different name and even though, it didn’t have the command flash). This is the what may cause the bridge error : the Arduino_RouterBridge work but doesn’t… The example (just under) worked once but then stopped, from nowhere in the middle of the script (at around 55) ! After changing and putting back like it was when it worked, it does not work anymore even though it is an extract of the home climate example.

Could you help me do the update and/or solve my bridge problem please ? Thanks

Codes :

/sketch/sketch.ino

#include <Arduino_RouterBridge.h>
int counter = 0;
void setup() {
  Bridge.begin(); 
  Monitor.begin();  
}

void loop() {
  Monitor.println(counter);
  Bridge.notify("receive_value", counter);
  delay(2000);
  counter++;
}

/python/main.py

from arduino.app_utils import Bridge

def receive_value(val):
  print(f"Reçu depuis MCU: {val}")


print("Registering 'receive_value' callback.")
Bridge.provide("receive_value", receive_value)

PS: the codes actually compile (not the Python one technically) and get sent to the uno q but the serial (where print arrives) of both python and arduino mcu pop open and close in less than a second.

Hi @thelambdaman. The App is only considered to be in a running state as long as the Python script is running. Your Python code causes the script to exit immediately. So the App goes back into a "stopped" state immediately after starting.

With the current design of Arduino App Lab, the Serial Monitor and Python Console views are only visible while the app is running. So this is why you see them close immediately.

You should adjust your Python script code so that it runs indefinitely. You can see an example of how that is done in the "Blink LED" example App that is included in the Arduino App Lab installation:

The App.run method from the arduino.app_utils Python module repeatedly calls the function specified by its argument (in this example, the loop function), so this script runs indefinitely.

Applying that change to your script code, it would look something like this:

import time

from arduino.app_utils import App, Bridge

def receive_value(val):
  print(f"Reçu depuis MCU: {val}")


print("Registering 'receive_value' callback.")
Bridge.provide("receive_value", receive_value)

def loop():
    """This function is called repeatedly by the App framework."""
    # You can add here any code you want your App to run repeatedly.
    time.sleep(1)

App.run(user_loop=loop)

There is additional information on the subject here:

https://docs.arduino.cc/software/app-lab/tutorials/getting-started/#app-run

Thanks a lot for the help and it is almost working… In fact, the app runs and opens, I can see the results of monitor.println(), however, on the python side, I only get random logs from yesterday : extracts from different times of day and different program outputs). I can’t find the usual start of the venv and this is the last thing I see. Sometimes it goes until 42 or 86 or another random number less than a 100.

This might be wrong but, couldn’t the sleep be blocking the whole script ?

Activating python virtual environment
Registering 'receive_value' callback.
Starting App...
======== App is starting ============================
2025-12-30 20:56:28.575 INFO - [MainThread] App:  App started
Reçu depuis MCU: 2
Reçu depuis MCU: 3
Reçu depuis MCU: 4
Reçu depuis MCU: 5
Reçu depuis MCU: 6
Reçu depuis MCU: 7

Thank you !

I also noticed that Python logs are often terminated somewhere in the past, and not updating. This is some bug in AppLab. The only workaround for this situation is currently docker system prune -f