Python-based frontend/runtime for the CoBien furniture system.
This repository contains:
- The Kivy application (
app/) - Ubuntu deployment and runtime orchestration scripts (
deploy/ubuntu/) - Systemd user units for auto-start and scheduled updates
The production runtime is orchestrated by a single entrypoint:
deploy/ubuntu/cobien-launcher.sh
The launcher handles:
- Environment bootstrap with UV + Python 3.13
- Dependency sync (
uv sync) - Device identity + runtime config persistence
- CAN setup (real hardware mode) and CAN bridge launch
- Frontend launch (
uv run --project app mainApp.py) - Update checks and clean relaunch behavior
- Optional systemd user service/timer installation
Main app path:
app/mainApp.py
- Ubuntu (desktop session recommended for UI runtime)
- Two repositories under the same workspace root:
cobien_FrontEndcobien_MQTT_Dictionnary
- Internet access for first-time dependency/model download
sudoaccess if system packages or CAN runtime setup are required
Default workspace:
$HOME/cobien
From cobien_FrontEnd root:
bash deploy/ubuntu/cobien-launcher.shThis interactive flow can:
- Reuse previous saved launcher configuration (if present)
- Install missing system/runtime packages
- Prepare UV and Python
- Create/sync virtual environment for
app/ - Ask device identity and runtime options
- Install/enable systemd user units (if selected/required)
- Launch runtime
Run full unattended flow:
bash deploy/ubuntu/cobien-launcher.sh \
--non-interactive --yes \
--workspace "$HOME/cobien" \
--frontend-name cobien_FrontEnd \
--mqtt-name cobien_MQTT_Dictionnary \
--branch master \
--device-id CoBien1 \
--videocall-room CoBien1 \
--device-location LogroñoOnly setup dependencies/venv/config:
bash deploy/ubuntu/cobien-launcher.sh --mode setup --non-interactive --yesLaunch runtime:
bash deploy/ubuntu/cobien-launcher.sh --mode launch --non-interactive --yesOne-shot update check:
bash deploy/ubuntu/cobien-launcher.sh --mode update-once --non-interactive --yesWatch loop update mode:
bash deploy/ubuntu/cobien-launcher.sh --mode watch --non-interactive --yesDry-run resolved config:
bash deploy/ubuntu/cobien-launcher.sh --mode dry-runThe project is UV-based.
Dependency source:
app/pyproject.toml
Standard commands:
uv sync --project app --python 3.13
uv run --project app mainApp.pyThere is no requirements.txt runtime workflow anymore.
--hardware-mode controls CAN behavior:
real: configure CAN + run bridge/loggermock: skip hardware CAN stackauto(default): enable hardware only if detected
Useful for VM/testing:
bash deploy/ubuntu/cobien-launcher.sh --mode launch --hardware-mode mockInstall/update services:
bash deploy/ubuntu/install-systemd-user.shInstalled units:
cobien-launcher.service(main runtime)cobien-update.service(one-shot update task)cobien-update.timer(daily scheduled update, default 01:00)
Service operations:
systemctl --user daemon-reload
systemctl --user enable --now cobien-launcher.service cobien-update.timer
systemctl --user restart cobien-launcher.service
systemctl --user status cobien-launcher.service
systemctl --user list-timers | grep cobien-updateForce manual update:
systemctl --user start cobien-update.serviceRuntime logs directory:
cobien_FrontEnd/logs/
Typical files:
cobien-app-YYYYMMDD.logmqtt-can-bridge-YYYYMMDD.logcan-bus-YYYYMMDD.log
Launcher journal:
journalctl --user -u cobien-launcher.service -fQuick process check:
pgrep -af "cobien-launcher.sh|mainApp.py|cobien_bridge|candump"Primary launcher environment file:
deploy/ubuntu/cobien-update.env
Template:
deploy/ubuntu/cobien-update.env.example
App configuration resolution order:
- Environment variables
app/config/config.local.json(full local override, untracked)app/config/config.default.json(tracked defaults/template)
Recommended deployment file for a specific furniture device:
app/config/config.local.json
Template:
app/config/config.local.example.json
Defaults:
app/config/config.default.json
Supported:
pyttsx3(default)piper(optional)
When piper is selected, launcher attempts:
- Existing binary
aptpackageuv tool install piper-tts- Fallback to
pyttsx3if unavailable
cd ~/cobien/cobien_FrontEnd
git pull --ff-only origin master
systemctl --user restart cobien-launcher.servicemkdir -p ~/cobien
cd ~/cobien
git clone <FRONTEND_REPO_URL> cobien_FrontEnd
git clone <MQTT_REPO_URL> cobien_MQTT_Dictionnary
cd cobien_FrontEnd
bash deploy/ubuntu/cobien-launcher.sh- Use
cobien-launcher.shas the single operational entrypoint. - Do not run legacy startup mechanisms in parallel (
~/.config/autostartold entries, duplicated cron jobs, old scripts). - Keep
masterand remote config aligned with the deployed branch.