Skip to content

Configuration files

Everything you change in the suite is kept in two files on the radio's SD card, under /SCRIPTS/RFSUITE/user/:

File What is in it
preferences.lua The settings that belong to the transmitter: the announcements, the units and language, the preview switches, the logging level, which dashboard theme is shown and whether a model may override it.
<mcu id>.lua The settings that belong to one flight controller, named after the board's own id — the battery, the per-model theme override and its configuration, the in-flight tuning setup, and the name the board calls itself by. One file per board.

You do not have to touch either of them. They are written when you press Save, and reading them is all the suite needs at startup.

Which file belongs to which helicopter

A per-flight-controller file is named after the board's own id, which is a long hexadecimal number and tells you nothing about the machine it is bolted into. So the suite writes the model name the flight controller reports into the file as well, the first time it connects to a board with the configuration tool open or with the background telemetry decoder running:

  craft = {
    name = "Goblin 630",
  },

That is the name set in the flight controller — the one the Synchronize Model Name setting puts on the radio's model — and not the name of the radio model. It is written again whenever it changes, and not otherwise.

A flight controller that has no name set gets no such line. The suite does not invent one, because a placeholder in the file could not be told apart from a helicopter actually called that, and it would then never be corrected. So a file without a craft block simply belongs to a board that has not been given a name.

They are Lua, not INI

Both files are a small Lua program that returns a table, so the radio can read one without picking it apart line by line:

-- RFSuite preferences. This file is Lua data, not an INI: strings keep their
-- quotes, booleans are true or false, and the return line stays. Rewritten whole on save.
return {
  general = {
    debug_level = "off",
    save_confirm = true,
  },
  localizations = {
    temperature_unit = 0,
  },
}
-- generation 7 ......

That matters for what a widget costs. The dashboard re-reads the settings whenever they change, inside a call the radio stops at a fixed instruction count — and taking a file apart line by line is by far the most expensive thing it did there. Reading a real 88-key settings file used to cost about half of everything one dashboard call is allowed; it now costs a sixteenth of it, and it no longer grows meaningfully with each setting a release adds.

Editing one by hand

It is a text file and you may edit it, with the radio switched off or the tool closed. Three rules, and they are the ones Lua enforces:

  • Text needs quotes: debug_level = "info". A bare word is read as a name and there is nothing for it to name.
  • Yes and no are true and false, without quotes. Numbers are written plainly: 30, 3.2.
  • Keep the frame: the return { at the top, the } at the bottom, and a comma after every entry.

The file is rewritten whole on the next save, so a comment you add to it does not survive and a setting the suite does not know about is dropped. The -- generation line at the end is the suite's own; it changes on every save so that the dashboard can see that something was written.

If a hand edit breaks the file, nothing is lost and nothing crashes: the suite falls back to its built-in defaults for that file, writes the reason and the line number to the log, and the next save replaces the file with a correct one. The one thing to know is that the settings that were in it are then gone — so keep a copy before editing.

The developer section

preferences.lua may carry a developer section that no page writes. Its values are put there by hand, and a save keeps whatever the section holds.

  developer = {
    precompile = false,
  },
  • precompile — whether the suite compiles its installed files ahead of use. Absent or true is the normal behaviour: after an install or an update the configuration tool's start screen, or the dashboard's connection splash if the dashboard starts first, reads Preparing suite until every file has its compiled copy beside it, so no page pays for that later. The dashboard and the tool connect to the flight controller only once that has finished; when the tool is opened from the dashboard meanwhile, its start screen shows the same pass rather than starting another. After an install or an update the dashboard then reads Suite updated. Please restart the radio. and does not connect until the radio has been restarted, and the tool shows the same request once when its start screen closes: what was loaded before the pass is still the previous build's code, and only a restart replaces it. This applies to an install made from the release archive, which carries the build identity; a source tree copied by hand is compiled by the tool once per version but never holds the dashboard back. Once the installed files are compiled, later starts of the tool, from the dashboard or from the radio's tools menu, open straight on the menu -- or on the page a dashboard shortcut asked for -- without looking at the files again, and connect behind it. A file edited on the card afterwards is compiled the first time a page loads it, which makes that opening slower once. false skips this in both places: the tool opens without a start screen and the splash waits for the connection only, and each file is compiled the first time a page needs it, which makes that first opening slower. It is meant for automated test runs on a card that starts without compiled files every time; on a radio there is no reason to set it. "full" makes every start of the tool look at every installed file and compile the ones that are missing their compiled copy or are newer than it, before it connects and before the start screen leaves. That holds every start for as long as the look takes, and is meant for someone editing the suite's files on the card.
  • mspexpbytes — how many bytes the developer page MSP Experiments edits. Absent means 16, which is also the most it handles. Like precompile it is only read, and set by hand.

Coming from an earlier release

Earlier releases kept the same settings in preferences.ini and <mcu id>.ini, and the model names in model_name_restore.ini. The files are brought across the first time the configuration tool is started, or by the background telemetry decoder on a radio that runs it. Until one of those has happened, the former file is read exactly as it was before and nothing is written — so a radio that is switched on and flown without opening the tool behaves as it always did, and the settings are there either way.

What the migration does:

  • the values are read out of the .ini and written into the .lua beside it,
  • the .ini is kept, renamed to .ini.bak, for one release,
  • settings that no longer exist in the suite are not carried over — that is deliberate, and it is what stops a file from growing for ever. A whole section that no longer exists goes the same way: an older preferences.ini may still carry [audio_switches] and [audio_timer], and neither is written into the new file,
  • a preferences.luac left behind by an earlier loader is deleted, because the radio would prefer that stale compiled copy to the file you can read.

