Skip to content

Settings

Settings come from environment variables with the MCARDUPILOT_ prefix, or from a .env file in the working directory. The server and the library read the same ones: a Sitl in a script leases from the same pool and lock directory as the server unless you pass it other Settings.

Environment variableTypeDefaultWhat it does
MCARDUPILOT_ARDUPILOTPath~/ardupilotArduPilot tree; read and run only, never built or edited
MCARDUPILOT_BINARYPath | None<ardupilot>/build/sitl/bin/arduplaneSITL binary; default <ardupilot>/build/sitl/bin/arduplane
MCARDUPILOT_DATA_DIRPath~/.local/share/mcardupilotlease locks, session run directories, kept logs
MCARDUPILOT_INSTANCE_POOLstr (a pool spec)40-59instances this server may lease, "40-59" or "40,41,45-47"
MCARDUPILOT_WAIT_CAP_Sfloat85longest any waiting tool blocks
MCARDUPILOT_SESSION_IDLE_Sfloat1800close a session idle this long
MCARDUPILOT_REAP_INTERVAL_Sfloat30how often idle sessions are checked
MCARDUPILOT_STALL_Sfloat30a session's SITL whose clock stops this long is dead
MCARDUPILOT_LOG_BUDGET_GBfloat20kept dataflash logs prune past this
MCARDUPILOT_BUILD_TREESlist[Path][]trees build_sitl may build, separated by : or , (a patched tree goes here)
MCARDUPILOT_PRESET_DIRSlist[Path][]directories of open_sitl presets (name.json), separated by : or ,; <data_dir>/presets is always searched last
MCARDUPILOT_BUILD_PYTHONPath | NoneNonePython with ArduPilot's build packages (empy 3.3.4 and the rest); default ~/venv-ardupilot if it exists, else python3 on PATH outside this server's venv
MCARDUPILOT_BUILD_DEFAULT_TREEboolTruealso build the ardupilot tree while its checkout is clean
MCARDUPILOT_VIDEO_HOSTstr127.0.0.1where live feeds listen; 0.0.0.0 for the LAN
MCARDUPILOT_VIDEO_PORT_BASEint8400a session's live feed is on this plus its instance
MCARDUPILOT_VIDEO_SIZEstr960x540
MCARDUPILOT_VIDEO_FPSfloat30
MCARDUPILOT_VIDEO_ENCODER"auto" | "h264_nvenc" | "libx264"auto
MCARDUPILOT_VIDEO_FGVIEWboolTruelaunch SITL with --enable-fgview, so live feeds get its pose
MCARDUPILOT_FILM_BLENDERstrblenderBlender 4.2 or later: a command on PATH, a path, or docker:<image> to run one in a container (the image's entrypoint must accept blender's arguments)
MCARDUPILOT_FILM_SIZEstr1280x720
MCARDUPILOT_FILM_ENGINE"eevee" | "cycles"eevee
MCARDUPILOT_FILM_INTRO_Sfloat7a film's establishing shot, seconds; its title card holds for all but the first 1.5 s and the last second
MCARDUPILOT_FILM_OUTRO_Sfloat5a film's end card, seconds: its last frame held under the flight's name, numbers and credits, then down to black
MCARDUPILOT_FILM_UNITS"aviation" | "imperial" | "metric"aviationa film HUD's heights and speeds: aviation (ft, knots, ft/min), imperial (ft, mph, ft/min) or metric (m, m/s)
MCARDUPILOT_FILM_AIRFRAMEPath | NoneNonean airframe description (JSON: STL parts with colours, and rotors that spin with the log) for films; a log whose preset named one uses that instead
MCARDUPILOT_FILM_MESHPath | NoneNonethe airframe as an STL; unset draws a simple quadplane
MCARDUPILOT_FILM_AXESstrx,y,zthe mesh's forward, left and up as signed mesh axes, e.g. -y,-x,z
MCARDUPILOT_FILM_SCALEfloat1mesh units to metres
MCARDUPILOT_FILM_CGstr | NoneNonethe centre of gravity as x,y,z in mesh units; unset is the mesh's centre
MCARDUPILOT_FILM_FACESint60000decimate the mesh to this
MCARDUPILOT_CALLS_DBPath | NoneNonerecord every tool call (mode meta: no arguments or results) to this SQLite file; unset records nothing. Needs mcardupilot[instrumentation]
MCARDUPILOT_CALLS_MODE"meta" | "full"metafull also stores arguments and results (redacted)
MCARDUPILOT_CALLS_RETENTION_DAYSint30
MCARDUPILOT_TRANSPORT"stdio" | "http"stdiostdio for one client; http serves streamable HTTP for a shared deployment
MCARDUPILOT_HTTP_HOSTstr127.0.0.1address the http transport binds
MCARDUPILOT_HTTP_PORTint8374port the http transport listens on

MCARDUPILOT_INSTANCE_POOL takes a range, a list, or both: "40-59", "40,41,45-47". Instances are leased in the order written. The validator refuses three numbers outright:

Instance Why
0 autotest.py always uses it, and takes no lease
14, 15 their MAVLink ports, 5900 and 5910, sit in the range VNC servers use (5900 and up), which is a common clash on a workstation running remote desktops

It also refuses duplicates and numbers so high that SITL’s ports would pass 65535.

Every server and script sharing a machine should share MCARDUPILOT_DATA_DIR, since that is where the lease locks live. Pools may differ between them: list_instances reads every lock file in the directory, in the pool or not.

Path Holds
leases/instance-<n>.lock the flock lease files, one per instance ever leased
sessions/<n>/ a session’s SITL run directory: parameter files, scripts/, sitl.log, sitl.pid, and the live logs/
logs/ kept dataflash logs, held to MCARDUPILOT_LOG_BUDGET_GB, with <name>.BIN.pin beside any pinned one
run/<n>/ the library’s default run root for a Sitl started outside the server
videos/ renders of logs the server does not keep, as <stem>.<layout>.mp4
films/<id>/ a film’s work directory while Blender renders it: the job file, a frame or two, and blender.log. A finished film leaves nothing; a failed one keeps its blender.log to read