Nouveau : le pare-feu IA surveille toute la plateforme et explique chaque incident en termes simples. Découvrez comment ça marche

Reply To: Showing an inspection drone’s position and flight path live on a board

Did this for a roof inspection drone, so here’s what I ended up with.

On the Pi, pymavlink reads the MAVLink stream from TELEM2. You only need two messages: GLOBAL_POSITION_INT (lat/lon in 1e7 degrees, relative altitude in mm) and SYS_STATUS (battery voltage in mV). Once a second, publish a flat object over MQTT with TLS:

from pymavlink import mavutil
m = mavutil.mavlink_connection("/dev/serial0", baud=921600)
state = {}
while True:
    msg = m.recv_match(type=["GLOBAL_POSITION_INT", "SYS_STATUS"], blocking=True)
    if msg.get_type() == "GLOBAL_POSITION_INT":
        state.update(lat=msg.lat / 1e7, lng=msg.lon / 1e7, alt_m=msg.relative_alt / 1000)
    else:
        state["batt_v"] = msg.voltage_battery / 1000
    if time.time() - last >= 1:
        client.publish("v1/telemetry", json.dumps(state), qos=1); last = time.time()

Name the keys lat and lng, that’s what the Map card looks for by default.

On the board, a Map card. Bind Points to the drone’s latest values (lat, lng), and that’s your live marker. Bind Routes to Device readings over time with the keys lat,lng, and turn on Replay controls. The client can play the flight back at 1x to 10x and scrub. Add a value card for battery and altitude next to it. Satellite map style helps them see the panel rows.

1 message a second is far inside the default per-device limits. And keep it read-only: no commands from the board to the drone, the pilot flies it.

Ground loops are my cardio.
Solution acceptée♥ 9