Skip to content

librescoot-scootui (scootui-qt)

The original Flutter/Dart scootui is deprecated and replaced by this Qt/QML version.

Description

ScootUI is the primary user interface for Librescoot. It runs on the DBC (Dashboard Computer) and communicates with all Librescoot services via Redis.

  • Qt 6 / QML — UI framework
  • QMapLibre — Vector map rendering
  • Valhalla — Routing engine
  • hiredis — Redis client (async pub/sub + worker thread for polling)
  • CMake — Build system

Features

Real-time Telemetry Display

  • Speed (raw or wheel-corrected), power output, battery levels
  • Odometer, trip meter, GPS status, connectivity indicators
  • System warnings and fault codes

View Modes

  • Cluster — Speedometer and vehicle status
  • Map — 3D-tilted navigation with turn-by-turn directions
  • Destination — Saved locations and destination input
  • Navigation Setup — Route preview and confirmation
  • OTA Update — System update progress and control
  • Offline vector map support (MBTiles via QMapLibre)
  • Online map tiles (CartoDB) as alternative
  • Valhalla routing (on-device or remote)
  • Speed limit indicators from vector tiles
  • Auto-rotating map with heading tracking

Other

  • Alarm status display
  • Hop-on / hop-off combo lock screen
  • Light and dark themes with auto-switching
  • Configurable blinker overlay styles
  • Multi-language support

Build

Desktop (simulator mode)

./run-desktop.sh

Or manually:

cmake -B build -DDESKTOP_MODE=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j$(nproc)
SCOOTUI_REDIS_HOST=none ./build/bin/scootui

SCOOTUI_REDIS_HOST=none disables Redis and activates the built-in simulator.

Target (cross-compile for i.MX6 armhf)

./cross-build.sh [Release|Debug]

Produces deploy-armhf/ with binary, Qt plugins, and launcher. Deploy:

scp -r deploy-armhf/* target:/opt/scootui/
ssh target /opt/scootui/run-scootui.sh

Make shortcuts

make build    # Configure and build
make run      # Build and run
make clean    # Remove build directory

Environment Variables

Variable Default Description
SCOOTUI_REDIS_HOST 192.168.7.1 Redis host. none = simulator mode. Supports host:port.
SCOOTUI_RESOLUTION 480x480 Display resolution (WIDTHxHEIGHT)
SCOOTUI_SETTINGS_PATH (none) Path to persistent settings file

Redis Operations

Subscriptions (pub/sub + periodic HGETALL)

Channel Store Poll interval
engine-ecu EngineStore 200 ms
vehicle VehicleStore, AutoStandbyStore 500–1000 ms
buttons VehicleStore, ShortcutMenuStore event-driven
battery:0, battery:1 BatteryStore 30 s
gps:tpv (pub/sub) + gps hash GpsStore push + 5 s safety poll
motion:heading (5 Hz) + motion:sensors (10 Hz) pub/sub + motion hash MotionStore push + 5 s safety poll
ble BluetoothStore 5 s
internet InternetStore 5 s
navigation NavigationStore 5 s
settings SettingsStore 5 s
ota OtaStore 5 s
usb UsbStore 5 s
speed-limit SpeedLimitStore 5 s
cb-battery CbBatteryStore 30 s
aux-battery AuxBatteryStore 30 s
dashboard DashboardStore 500 ms

Additionally polled (no subscription): system, version:mdb, version:dbc (30 s).

HSET Writes

Hash Field Value When
dashboard ready true Startup and every Redis reconnect
dashboard serial-number Hardware serial Startup (if readable)
dashboard backlight-enabled true/false On backlight control
navigation latitude, longitude, address, timestamp, destination lat/lon (6 dp), address string, ISO-8601 UTC, lat,lon When the rider picks a destination in the UI (then publishes navigation = updated)
settings dashboard.* user values On settings changes via menu
usb mode normal/ums-by-dbc On USB mode change

Note: scootui is not consume-only on the navigation hash. When the rider sets a destination in the UI, NavigationService writes the destination fields above and publishes navigation = updated; clearing the destination blanks the same fields and publishes navigation = cleared.

LPUSH Commands

List Commands Written by
scooter:blinker left, right, both, off Blinker/hazard controls
scooter:hop-on engage, engage-learning, release HopOnStore

HDEL

  • navigation destination, latitude, longitude, address, timestamp — on destination clear

LRANGE

  • usb:log (indices 0–19) — UMS transfer log, polled while usb status is processing

Settings

Settings are stored in the settings Redis hash. Managed by settings-service.

Key Values Default Description
dashboard.show-raw-speed true/false false Raw ECU speed vs wheel-corrected
dashboard.show-gps always/active-or-error/error/never error GPS icon visibility
dashboard.show-bluetooth always/active-or-error/error/never active-or-error Bluetooth icon
dashboard.show-cloud always/active-or-error/error/never active-or-error Cloud connection icon. Only shown when internet[unu-cloud] is present (a cloud client is running); hidden on de-clouded scooters
dashboard.show-internet always/active-or-error/error/never active-or-error Cellular icon. active-or-error shows when internet[connectivity] is connected/disconnected/failed, hides on disabled/no-sim/denied
dashboard.show-clock always/never always Clock visibility
dashboard.theme light/dark/auto auto UI theme
dashboard.blinker-style icon/overlay icon Blinker indicator style
dashboard.language en, de, … en UI language
dashboard.battery-display-mode percentage/range percentage Battery display
dashboard.power-display-mode kw/amps kw Power unit
dashboard.mode speedometer/navigation speedometer Default screen
dashboard.map.type online/offline offline Map source
dashboard.map.render-mode vector/raster raster Offline map rendering
dashboard.map.traffic-overlay true/false false Traffic overlay (online only)
dashboard.valhalla-url URL http://127.0.0.1:8002/ Valhalla routing endpoint
dashboard.maps.check-for-updates true/false true Auto-check for map updates
dashboard.maps.auto-download true/false false Auto-download map updates
dashboard.milestone-celebrations true/false false Confetti + banner when passing a 500 km odometer milestone or an easter-egg number. Off suppresses all milestone output (including easter eggs)
dashboard.hop-on-combo pipe-delimited tokens (empty) Custom hop-on unlock combo
When dashboard.theme is auto, AutoThemeService drives light/dark switching from the dashboard hash field brightness (lux). It listens on the dashboard pub/sub channel and also polls every 1 s, smooths the value, and switches with hysteresis (dark below 15 lux, light above 25 lux).

Hardware Interfaces

Serial Number

Primary: /sys/devices/soc0/serial_number

Fallback (OTP fuses): /sys/fsl_otp/HW_OCOTP_CFG0 + HW_OCOTP_CFG1

Boot Animation

On Linux startup:

  1. Fades in framebuffer overlay: imx-overlay-alpha fade 0 255 1000 (skipped on kernel 6.6 imx-drm)
  2. Stops boot animation: systemctl stop boot-animation.service

Shutdown

On SIGTERM or vehicle stateshutting-down: ShutdownStore::forceBlackout() blacks out the display.

Map Tiles

Offline tiles expected at /data/maps/map.mbtiles on the DBC. The app watches /data/maps/ via inotify and reloads map services when the file appears or changes.

Routing tiles live separately at /data/valhalla/tiles.tar, which Valhalla mmaps as its tile_extract and which therefore has to stay an uncompressed seekable tar.

MapDownloadService fetches both from the manifest at downloads.librescoot.org/releases/tiles.json, keyed by region slug. Each region's map and valhalla entries carry url, size and sha256 describing the uncompressed artifact. Downloads resume via HTTP Range into a per-asset .part file.

The .mbtiles is not compressed for transport. Its vector tiles are already gzipped per tile, so the archive only compresses by about 1.14x.

Project Structure

src/
  core/           App initialization, environment config
  models/         Data models and enums
  repositories/   Redis (hiredis-based) and in-memory MDB implementations
  stores/         QML-exposed state stores
  services/       System services (navigation, settings, map, input, ...)
  routing/        Valhalla client and route models
  simulator/      Simulator service (desktop mode only)
  l10n/           Translations
qml/
  screens/        Main UI screens
  widgets/        Reusable UI components
  overlays/       Modal overlays (menu, toast, ...)
  simulator/      Simulator panel (desktop mode only)
  theme/          Theme definitions

Dependencies

  • Redis server
  • Qt 6.4+ (Quick, Qml, Svg, Network, Sql, Concurrent)
  • QMapLibre (required on target; optional in desktop mode)
  • hiredis
  • Valhalla routing engine