Skip to content

Redis Tools

Two utilities are provided for inspecting the Redis cache — useful for verifying that the navigation collector is running, that the dive detector is writing state, and that sensor values look correct.

redis_dump

File: backend/redis_dump.py

Prints a snapshot of all keys in a bucket as a formatted table using Rich.

Usage

uv run backend/redis_dump.py <bucket> [--redis-host HOST] [--redis-port PORT]

Arguments:

Argument Description
bucket Required. Key prefix to inspect, e.g. rcsn
--redis-host Redis hostname (default: localhost)
--redis-port Redis port (default: 6379)

Example:

uv run backend/redis_dump.py rcsn

Outputs a table of all rcsn:* keys sorted alphabetically, one row per key.

redis_dump_textual

File: backend/redis_dump_textual.py

An auto-refreshing terminal UI built with Textual that shows live Redis values as they update.

Usage

uv run backend/redis_dump_textual.py <bucket> [options]

Arguments:

Argument Description
bucket Required. Key prefix to inspect, e.g. rcsn
--redis-host HOST Redis hostname (default: localhost)
--redis-port PORT Redis port (default: 6379)
--refresh-interval SECS Auto-refresh period (default: 5)
--web Serve the TUI over HTTP instead of running in the terminal
--host HOST Web server host when --web is used (default: localhost)
--port PORT Web server port when --web is used (default: 8000)

Keyboard shortcuts:

Key Action
r Force immediate refresh
q Quit

Example — terminal mode:

uv run backend/redis_dump_textual.py rcsn --refresh-interval 2

Example — web mode (useful on headless servers):

uv run backend/redis_dump_textual.py rcsn --web --host 0.0.0.0 --port 8000

Then open http://<server>:8000 in a browser.

Checking the live system

To verify the keys the dive detector and dashboard rely on:

# Quick one-shot snapshot
uv run backend/redis_dump.py rcsn

# Live monitor
uv run backend/redis_dump_textual.py rcsn --refresh-interval 2

Expected output (ROV in water at ~47 m, dashboard auto-stream on, force off, OBS healthy and streaming):

rcsn:rov:ctd:inwater         1
rcsn:rov:mbari:depth         47.31
rcsn:ship:gps:lat            36.7814
rcsn:ship:gps:lon            -122.0234
rcsn:rov:position:lat        36.7820
rcsn:rov:position:lon        -122.0241
rcsn:state:streaming         1
rcsn:state:obs_ok            1
rcsn:state:obs_last_error
rcsn:config:auto_stream      1
rcsn:config:force_stream     0