There is nothing to do and nothing to confirm. You can delete the .ini.bak files once you are happy; the suite never reads them again.

The dashboard widget does not do the migration itself, and that is deliberate: the radio stops a widget after a fixed amount of work, and reading a settings file in the old format is more than that allowance — so a widget that tried would be stopped half way, every time, and never finish. The tool and the background decoder are not stopped that way.

The move to /SCRIPTS/RFSUITE/

An earlier release kept these files in /SCRIPTS/TOOLS/rfsuite.user/ and its program in /SCRIPTS/TOOLS/rfsuite-core/. If you update by unpacking the archive over your card, the suite copies your data over by itself on the first start:

  • Preparing suite stays on the screen and the connection to the flight controller waits until the copy is through, then the radio asks for a restart. From that start on the new folder counts. Until you restart, the tool closes after that request and opens no page, because what you saved now would go to the old folder.
  • Copied: preferences, the file of each flight controller with its in-flight baseline, model_name_restore, precompiled.txt, and the folders dashboard, flightlog, tune, journal and sim. Not copied: the debug logs in logs, reload.req, and any file of your own in that folder.
  • Every file is read back and compared. If you switch off during the copy, the next start copies again.
  • If the copy fails, for instance because the card is full, you keep flying on the old folder. The tool says once after it opens Settings not moved: card full? Please restart the radio., and each start tries again without holding up the connection. Once such a try has gone through, the first start after you switch the radio off and on copies once more and asks for the restart.
  • The suite never deletes the old folders. Once you have checked your settings, you can delete /SCRIPTS/TOOLS/rfsuite-core/ and /SCRIPTS/TOOLS/rfsuite.user/ yourself. The RFSuite Updater removes the old program folder when it installs.
  • Going back to an earlier release finds the old folder as it was at the move. What you changed there does not come along when you update again.
  • The copy is part of the suite only for a limited time. A card that skips those releases starts with default settings, with its data still in the old folder; copy the files over by hand then.
  • With precompile = false in the developer section the copy does not run, and the suite stays on the old folder.

The other files beside them

  • journal/<mcu id>.lua — the append-only change journal, recording each value committed by the Tune Advisor.
  • tune/<mcu id>.lua — the Tune Advisor's saved flights, the last 5 per PID and rate profile and at most 20 in all, written by the dashboard or the service widget after each disarm. Lua data read with an environment of its own, never run as a script: a version line v(1), then one f(...) line per flight and axis, and a c(time, seconds) line after a flight whose reading also holds the saved flight with that time and flight time (the page leaves that one out). Each save writes <mcu id>.lua.new beside it, checks its size and renames it into place, keeping the previous file as <mcu id>.lua.bak until the next save. If a save is cut short after the old file was renamed to .bak and before the new one was in place, the flights are read from the .bak and the next save writes them back. Deleting the file and its .bak, or * on the page, forgets the flights.
  • flightlog/batteries.cfg — the Flight Log's battery registry, one pack per line, kept by hand or from the page. It is saved the same way as the Tune Advisor's flights, with the previous version kept as batteries.cfg.bak. If a save is cut short after the old file was renamed to .bak and before the new one was in place, the registry is read from the .bak and the next edit or counted flight writes it back. To start an empty registry, delete the file and its .bak. The dashboard's battery prompt reads it a dozen lines per widget call, so a long registry does not hold the dashboard up.
  • eload.req — a few bytes the tool writes when you save, so the dashboard widget, the service widget and the background decoder know to re-read the settings. Unchanged by the move to Lua files. Do not delete it while the suite is running.
  • model_name_restore.lua — the model names the suite has renamed while a craft was connected and has to put back afterwards, one entry per model of the radio, named after the model file it belongs to. The same Lua data as the two above, written and read the same way, and a card from an earlier release has its model_name_restore.ini brought across on the first read with the same .ini.bak left beside it. It is a file of its own rather than a section of preferences.lua because it is written while you fly, and every write to preferences.lua makes the dashboard re-read its settings.
  • precompiled.txt — which installed build was last compiled, written when Preparing suite finishes, whether the tool or the dashboard ran it. A later start compiles everything again only when the installed build differs from it, so deleting it costs one slower start and nothing else. The dashboard and the tool read only this file and the build identity beside the core: on a build already compiled they do no further work and connect at once. A single source edited on the card is compiled the first time a page loads it, unless precompile = "full" makes the tool's start look at every file. On a fresh card where nothing has been saved yet, the tool creates this folder to write it. The pass leaves out the ._ files macOS writes beside every file it copies onto a card, and a file that does not compile is named in the log, once per start.
  • theme_slots.txt — the radio theme's colours while the tool is open, written when it opens and deleted when it closes: the tool draws the radio's own controls in the suite's color scheme and puts the theme's colours back on the way out. Found later, it means a tool ended without that (memory exhausted, say). The dashboard, once it is shown again, puts the colours back and deletes it; the next start of the tool keeps the colours it holds and puts them back when that tool closes. A radio theme applied since is left alone either way. Deleting it by hand loses nothing a restart of the radio would not put back.
  • preferences.lua.tmp, <mcu id>.lua.tmp or model_name_restore.lua.tmp — a save that was interrupted, by a power cut at exactly the wrong moment. The next read finishes it; you should never see one for long. If a write fails or the card is full, the temporary file is removed immediately and the existing configuration is kept intact.