A daemon for the Uno LCD Terminal!
The daemon will create an icon in the notification area (incorrectly known as the "system tray") and will show the status and allow you to quit the program!
It is hot pluggable, so you can unplug and replug your Uno LCD Terminal back in all you want! (As long as the serial port name stays the same) It's also happy being started on system startup.
See the README.md
for the Uno LCD Terminal for instructions and details.
- Clone this repo.
- Create virtual environment if desired.
- Install dependencies in
requirements.txt
.
Run main.py
.
This is my batch file (.bat
file on Windows) which I set to auto start on Windows:
REM Go to the E: drive
E:
REM Change directories to the "Uno LCD Terminal Daemon" directory
cd "Uno LCD Terminal Daemon"
REM Run main.py with pythonw (the binary in venv\Scripts\ will respect the virtual environment)
"venv\Scripts\pythonw" main.py -c -p COM8 -o "time" -o "cpu" -o "memory" -o "disk" -o "network"
Run with -h
or --help
to view the help:
usage: main.py [-h] [-lp] [-lo] [-c] [-p PORT] [-u INTERVAL] [-r INTERVAL]
[-o NAME] [-d]
Daemon for the Uno LCD Terminal.
optional arguments:
-h, --help show this help message and exit
-lp, --list-ports List serial ports and exit.
-lo, --list-outputs List function outputs and exit.
-c, --connect Connect to an Uno LCD Terminal.
-p PORT, --port PORT A port to connect to. Required if connecting with -c
or --connect. Can be a path or an index from -l or
--list-ports.
-u INTERVAL, --update-interval INTERVAL
The update interval for the Uno LCD Terminal in float
seconds. Required if connecting with -c or --connect.
Defaults to 1.0.
-r INTERVAL, --change-interval INTERVAL
The change interval for the Uno LCD Terminal in
integer seconds. Required if connecting with -c or
--connect. Defaults to 1.
-o NAME, --output NAME
The outputs you want to use. At least one is required
if connecting with -c or --connect. Can be specified
multiple times.
-d, --debug Whether to show debug output or not.
List all serial ports:
main.py -lp
Example output on Windows:
2022-04-01 21:42:27,946 - __main__ - INFO - Listing connected serial ports
2022-04-01 21:42:27,956 - __main__ - INFO - 1/6: COM1 - Communications Port (COM1)
2022-04-01 21:42:27,957 - __main__ - INFO - 2/6: COM14 - Standard Serial over Bluetooth link (COM14)
2022-04-01 21:42:27,957 - __main__ - INFO - 3/6: COM15 - Standard Serial over Bluetooth link (COM15)
2022-04-01 21:42:27,957 - __main__ - INFO - 4/6: COM18 - USB Serial Device (COM18)
2022-04-01 21:42:27,957 - __main__ - INFO - 5/6: COM3 - Intel(R) Active Management Technology - SOL (COM3)
2022-04-01 21:42:27,957 - __main__ - INFO - 6/6: COM8 - Arduino Uno (COM8)
List all output functions: (they generate text to send to the Terminal)
main.py -lo
Example output on Windows:
2022-04-01 21:43:22,217 - __main__ - INFO - Listing output functions
2022-04-01 21:43:22,217 - __main__ - INFO - 1 / 5: time - Shows the date and time.
2022-04-01 21:43:22,217 - __main__ - INFO - 2 / 5: cpu - Shows the CPU utilization
2022-04-01 21:43:22,217 - __main__ - INFO - 3 / 5: memory - Shows the memory utilization
2022-04-01 21:43:22,217 - __main__ - INFO - 4 / 5: disk - Shows the disk IO counters
2022-04-01 21:43:22,217 - __main__ - INFO - 5 / 5: network - Shows the network IO counters
Connect to COM8
and use the output functions time
, cpu
, memory
, disk
, and network
:
main.py -c -p COM8 -o "time" -o "cpu" -o "memory" -o "disk" -o "network"
Note that doing this needs a supported desktop. (sorry hardcore command line users - you can go back earlier in time to use an older version that does not use an icon)
According to the Qt 5 docs:
The
QSystemTrayIcon
class can be used on the following platforms:
All supported versions of Windows.
All window managers and independent tray implementations for X11 that implement the http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop.org XEmbed system tray specification.
All X11 desktop environments that implement the D-Bus http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem specification, including recent versions of KDE and Unity.
All supported versions of macOS.
Example output on Windows:
2022-04-01 21:43:41,550 - __main__ - INFO - Connecting to COM8
2022-04-01 21:43:41,663 - uno_lcd_terminal - INFO - Connected!