Connect a vehicle

A link is how UXDuck reaches a vehicle: a USB cable, a telemetry radio or the network.

Found by itself

Open Connect a vehicle. A flight controller on USB, a simulator on this computer or a vehicle's Wi-Fi shows up with Connect. Nothing connects until you press it. From a terminal:

uxduck find
uxduck find --all-serial
uxduck find --network

USB or a telemetry radio

  1. On Home, choose USB or serial.
  2. Pick the Device (such as /dev/ttyACM0 or COM3) and the Baud rate (115200 for USB, usually 57600 for a radio).
  3. Choose Add link. The vehicle appears in the sidebar.

Over the network

  1. On Home, choose Network.
  2. Pick how the vehicle reaches you:
  • UDP listener on port 15010: the vehicle sends to this computer.
  • UDP client: the vehicle is behind a UDP server, such as a Wi-Fi telemetry bridge or mavlink-router. Give its address, such as 192.168.4.1 and port 14550.
  • TCP client: a TCP server, such as SITL on port 5760.
  • TCP listener: the vehicle or a companion computer connects to this computer. Each connection is its own vehicle.
  1. Choose Add link.

From a terminal instead:

uxduck rpc call link/add --json '{"kind":{"type":"udp-listen","host":"0.0.0.0","port":15010}}'

Forward to another ground station

Add a Forward to a program link, such as Mission Planner on 127.0.0.1:14550.

On a Raspberry Pi beside a radio, without a window:

uxduck forward --in serial:/dev/ttyAMA0@57600 --out udp:192.168.1.20:15010

--in also takes udpout:HOST:PORT (a UDP server), tcp:HOST:PORT and tcpin:HOST:PORT (listens for TCP).

See how a computer on the vehicle is doing

When the Pi is on the vehicle, add --onboard:

uxduck forward --in serial:/dev/ttyAMA0@57600 --out udp:192.168.1.20:15010 --onboard

Once a second it sends its CPU temperature, CPU use, memory, storage and uptime over MAVLink with the vehicle's telemetry, so no SSH is needed. The vehicle's page lists it under Companion computers; a computer that stops answering is greyed. Temperatures follow your units in Settings.

A second computer that carries no vehicle traffic, such as a Pi for vision, only reports:

uxduck companion --to udp:192.168.1.20:15010 --computer-id 192

Each computer on a vehicle needs its own number from 191 to 194. The forwarding Pi takes 191 unless you give it --computer-id; give each companion the next one. Add --system-id when the vehicle's system id is not 1.

When a computer is added on the vehicle's page, its check reads the number its uxduck companion or uxduck forward --onboard was given. Its card then shows the readings sent under that number, whatever order the computers were added in.

Each computer's Clock shows how far its clock is from this computer's, such as "8 days 6 h behind this computer", and how UXDuck measured it. UXDuck asks each computer for its time over MAVLink, and the answer is good to within half the time the question took there and back, usually under a millisecond on a LAN. A computer that does not answer, such as one running an older UXDuck, is read from the time on its status messages. That is said to be one way, because the delay on the way is not known.

A computer whose clock nothing keeps, such as a Raspberry Pi with no clock battery and no time server it can reach, starts from the last time it saved each time it is switched on. It falls behind by every hour it was off. UXDuck on it then asks this computer for its time the same way and sets its own clock to it. After that it corrects the drift once a minute by running its clock a little faster or slower, so the clock never jumps back. This computer answers while UXDuck sends the vehicle its heartbeat, so while a UXDuck window is open or someone is in control remotely. Setting the clock needs the CAP_SYS_TIME capability: when UXDuck runs as a systemd service under its own user, add AmbientCapabilities=CAP_SYS_TIME to the service's [Service] section. A clock that systemd-timesyncd, chrony or another time service keeps is never changed.

On Fleet, each link has a switch and a pencil. The switch turns a link off or on without removing it. The pencil opens the link's settings in place: change its port, device, access or name and choose Save. Remove is in the settings.

From a terminal:

uxduck rpc call link/update --json '{"id":"<link id>","kind":{"type":"udp-listen","host":"0.0.0.0","port":15011}}'
uxduck rpc call link/disable --json '{"id":"<link id>"}'
uxduck rpc call link/enable --json '{"id":"<link id>"}'

When nobody is watching

UXDuck sends each vehicle a ground station heartbeat. If no UXDuck window is open and nobody is in control remotely, it stops after 10 s (Settings › UXDuck on this computer), and a vehicle whose lost ground station failsafe is on does what it is set to do, such as return to launch. Keep a window open while flying.