Global WatchGW Docs
Features

DJI Pilot 2 Auto-Bind

DJI Pilot 2 Auto-Bind

Global Watch supports zero-touch binding of DJI enterprise drones to your team workspace. Once your account is set up, you sign in to DJI Pilot 2 → Cloud Services → Open Platform, pick the team, and the drone appears in your fleet — no credentials to type, no manual MQTT configuration.

What "zero-touch" means

  1. Power on the RC Pro (Smart Controller).
  2. Open DJI Pilot 2.
  3. Tap Cloud Services → Open Platform → Sign In and enter your Global Watch credentials.
  4. Pick your team from the list.
  5. The drone appears in your fleet. Telemetry and live video are immediately available.

No SSH. No mosquitto_pub. No copy-paste of broker URLs.

How it works

┌──────────────────┐  1. Sign in (bearer access_token)
│ DJI Pilot 2 H5   ├──────────────────────────────────────┐
│ Cloud Module     │                                       │
│ WebView          │  2. POST /api/dji/cloud-module/       │
│                  │     mqtt-credentials                  ▼
│                  │     { account_id, gateway_sn,    ┌──────────────┐
│                  │       access_token }              │ Global Watch │
│                  │                                   │ (Web)        │
│                  │  3. mqtt_username + mqtt_password │              │
│                  │◀──────────────────────────────────┤              │
│                  │                                   └──────┬───────┘
│                  │                                          │
│                  │  4. MQTT CONNECT (TLS) + update_topo     │
│                  ├──────────────────────────▶ EMQX ──▶ Bridge ──▶ Supabase
└──────────────────┘

When the H5 page finishes the team selection it asks Global Watch for credentials, then asks Pilot 2's loadThing to open the MQTT session with those credentials. Pilot 2 publishes update_topo on thing/product/{sn}/status. The MQTT Bridge receives the message, resolves which Global Watch account owns those credentials, and writes the drone + remote controller into the database. The fleet UI subscribes to the realtime feed and renders the new device instantly.

Security

PropertyHow it's enforced
Only authenticated Pilot 2 sessions can request credentialsThe /api/dji/cloud-module/mqtt-credentials endpoint validates the Pilot 2 bearer access_token against Supabase. Anonymous requests return 401.
Only members of the chosen team can bind a drone to itThe endpoint checks has_permission(user_id, account_id, 'dji.manage'). Requests from users without the permission return 403.
Credentials are tenant-scopedEach (account_id, gateway_sn) gets its own MQTT username/password. The bridge filters by is_active = true so revoked credentials cannot bind to any tenant.
Passwords are returned exactly onceThe plaintext password leaves the server only in the response to the issuance request. The database stores only a hash.
All issuance is auditedThe dji_mqtt_credentials table writes through the existing audit trigger.

Permissions

To bind a drone to a team you need the dji.manage permission on that team. By default this is granted to Admins and Owners. Other roles can view the fleet but cannot bind new devices.

To grant dji.manage to a custom role, see RBAC →.

Troubleshooting

"Sign in failed" in Pilot 2

  • Make sure your team has DJI integration enabled. Check Settings → Integrations in your team workspace.
  • Confirm your account has the dji.manage permission.
  • If you recently reset your password, sign out of Pilot 2 entirely and sign in again.

Drone does not appear after team selection

  • The bind happens within a few seconds. If after 30s the drone is still missing, verify on the RC Pro that Cloud Services shows "Connected".
  • Check the team Activity Log for an dji_credentials_issued audit event. If it's there, credentials were issued — check that EMQX is reachable from the RC's network.
  • If the audit event is missing, the bearer token was rejected. Sign out and back in to Pilot 2.

Drone bound to the wrong team

  • This is prevented by the is_active = true filter on the bridge — only one active credential per gateway per account. If you see this in practice, contact support; it indicates a stale credential row that needs cleanup.

Limitations

  • Mavic 3M only in v1. Dock 2/3 and other Enterprise models are out of scope.
  • One active team per gateway at a time. To move a controller to a different team, the previous credential must be revoked first (UI coming soon).
  • EMQX must be reachable from the RC. Air-gapped operation is not supported.

On this page