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
| Type | How data arrives | Best for |
|---|---|---|
| HTTP | POST JSON to a unique URL with a secret token | Easiest. Anything that can make an HTTP request. |
| UDP | Packets to a port on the drone, as NAME=VALUE lines or JSON | Lowest overhead, trusted local networks. No authentication. |
| Serial | Lines read from a /dev/tty* device | Hard-wired sensors such as an Arduino over USB. |
The type can't be changed after you create the injector.
Create an injector
- Go to Flight Controller → Injectors and select Add injector.
- Enter a Name (only shown in the UI) and pick the Input type.
- Keep MAVLink sysid
1so the values belong to the same vehicle as the flight controller, and MAVLink compid194(user payload) unless you need something else. - Optional: set a Name prefix, for example
BAL_, soRAD1is sent asBAL_RAD1. - For UDP or Serial, fill in the listener settings. Then select Create.
- Select Send test signal on the injector's card to send a value and check it in your ground station.
Send data
- HTTP
- UDP
- Serial
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.
curl -X POST http://192.168.1.50/api/inject/<token> \
-H "Content-Type: application/json" \
-d '{"name":"RAD1","value":0.077}'
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.
The injector listens on Port 14600 and Bind address 0.0.0.0 (all interfaces) by default. Use 127.0.0.1 if the sender runs on the drone itself.
echo "RAD1=0.077" | nc -u -w1 192.168.1.50 14600
import json, socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(json.dumps({"name": "RAD1", "value": 0.077}).encode(), ("192.168.1.50", 14600))
The injector reads newline-terminated lines from Device path (default /dev/ttyUSB0) at Baud rate (default 115200). Each line is one sample: NAME=VALUE for the Key=Value protocol, or a JSON object. It reconnects by itself if the device is unplugged.
void setup() { Serial.begin(115200); }
void loop() {
Serial.print("LIGHT=");
Serial.println(analogRead(A0));
delay(200);
}
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
| Setting | Default | Values | Notes |
|---|---|---|---|
| Name | empty | text | Label in the UI only. |
| Input type | HTTP | HTTP, UDP, Serial | Fixed after creation. |
| Enabled | On | On, off | Off keeps the configuration but stops the listener. |
| MAVLink sysid | 1 | 1–255 | Same as the flight controller groups the values with that vehicle. |
| MAVLink compid | 194 | 0–255 | 194 is common for user payload sensors. |
| Name prefix | empty | up to 8 ASCII characters | Added in front of every signal name. |
| Rate limit (Hz per signal) | 10 | samples per second | Extra 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) | 14600 | 1–65535 | |
| Bind address (UDP) | 0.0.0.0 | IP address | 127.0.0.1 accepts only local senders. |
| Device path (Serial) | /dev/ttyUSB0 | device path | Run ls /dev/tty* to find it. |
| Baud rate (Serial) | 115200 | Must 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.