UNO Q: Possible to connect Python (not containerized) with Arduino ?

@KurtE @ptillisch
Finally, I have been able to blink the LED at 0.5 Hz.

I had to change the directory path to bridgetest:
arduino@gm123456:~$ cd bridgetest

and then execute the remaining commands of post #8..

Thanks for helping.

Question-1:
In the example, the script and sketch files of the Blink LED App have been taken ffrom App Lab.

Say, the sketch (.ino) and script (.py) files of my app are saved here E:\UNOQ. How to uplaod them into UNO Q and execute them?

Question-2:
How do I know the locations/folder of script (main.py) and sketch (sketch.ino) of Blink LED app in my PC?

The actual project was downloaded as part of #8 in this ...
It probably did something like a wget...

Each applab project has a format, for example from WinSCP


The right side shows the stuff on the Q, inside bridgetest
And you can see there are sub-directories sketch where it finds the sketch
and python where the ....

The tools described in post #8 were needed by the development team to build App Lab. Once App Lab is available, there is little need for those raw tools from post #8 for general users, except for a special user like @ashio.

You can open a terminal on your PC and use the adb push command to transfer files from the PC to the UNO Q board via the USB connection to the board.

As for the sketch specifically, you can open the sketch in Arduino IDE and upload it to the UNO Q board, instead of transferring the sketch to the Linux machine on the UNO Q. But you do need to transfer the Python script to the UNO Q.

If you do want to upload the sketch from the file on the UNO Q's Linux machine, you can use an arduino-cli compile --upload command, as I used in the instructions I provided. Arduino CLI is preinstalled on the UNO Q.

As for the Python script. The most simple method is like this:

python3 <path to script>

(where <path to script> is a placeholder for the path to the Python script file on the UNO Q)

However, this approach becomes a bit problematic if your Python script has Python package dependencies. If you install the package dependencies using pip (i.e., python3 -m pip <package name>), then they are installed into the global environment. When you have multiple different Python scripts all sharing the same environment, you can run into problems where installing a package dependency of one script breaks or otherwise changes the behavior of another script. So best practices are to avoid installing project package dependencies into the global Python environment, and instead use a dedicated virtual environment for the package dependencies of each of the Python projects.

I suggested the use of the uv tool for managing Python project dependencies in a virtual environment. Alternatively, you can use the traditional Python venv tool:

That is correct. The instructions I provided are specific to @ashio's goal of running a Python script directly on the standard Linux machine of the UNO Q, not using the Arduino App framework.

If you are using the Arduino App framework, the information I shared here is completely irrelevant.

You can determine the parent folders under which the example and user Apps are stored by running this command from the shell terminal on the UNO Q's Linux machine:

arduino-app-cli config get
$ arduino-app-cli config get
Data Directory:     /var/lib/arduino-app-cli
Apps Directory:     /home/arduino/ArduinoApps
Examples Directory: /var/lib/arduino-app-cli/examples

The individual Apps are stored in folders under those paths that have a name based on the App name:

$ ls /var/lib/arduino-app-cli/examples
air-quality-monitoring  code-detector                        mobile-video-generic-object-detection  vibration-anomaly-detection
anomaly-detection       color-your-leds                      object-detection                       video-face-detection
audio-classification    home-climate-monitoring-and-storage  object-hunting                         video-generic-object-detection
bedtime-story-teller    image-classification                 real-time-accelerometer                video-person-classification
blink                   keyword-spotting                     system-resources-logger                weather-forecast
blink-with-ui           led-matrix-painter                   theremin
cloud-blink             mascot-jump-game                     unoq-pin-toggle