Skip to main content

Injectors

An injector feeds data from outside UAVcast-Pro, such as a Python script, an Arduino or a sensor on the network, into the MAVLink stream as NAMED_VALUE_FLOAT (or NAMED_VALUE_INT) messages. Every connected ground station receives the values as normal telemetry: Mission Planner shows them in the Status tab and QGroundControl in the MAVLink Inspector. They also appear automatically in Data Streams dashboards. Open Flight Controller → Injectors.

Typical uses: radiation, gas or weather sensors on the companion computer, LTE signal values (RSRP, SINR) for link monitoring, or values your own scripts compute.

Pick a transport​

TypeHow data arrivesBest for
HTTPPOST JSON to a unique URL with a secret tokenEasiest. Anything that can make an HTTP request.
UDPPackets to a port on the drone, as NAME=VALUE lines or JSONLowest overhead, trusted local networks. No authentication.
SerialLines read from a /dev/tty* deviceHard-wired sensors such as an Arduino over USB.

The type can't be changed after you create the injector.

Create an injector​

  1. Go to Flight Controller → Injectors and select Add injector.
  2. Enter a Name (only shown in the UI) and pick the Input type.
  3. Keep MAVLink sysid 1 so the values belong to the same vehicle as the flight controller, and MAVLink compid 194 (user payload) unless you need something else.
  4. Optional: set a Name prefix, for example BAL_, so RAD1 is sent as BAL_RAD1.
  5. For UDP or Serial, fill in the listener settings. Then select Create.
  6. Select Send test signal on the injector's card to send a value and check it in your ground station.
Flight Controller → Injectors before the first injector: typical uses and the three transports.

Send data​

After you create an HTTP injector, its card shows the HTTP endpoint. The URL has the form http://<drone-ip>/api/inject/<token> and goes through the normal web interface port. Copy URL copies it.

One valueTerminal
curl -X POST http://192.168.1.50/api/inject/<token> \
-H "Content-Type: application/json" \
-d '{"name":"RAD1","value":0.077}'
Several values in one requestTerminal
curl -X POST http://192.168.1.50/api/inject/<token> \
-H "Content-Type: application/json" \
-d '{"samples":[{"name":"TEMP","value":21.4},{"name":"HUM","value":48}]}'

The reply counts what happened: {"accepted":2,"rateLimited":0,"rejected":0}. The token is the only protection. If it leaks, select Rotate token and update your client.

MAVLink names are 10 characters

NAMED_VALUE_FLOAT names are limited to 10 characters, prefix included. Keep the prefix short (up to 8 characters) and the names compact.

Settings reference​

SettingDefaultValuesNotes
NameemptytextLabel in the UI only.
Input typeHTTPHTTP, UDP, SerialFixed after creation.
EnabledOnOn, offOff keeps the configuration but stops the listener.
MAVLink sysid11–255Same as the flight controller groups the values with that vehicle.
MAVLink compid1940–255194 is common for user payload sensors.
Name prefixemptyup to 8 ASCII charactersAdded in front of every signal name.
Rate limit (Hz per signal)10samples per secondExtra samples are dropped and counted as Rate-limited. Protects the link from a runaway sender.
Protocol (UDP, Serial)Key=Value (line-delimited)Key=Value (line-delimited), JSON ({name, value})
Port (UDP)146001–65535
Bind address (UDP)0.0.0.0IP address127.0.0.1 accepts only local senders.
Device path (Serial)/dev/ttyUSB0device pathRun ls /dev/tty* to find it.
Baud rate (Serial)115200Must match the sender.

Each card shows Accepted, Rate-limited and Rejected counters, so you can see whether data arrives and whether it's valid.

Injectors run inside the UAVcast-Pro services and start at boot, so values keep flowing without the web interface open.

3 min readUAVcast-Pro
Edit