131 lines
3.5 KiB
Markdown
131 lines
3.5 KiB
Markdown
# Uh Oh
|
|
`uhoh` --- Notes, docs, scripts for Comma AI Three devkit.
|
|
|
|
|
|
Comma AI Three is hardware to connect to a vehicle for use with
|
|
open source `openpilot` AI for "self-driving" cars.
|
|
|
|
* https://comma.ai/
|
|
|
|
* https://github.com/commaai/openpilot
|
|
|
|
|
|
# Docs
|
|
See `docs/` directory for more info.
|
|
|
|
|
|
# Setup
|
|
The default OpenPilot setup requires having accounts with proprietary
|
|
services. This can be worked around.
|
|
|
|
## Setup SSH Without Proprietary Service on Comma Three
|
|
Here is HOWTO connect to a Comma Three device without using proprietary
|
|
services.
|
|
|
|
|
|
|
|
The official CommaAI SSH wiki docs are here, but they note they are not for the
|
|
current version of OpenPilot:
|
|
|
|
* https://github.com/commaai/openpilot/wiki/SSH
|
|
|
|
The CommaAI proxy that OpenPilot uses is, sadly, github.
|
|
This is to be avoided.
|
|
Another set of docs here:
|
|
|
|
* https://ssh.comma.ai/
|
|
|
|
The above docs are reference, but not how it will be performed below.
|
|
The hostname used will be `tici` as that is what the device is named upstream.
|
|
|
|
|
|
This is most easily done with a laptop or similar on the same wifi network
|
|
as the Comma Three.
|
|
|
|
|
|
This needs to be done on a new device, or a device that has been reset
|
|
to factory shipping. When the device boots up, go through all the initial
|
|
steps to get it connected to the Internet via wifi. Stop at the step
|
|
that reads `Choose Software to Install`.
|
|
|
|
|
|
At this point, the Comma Three is on the wifi network, and SSH is running
|
|
with a shared root ssh key by default. Get the device's IP address from
|
|
DHCP logs on the DHCP server (e.g. router/firewall).
|
|
|
|
|
|
On the laptop, set up `~/.ssh/config` thusly, using the device's IP from DHCP
|
|
in place of example `192.168.1.100` below. Either port `22` or port `8022`
|
|
can be used, the device's SSH config has it listening on both:
|
|
|
|
```
|
|
Host tici
|
|
User comma
|
|
Hostname 192.168.1.100
|
|
Identityfile ~/.ssh/key.pem
|
|
Port 22
|
|
```
|
|
|
|
You need to get that SHARED ROOT SSH KEY from github to log into the account:
|
|
|
|
```
|
|
wget -O ~/.ssh/key.pem https://raw.githubusercontent.com/commaai/openpilot/master/tools/ssh/id_rsa
|
|
```
|
|
|
|
Then make sure your SSH permissions are happy:
|
|
|
|
```
|
|
chmod 700 ~/.ssh
|
|
chmod 600 ~/.ssh/key.pem ~/.ssh/config
|
|
```
|
|
|
|
Once that is set up, you should be able to SSH into the device thusly:
|
|
|
|
```
|
|
ssh tici
|
|
```
|
|
|
|
On the device, add your ssh public keys, at the `comma@tici:~$` prompt:
|
|
|
|
```
|
|
mkdir ~/.ssh
|
|
chmod 700 ~/.ssh/
|
|
```
|
|
|
|
Copy over laptop keys a variety of ways, such as from the laptop:
|
|
|
|
```
|
|
scp -p ~/.ssh/id_ed25519.pub tici:.ssh/authorized_keys
|
|
```
|
|
|
|
Note: Doing the OpenPilot install removes these keys, apparently.
|
|
|
|
|
|
Notes on SSH keys before OpenPilot is installed:
|
|
|
|
|
|
```
|
|
root@tici:~# grep ^AuthorizedKeysFile /etc/ssh/sshd_config
|
|
AuthorizedKeysFile /data/params/d/GithubSshKeys
|
|
root@tici:~# cat /data/params/d/GithubSshKeys
|
|
from="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+iXXq30Tq+J5NKat3KWHCzcmwZ55nGh6WggAqECa5CasBlM9VeROpVu3beA+5h0MibRgbD4DMtVXBt6gEvZ8nd04E7eLA9LTZyFDZ7SkSOVj4oXOQsT0GnJmKrASW5KslTWqVzTfo2XCtZ+004ikLxmyFeBO8NOcErW1pa8gFdQDToH9FrA7kgysic/XVESTOoe7XlzRoe/eZacEQ+jtnmFd21A4aEADkk00Ahjr0uKaJiLUAPatxs2icIXWpgYtfqqtaKF23wSt61OTu6cAwXbOWr3m+IUSRUO0IRzEIQS3z1jfd1svgzSgSSwZ1Lhj4AoKxIEAIc8qJrO4uymCJ public
|
|
```
|
|
|
|
|
|
Another way to do this would be to hijack DNS on your own wifi to intercept
|
|
the Comma Three's connection to github, then redirect the connection to
|
|
your own server. It depends if it barfs on the SSL or not.
|
|
|
|
|
|
# Unofficial
|
|
This repository, documentation and code is
|
|
unofficial, unaffiliated with Comma AI.
|
|
|
|
|
|
# License
|
|
GPLv3+.
|
|
|
|
|
|
Copyright (C) 2022, Jeff Moe
|
|
|