Status Text messages - just a thought

I am working on a telemetry project which is a translator for Mavlink->FrSky using Teensy micro processor. The project provides not only visual telemetry but also calls out status text voice messages. Due to the low bandwidth on the SmartPort telemetry, the project originally opted to transfer these messages by assigning a number to each unique message, and have a corresponding wav file on the Taranis play when it received each number. I noticed since the release of 3.4 that many of the messages no longer play (the current code was written with 3.3 in mind). So today I started investigating the mechanism used in the code to call these messages out, and also figured out how the former dev on the project managed to determine what all the different status text messages are and how he managed to pull them into the teensy code.

He wrote a shell script to egrep through every AP file, scraping out all of the status text messages, severities etc, then another script to assigning the numbers, and generating the voice files using the voices provided on a mac. So in my investigations it made me realise that all of the status text messages are spread all over the place in AP - which made me wonder why it is done this way - hence my question on the dev forum.

Sorry if I come over as being naive, as I really haven’t taken a dive into the code until today, so I only have an overview of it so far, but this is my thought: I appreciate that status text messages will be triggered from every area of the code (almost), but what I can’t quite understand is why individual text messages are specified directly within the source code files - why not instead consolidate all the text messages in a language file (maybe an xml or csv file etc, and have the triggering code simply reference the relevant text entry in the language file (which would just pass a message ID parameter) instead? This way we would always have a language file containing a dictionary of every status text message used by AP. Maybe one consolidated collection of text messages for every version of AP. It would also mean different language files could be produced with translations.

The bottom line for me, is that it would always provide a single place for me to reference messages, instead of have scraper scripts to trawl folders of files dragging them out.


I’m one of the guys that went egreping the source files at the time (still have the excel files that we compiled) :slight_smile: At the time (and now) that’s the only way. There is a issue opened to redo the messaging structure, but it’s a long term goal…

edit: this issue

As someone pointed out on another thread, Mavlink is a binary protocol and sending text doesnt really fit. As far as I can see, in ArduPilot, the text is always sent as a 50 or so byte string (I could be wrong, so stand to be corrected if it is truncated to the actual length of the string) which is a huge waste of bandwidth.

Sending an id only is in my opinion the right way to do this. The original rationale behind status_text really I suspect is that it is convenient for debugging and was so convenient that it started to creep into non-debugging use.

Logically, if you go down the route of looking up the text from an id, then there is no point in sending the text at all. Just send the ID. This saves bandwidth and makes everything more deterministic.

For any severity greater than critical, the status text messages arent guaranteed to be sent at all historically unless there is bandwidth, so relying on them is not a good idea.

I would prefer a message from the GCS to say, please dont send me text messages, just send me text IDs from now on,
or even Please turn on/off debugging info.

EDIT: And of course if you start sending the ID only it begs the question . What is so important that it isnt being sent already?