Skip to content

go2 cli#1990

Open
leshy wants to merge 3 commits intodevfrom
ivan/go2cli
Open

go2 cli#1990
leshy wants to merge 3 commits intodevfrom
ivan/go2cli

Conversation

@leshy
Copy link
Copy Markdown
Contributor

@leshy leshy commented May 6, 2026

allows you discover robots

both on your LAN network (find IP)
and via BT (find robots that are not on wifi) and set the wifi settings via BT (no need for app, logins and unbinding, and claude is able to setup a robot for you)

new dep for bluetooth (under go2 extras)
uv sync --all-extras --no-extra dds

dimos go2tool discover
dimos go2tool connect-wifi

Comment thread dimos/robot/unitree/go2/cli/ble.py
Comment thread pyproject.toml
Comment thread dimos/robot/cli/dimos.py Outdated
Comment thread dimos/robot/unitree/go2/cli/landiscovery.py
@dimensionalOS dimensionalOS deleted a comment from greptile-apps Bot May 6, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR adds a dimos go2tool CLI for discovering Unitree Go2 robots on the LAN via UDP multicast and over BLE, and for provisioning Wi-Fi credentials to the robot over Bluetooth without needing the official app.

  • ble.py: Implements the AES-CFB-128 GATT provisioning protocol (reverse-engineered from UniPwn), including BLE scan/discovery, chunked SSID/password writes, and retry helpers.
  • landiscovery.py: Sends a UDP multicast probe to 231.1.1.1:10131 and collects JSON replies; pins the probe to non-tunnel interfaces to avoid Tailscale/VPN route capture.
  • go2tool.py: Typer commands wiring BLE+LAN discovery and connect-wifi provisioning; correctly registers SIGINT/SIGTERM handlers to ensure BlueZ scan sessions are torn down.

Confidence Score: 4/5

Safe to merge with one fix: discover() in landiscovery.py probes interfaces sequentially despite documenting parallel behavior, causing discovery time to scale with interface count.

The BLE provisioning and CLI wiring are well-structured. The LAN discovery has a real behavioral defect: with multiple non-tunnel interfaces the blocking _probe_iface loop multiplies the latency by the number of interfaces, and discover_lan's inter-poll sleep is calculated against a single-interface budget — so on a typical dev machine with wired and wireless interfaces the poll cycle will already be twice as long as documented.

dimos/robot/unitree/go2/cli/landiscovery.py — sequential interface loop in discover() and the downstream sleep math in discover_lan()

Important Files Changed

Filename Overview
dimos/robot/unitree/go2/cli/ble.py New BLE provisioning module: AES-CFB encrypted GATT protocol, BLE scan/discovery, shared asyncio.Event for serial and ACK notifications (race condition noted in prior review)
dimos/robot/unitree/go2/cli/landiscovery.py New LAN multicast discovery module: sequential interface probing mislabeled as parallel in docstring; socket resource leak on setsockopt failure (noted prior); correct timeout handling for Python 3.12+
dimos/robot/unitree/go2/cli/go2tool.py New Typer CLI wiring BLE + LAN discovery and wifi provisioning; clean signal handling for BlueZ scan teardown; all code paths assign target before use
dimos/robot/cli/dimos.py Adds go2tool sub-typer import and registration; two-line change, straightforward
pyproject.toml Adds bleak>=3.0.2 and cryptography>=46.0.5 as mandatory top-level dependencies; minor whitespace fixes

Reviews (3): Last reviewed commit: "removed __init__" | Re-trigger Greptile

Comment thread dimos/robot/unitree/go2/cli/landiscovery.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant