Good morning everyone.
With Arduino Uno Q and App Lab, you can use a graphics library like TKinter to provide a GUI for your projects.
So, connecting an HDMI monitor and a mouse, or better yet, a touchscreen?
And a sort of autostart feature to launch the application when the Q starts.
Also, how do I use PIP to load additional modules?
Thanks.
Regards.
Cristian
Hi Cristian,
You can create Arduino Apps with a Web-based graphical UI by using the WebUI Brick. Several examples use it, and it is a good starting point. Also, the WebUI Brick includes its documentation, which provides a reference and a few examples.
For an advanced use case, see also https://projecthub.arduino.cc/Arduino_Genuino/arduino-uno-q-local-weather-station-b771ee.
To configure an App to autostart, click the triangle menu button next to the App name, then select Set as default app.
To add Python packages to your application, select the main.py file and click on the “Add file“ icon. Create a requirements.txt file and list the Python packages you need. See Requirements File Format - pip documentation v25.2 for more information.
Just so you know, all App Lab apps run in containers, so they require special care to run a GUI from within them.
Enjoy!
Hello!
I have a project using POSTGRESQL. Is it possible to localize it?
To do this, I need to install some additional packages.
Hi @ua6em,
The Uno Q is also a plain Linux board, so you can connect to it and interact with it as with a regular Debian-based machine, and then install all the tools and packages you need on the Linux system as usual. Docker comes pre-installed, too. If you still want to take advantage of the App Lab system, your external application can interact with it via (networking) APIs exposed from the Linux or the App Lab side.
To connect to the Linux shell, you can use:
-
The ADB tool (usually distributed in the android-platform-tools) if the Uno Q is directly connected to your PC via the USB-C cable
$ adb shell -
SSH, if the Uno Q has WiFi configured through the App Lab or in Single Board Computer/Standalone mode.
<boardname>is the name of the board you configured during setup and is shown in the bottom panel of the App Lab.$ ssh arduino@<boardname>.local
In both cases, you land in a shell for the arduino user, which is also part of the sudo group.
Hello
I have the same topic as Christian when trying to import tkinter. I tried also creating the requirements.txt with tk inside as you aready suggested however I didn’t succeed and always got error messages in the logs of the app like in followings:
[main] Activating python virtual environment
[main] Traceback (most recent call last):
[main] File "/app/python/main.py", line 9, in
[main] import tkinter as tk
[main] File "/usr/local/lib/python3.13/tkinter/init.py", line 38, in
[main] import _tkinter # If this fails your Python may not be configured for Tk
[main] ^^^^^^^^^^^^^^^
[main] ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
[main] Activating python virtual environment
[main] Traceback (most recent call last):
[main] File "/app/python/main.py", line 9, in
[main] import tkinter as tk
[main] File "/usr/local/lib/python3.13/tkinter/init.py", line 38, in
[main] import _tkinter # If this fails your Python may not be configured for Tk
[main] ^^^^^^^^^^^^^^^
[main] ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
[main] Activating python virtual environment
[main] Using Python 3.13.9 environment at: .cache/.venv
[main] × No solution found when resolving dependencies:
[main] ╰─▶ Because tkinter was not found in the package registry and you require
[main] tkinter, we can conclude that your requirements are unsatisfiable.
[main] Clearing cache at: .cache/uv
[main] Removed 7 files (1.9KiB)
[main] Traceback (most recent call last):
[main] File "/app/python/main.py", line 9, in
[main] import tkinter as tk
[main] File "/usr/local/lib/python3.13/tkinter/init.py", line 38, in
[main] import _tkinter # If this fails your Python may not be configured for Tk
[main] ^^^^^^^^^^^^^^^
[main] ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
I understand tk is not pip installed in the venv but have no idea how to do this. Could you please instruct how to have tkinter imported? Thanks a lot.
My interpretation of what has been said in response to previous questions is that within an App Lab app one cannot build graphical apps. The option available is to serve a web page that can have graphics.
In addition one can build a python3 graphical app with the version of python3 that can be run outside of App Lab. Debian is capable of running multiple processes and an App Lab app can interact with an external process through a web api. Not something I have tried.
Hi, thankyou. Actually I did run the GUI in the Debian side outside App Lab without any problem in SBC mode but the topic of communicating with the microcontroller side remain open. I know nothing about containers however I would expect a way to install a module in the virtual environment.
You can do quite a lot from pure host Python, trigger pins and so on, using /dev/.. as described in the tutorial
If you need bridge to sketch, then hopefully Arduino team could explain how to do it from naked python
Okay you peaked my interest - what tutorial on /dev…
?
You can use gpiodetect gpioget gpioinfo gpiomon gpionotify gpioset commands to get set individual pins
Regarding accessing bridge from host python, there is an example in Uno Q Manual about MsgPack sending to Unix socket, quite easy
Thanks @extender777 . Will add it to my todo list ![]()
So just having a line like:
import tkinter as tk
won't be enough, and you need to add the requirements text file? Does that apply to all libraries, or only ones that make windows outside the container?