Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add adb toggle to developerPanel #34459

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/how-to/connect-to-comma.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ Here's an example command for connecting to your device using its tethered conne

For doing development work on device, it's recommended to use [SSH agent forwarding](https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding).


## ADB

In order to use ADB on your device, you'll need to enable it in the device's settings.

* Enable ADB in your device's settings
* Connect to your device
* `adb shell` over USB
* `adb connect` over WiFi
* Here's an example command for connecting to your device using its tethered connection: `adb connect 192.168.43.1:5555`

> [!NOTE]
> The default port for ADB is 5555 on the comma 3/3X.

For more info on ADB, see the [Android Debug Bridge (ADB) documentation](https://developer.android.com/tools/adb).

### Notes

The public keys are only fetched from your GitHub account once. In order to update your device's authorized keys, you'll need to re-enter your GitHub username.
Expand Down
11 changes: 0 additions & 11 deletions selfdrive/debug/adb.sh

This file was deleted.

12 changes: 12 additions & 0 deletions selfdrive/ui/qt/offroad/developer_panel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
#include "common/util.h"

DeveloperPanel::DeveloperPanel(SettingsWindow *parent) : ListWidget(parent) {
adbToggle = new ParamControl("AdbEnabled", tr("Enable ADB"), "", "");
QObject::connect(adbToggle, &ParamControl::toggleFlipped, [=](bool state) {
params.putBool("AdbEnabled", state);
if (state) {
QProcess::startDetached("sh", {"-c", "setprop service.adb.tcp.port 5555 && sudo systemctl start adbd"});
} else {
QProcess::startDetached("sh", {"-c", "sudo systemctl stop adbd"});
}
adbToggle->refresh();
});
addItem(adbToggle);

// SSH keys
addItem(new SshToggle());
addItem(new SshControl());
Expand Down
1 change: 1 addition & 0 deletions selfdrive/ui/qt/offroad/developer_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class DeveloperPanel : public ListWidget {
ParamControl* joystickToggle;
ParamControl* longManeuverToggle;
ParamControl* alphaLongToggle;
ParamControl* adbToggle;

bool is_release;
bool offroad;
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation>قد يتم الحصول على التحكم الطولي في openpilot في عمليات التحديث المستقبلية.</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation>El control longitudinal de openpilot podrá llegar en futuras actualizaciones.</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation>Le contrôle longitudinal openpilot pourrait être disponible dans une future mise à jour.</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation>openpilotのアクセル制御は、将来のアップデートで利用できる可能性があります。</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">openpilot 가감속 제어는 향후 업데이트에서 지원될 수 있습니다.</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation>O controle longitudinal openpilot poderá vir em uma atualização futura.</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_th.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">ระบบควบคุมการเร่ง/เบรคโดย openpilot อาจมาในการอัปเดตในอนาคต</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_zh-CHS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">openpilot纵向控制可能会在未来的更新中提供。</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/ui/translations/main_zh-CHT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
<source>openpilot longitudinal control may come in a future update.</source>
<translation type="unfinished">openpilot 縱向控制可能會在未來的更新中提供。</translation>
</message>
<message>
<source>Enable ADB</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DevicePanel</name>
Expand Down
Loading