mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-24 02:13:46 +08:00
Compare commits
197 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cda9d8f45f | |||
| 53b1070b09 | |||
| 68bf6d8162 | |||
| 8b472291d0 | |||
| 797c8d4293 | |||
| 7568528507 | |||
| 6665c3acf6 | |||
| 3b13eb4d0d | |||
| f7eb4c2561 | |||
| be9255358c | |||
| f48ccb5d7a | |||
| 99559d6749 | |||
| 4b6f0ffb46 | |||
| 55415382ce | |||
| 9f30901eb6 | |||
| d2045d24fb | |||
| 6488a11e4d | |||
| 7b22b65313 | |||
| b59a50101e | |||
| 3e30962bd3 | |||
| 3274043063 | |||
| c624550d2e | |||
| 6759038671 | |||
| aa636e75c8 | |||
| 5ff3c3bd8d | |||
| 1e11b52290 | |||
| 76e0204025 | |||
| cc88f2cbd6 | |||
| ee0ac199a4 | |||
| d5ed828eaa | |||
| 9fca585f2a | |||
| bb1259303e | |||
| e135051ca8 | |||
| 12bef55d8a | |||
| 2f7a45e6c8 | |||
| 936ebfc12b | |||
| aa0c9dc0eb | |||
| 7476a866e7 | |||
| 610d857e33 | |||
| d2f47407d0 | |||
| db75ec76ea | |||
| 24066465d7 | |||
| a7abbd6e25 | |||
| 878982447c | |||
| 576527a36b | |||
| ef8c35da24 | |||
| 85688b1040 | |||
| 0fb2199130 | |||
| d48d756c1d | |||
| 2ed298a0c9 | |||
| d68f038949 | |||
| 7231571e57 | |||
| b37f1419d3 | |||
| cd85a66790 | |||
| 305ea87daf | |||
| 4bbfc793e0 | |||
| d5d983676e | |||
| de8a96a398 | |||
| 0cbf45f699 | |||
| 0d68a3a2ab | |||
| 9e85a85059 | |||
| 0373c327c0 | |||
| efe9e5c200 | |||
| 8a249a45dc | |||
| bdbefe67f6 | |||
| 675bb166ad | |||
| 1b717a7e88 | |||
| 86f55a8ba9 | |||
| 629392d2f7 | |||
| bc414bdc8b | |||
| 7ca5649f2c | |||
| 641ee8fa87 | |||
| 56c276158c | |||
| c65308a8bd | |||
| 994e526460 | |||
| 1defae36b7 | |||
| 8f029fd0ef | |||
| ddb46284dc | |||
| 9effc754d9 | |||
| e49ffc2a2d | |||
| 2cacd0b3e5 | |||
| c4b8859dff | |||
| 8fb0953205 | |||
| 63d1c8835f | |||
| 17a185606d | |||
| da10131392 | |||
| 7107c2ba14 | |||
| 95b6e877ac | |||
| eb02c6570e | |||
| 1be8ae31c4 | |||
| 04dcd38856 | |||
| 22ccf0d72f | |||
| 3c969bb627 | |||
| 20f8011feb | |||
| 9cf17e74a1 | |||
| 2c4efdf557 | |||
| 4cd3d3c16c | |||
| 637f3ae9c8 | |||
| 464ee80f71 | |||
| 2743a04613 | |||
| 7f9978d001 | |||
| 4b83961c67 | |||
| c00eaf428a | |||
| 0a9993e8d4 | |||
| 0af214a985 | |||
| af43385e3a | |||
| 0ab2b8c590 | |||
| 67ab18a0de | |||
| e87dc15b30 | |||
| 192d08516c | |||
| 3cf001c59c | |||
| f2ccd021da | |||
| c9fc900f64 | |||
| 3c37c5ce5d | |||
| 7c45889e4e | |||
| 2aabb7aee8 | |||
| 3859e9962f | |||
| 810efbab72 | |||
| ec27bec326 | |||
| 250d553157 | |||
| cea54a0ca8 | |||
| 8e72d783bd | |||
| 1b0dc103dc | |||
| 6c364d292b | |||
| bcdec2ce84 | |||
| 3deaeb3759 | |||
| c669f0984a | |||
| 46dd946740 | |||
| 9da4b3653e | |||
| 4e21ae7c50 | |||
| bb91e92237 | |||
| 14b4c4f85b | |||
| 0660b542c3 | |||
| 2b893b90c9 | |||
| f5139178ed | |||
| fb43b755f2 | |||
| 07f5b967d8 | |||
| ea19c7d3bb | |||
| e461842cbb | |||
| a73c9659d5 | |||
| cb796fbc76 | |||
| 6bf75fc557 | |||
| 9a1fc28819 | |||
| 0741d05e92 | |||
| 1ad008107d | |||
| feebd9df93 | |||
| c2e5ced3e5 | |||
| 15e5d2efb9 | |||
| a3929d0b54 | |||
| 794f8f9991 | |||
| 68fa5e3f21 | |||
| 86c6cc1f48 | |||
| eb7ffbf093 | |||
| 3919095752 | |||
| 74d63be1c3 | |||
| 8894486a1a | |||
| 810599315d | |||
| 6f3ab810c8 | |||
| 230f78b8d3 | |||
| f1affec088 | |||
| 97d8ef242c | |||
| a63fff9b45 | |||
| cb3893daaa | |||
| 29f60df74b | |||
| c6c072e1f4 | |||
| d101cbb83e | |||
| 1536d59633 | |||
| dc99b865ae | |||
| e59bc027ff | |||
| cf7e5efaca | |||
| 4b44f2eb31 | |||
| 107d2ab400 | |||
| 5432d9062c | |||
| f533f6c843 | |||
| 58e9ac763c | |||
| cb50d54169 | |||
| bd5de4ed0a | |||
| 0d4073fadb | |||
| ebc70dcb52 | |||
| 4d0426999e | |||
| 286da42573 | |||
| 8a836710a9 | |||
| 5d515bcf33 | |||
| 1c7f6d5133 | |||
| 05d57c7aeb | |||
| e4b0eaf352 | |||
| a710276472 | |||
| af086db671 | |||
| 0d9eb0e25e | |||
| 0616caed6d | |||
| 095337b3c1 | |||
| 1edec2d22c | |||
| affabb9ee0 | |||
| dc27e8711c | |||
| cf7329a264 | |||
| 5ee5ecd820 | |||
| b064f730dd |
+1
-1
Submodule opendbc_repo updated: 06743dfb39...0819b0e8e0
@@ -0,0 +1,198 @@
|
||||
# Live UI
|
||||
|
||||
View a comma device's live sunnypilot UI over Wi-Fi. Replay, ADB, and USB are
|
||||
not used.
|
||||
|
||||
| Mode | Output | Device bridge |
|
||||
| --- | --- | --- |
|
||||
| Mimic (default) | Local UI rendered from live device data | Required |
|
||||
| Exact (`--exact`) | Actual pixels shown on the device | Not required |
|
||||
|
||||
Mimic mode does not directly require SSH, but the device bridge must be started
|
||||
somehow; the examples use SSH. Exact mode, touch control, and `--stop-exact`
|
||||
require key-based SSH access.
|
||||
|
||||
Choose **mimic** when developing or inspecting the local UI with live device
|
||||
data. Choose **exact** when you need to see or control what is physically shown
|
||||
on the device.
|
||||
|
||||
## Before the first run
|
||||
|
||||
1. Replace `192.168.43.1` in the examples if your device uses a different IP.
|
||||
2. Connect the computer and device to networks that can reach each other.
|
||||
3. Run local commands from the sunnypilot repository root.
|
||||
4. For exact mode, verify non-interactive SSH access:
|
||||
|
||||
```bash
|
||||
ssh -o BatchMode=yes comma@192.168.43.1 true
|
||||
```
|
||||
|
||||
The script automatically switches to the repository's `.venv` when present.
|
||||
|
||||
## Mimic UI
|
||||
|
||||
Mimic mode receives live cereal messages and encoded road-camera frames, then
|
||||
renders a new UI instance on the computer. It resembles the device UI but is
|
||||
not a pixel-for-pixel screen mirror.
|
||||
|
||||
Build the messaging bridge once on the computer:
|
||||
|
||||
```bash
|
||||
scons -u cereal/messaging/bridge
|
||||
```
|
||||
|
||||
Use two terminals. In the first, start the bridge on the device and leave it
|
||||
running:
|
||||
|
||||
```bash
|
||||
ssh comma@192.168.43.1
|
||||
./cereal/messaging/bridge
|
||||
```
|
||||
|
||||
In the second terminal, start the local UI:
|
||||
|
||||
```bash
|
||||
BIG=0 ./openpilot/tools/live/ui.py 192.168.43.1
|
||||
```
|
||||
|
||||
`BIG` is inherited from your environment and is not forced by the tool.
|
||||
|
||||
## Exact device screen
|
||||
|
||||
Exact mode streams the actual device display. It does not need either
|
||||
messaging bridge:
|
||||
|
||||
```bash
|
||||
./openpilot/tools/live/ui.py --exact 192.168.43.1
|
||||
```
|
||||
|
||||
The tool runs a temporary capture helper through SSH using AGNOS's existing
|
||||
DRM broker. It does not install software or modify openpilot source on the
|
||||
device. Exact mode requires a compatible AGNOS DRM writeback connector and
|
||||
captures the post-processed display output when that mode is available.
|
||||
|
||||
Exact mode is experimental. Some Qualcomm/AGNOS combinations can time out
|
||||
during DRM writeback, freezing both the mirrored window and physical device UI.
|
||||
This can happen without `--control`; mouse, keyboard, and shortcut forwarding
|
||||
are not required to trigger the capture failure.
|
||||
The tool stops its verified helper when capture stalls, but the kernel display
|
||||
state may require a full device reboot before exact mode can be tried again.
|
||||
Restarting openpilot alone does not reset the display driver.
|
||||
|
||||
Set the capture rate from 1 to 60 FPS; the default is 15:
|
||||
|
||||
```bash
|
||||
./openpilot/tools/live/ui.py --exact --exact-fps 30 192.168.43.1
|
||||
./openpilot/tools/live/ui.py --exact --exact-fps 60 192.168.43.1
|
||||
```
|
||||
|
||||
Start with 15 or 30 FPS. Higher rates use more device CPU and Wi-Fi bandwidth.
|
||||
|
||||
Use `SCALE` to resize the local window:
|
||||
|
||||
```bash
|
||||
SCALE=2 ./openpilot/tools/live/ui.py --exact 192.168.43.1
|
||||
```
|
||||
|
||||
Only one exact session can run at a time.
|
||||
|
||||
## Touch control
|
||||
|
||||
Touch control is available only with exact mode:
|
||||
|
||||
```bash
|
||||
./openpilot/tools/live/ui.py --exact --control 192.168.43.1
|
||||
```
|
||||
|
||||
Left-clicks and drags are forwarded to the physical touchscreen over SSH.
|
||||
These inputs affect the real device, including settings and confirmation
|
||||
buttons.
|
||||
|
||||
When the device's on-screen keyboard is visible, type with the computer
|
||||
keyboard. Letters, numbers, symbols, Space, Backspace, and Return are converted
|
||||
to taps on the device keyboard.
|
||||
|
||||
Exact control also provides simulator-style shortcuts:
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `↓` | Go back with a swipe-down gesture |
|
||||
| `←` | Swipe right |
|
||||
| `→` | Swipe left |
|
||||
| `Command`+`K` (macOS) or `Ctrl`+`K` (Linux/Windows) | Force keyboard forwarding on, or return to automatic detection |
|
||||
|
||||
Hold an arrow key to repeat its gesture until the key is released.
|
||||
|
||||
Escape has no action and does not close the program; use `Ctrl-C` or the window
|
||||
close button to exit. `Command`+`K`/`Ctrl`+`K` enables manual keyboard forwarding
|
||||
regardless of exact-screen resolution; touch locations scale to the captured
|
||||
screen. Automatic keyboard detection targets the 536x240 mici UI. Turn forced
|
||||
forwarding back off after typing so ordinary keys cannot produce unintended
|
||||
taps on incompatible keyboard layouts.
|
||||
|
||||
## Connection status
|
||||
|
||||
Status appears in the window title and terminal:
|
||||
|
||||
- `connected`: mimic telemetry and camera frames, or exact screen frames, are
|
||||
arriving.
|
||||
- `keyboard`: exact-mode keyboard forwarding is currently active. This appears
|
||||
only while the device keyboard is detected or forwarding is forced on.
|
||||
- `no camera`: mimic telemetry is arriving, but road-camera frames are not.
|
||||
- `disconnected`: expected mimic-mode live data has stopped.
|
||||
|
||||
At the default capture rate, exact mode reports a stopped screen stream in
|
||||
about one second. Lower `--exact-fps` values allow more time between frames.
|
||||
If Qualcomm DRM writeback stalls, exact mode immediately stops its verified
|
||||
device helper and exits to avoid leaving the physical display frozen.
|
||||
|
||||
## Stop and clean up
|
||||
|
||||
Press `Ctrl-C` or close the window. If an exact helper remains orphaned, run:
|
||||
|
||||
```bash
|
||||
./openpilot/tools/live/ui.py --stop-exact 192.168.43.1
|
||||
```
|
||||
|
||||
`--kill-exact` is an alias. Stop exact mode before restarting or rebuilding
|
||||
openpilot to avoid blocking the physical UI during a display transition.
|
||||
|
||||
## Options
|
||||
|
||||
```text
|
||||
--exact Show the actual device screen
|
||||
--control Forward mouse and keyboard input; requires --exact
|
||||
--exact-fps FPS Exact capture rate, 1-60 (default: 15)
|
||||
--stop-exact Stop orphaned exact helpers
|
||||
--kill-exact Alias for --stop-exact
|
||||
--ip ADDRESS Alternative to the positional address
|
||||
```
|
||||
|
||||
See the complete command help:
|
||||
|
||||
```bash
|
||||
./openpilot/tools/live/ui.py --help
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **`cereal/messaging/bridge` is not built:** Run:
|
||||
|
||||
```bash
|
||||
scons -u cereal/messaging/bridge
|
||||
```
|
||||
|
||||
- **Mimic is disconnected:** Confirm the device bridge is still running and
|
||||
the IP is reachable.
|
||||
- **Mimic reports no camera:** Confirm the device is publishing
|
||||
`roadEncodeData`. Camera display may also wait briefly for the next keyframe.
|
||||
- **Exact says another session is running:** Close the other exact window. If
|
||||
none is open, run `--stop-exact`.
|
||||
- **Exact cannot connect:** Recheck key-based SSH and the device IP using the
|
||||
command in "Before the first run."
|
||||
- **Exact stalls or the physical UI freezes:** Stop the exact window and run
|
||||
`--stop-exact`. If the device UI remains unstable or exact immediately stalls
|
||||
again, fully reboot the device; restarting openpilot is not sufficient. If
|
||||
the problem returns after reboot, use mimic mode because continuous DRM
|
||||
writeback is not reliable on that device/AGNOS combination. Removing
|
||||
`--control` does not address this capture-layer failure.
|
||||
Executable
+1391
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user