Skip to Content

DA Command — Dynamic Actions

SDA and QDA take a template with UC syntax written inline — without occupying a UC slot — render it, and:

  • QDA returns the rendered text (or routes it with ;@DEST), without executing it
  • SDA additionally executes the resulting command on the device

Available since firmware v1.09.25.


What is it for?

Use caseExample
🔍 Query without configuring>QDA $'VBU',4< — read a runtime value built on the fly
Execute and route the response>SDA $SSSXP0| "011";@TRM< — drive an output and send the echo to the serial port
📤 Compose a one-shot report>QDA $Pos:| QCQ,7,20;@GP< — composed text straight to the server
💨 Ephemeral ping>QDA $Alive;@GP!< — goes out if the socket is open, otherwise it is discarded

Syntax

>SDA <plantilla-UC>[;@DEST[!]]< >QDA <plantilla-UC>[;@DEST[!]]<
  • The template uses the same syntax as UC: literal text, $ segments with runtime data, and command segments.
  • The destination is the last ;@ on the line. Without ;@DEST, the response comes back transparently through the channel that asked: >QDA QIO< answers >RIO;...< just like a direct QIO, with no prefix at all.
  • With ;@DEST the output is queued as a report (with queue, ACK and retries) and the local response is RDAOK.
  • With ;@DEST! (ephemeral) there is a single immediate attempt, with no queue: if the channel is down, it is lost.

Destinations

TokenMediumAccepts !
;@TRM / ;@TR0 / ;@TR1 / ;@TR2Serial portsyes (no effect)
;@GP (alias ;@GPRS)Main GPRSyes
;@WI (alias ;@WIF, ;@WIFI)Main WiFiyes
;@BGP / ;@BWIBackup GPRS / WiFiyes
;@BT (alias ;@BTH)Bluetoothyes (no effect)
;@LOG / ;@BACK / ;@ALLFlash log / smart backup / active channelno
;@SM0SMS destination 0 (max. 139 characters, plain text)no
;@XB0..;@XB7Expandersyes

The token is compared in full and is case-sensitive: ;@sm0 or ;@XB9 answer RDAERR DST, they never fall back to a default destination.


Responses and errors

The render echo goes out as is, with no prefix. The status responses are:

ResponseMeaning
RDAOKAccepted. In SDA it means “command recognized and executed”, not “it went well”: the subcommand’s result is not always capturable
RDABUSYThe subcommand was busy after 3 attempts
RDAERR DSTInvalid destination, bare ;@, index out of range, or ! on a destination that does not accept it
RDAERR TPLEmpty template
RDAERR RNDThe render failed
RDAERR OUTThe render contains >, <, CR or LF
RDAERR LENLimits: 200 template and reinjection, 170 queued, 139 SMS, 236 echo
RDAERR CMDVetoed command (see below)
RDAERR NOCMDThe rendered command does not exist
RDAERR MEMOut of memory
RDAERR BUSYAnother SDA/QDA in progress (they do not nest with each other)

⚠️ SDA/QDA is not a security barrier

SDA and QDA execute any command that the channel they arrived through could already execute. They do not filter or ask for extra permissions: a >QDA SRESET< resets the device just like a direct >SRESET<, and a badly written template can turn off the modem or change the APN. Always try with QDA (which only builds the text) before moving on to SDA, and review the template the way you would review the command it is going to generate.

The only things vetoed inside SDA/QDA:

CommandReason
QPW, SPWThey would leave the password in a response routable to third parties
SDA, QDARecursion
QTP, STP, G, GUStack consumption
ACK, SAKWhen reinjected they would sweep the download table

Examples

>QDA QIO< // → >RIO;IGN0;IN1111111;...< (transparent) >QDA $'VBU',4< // → backup voltage, built on the fly >SDA $SSSXP0| "011";@TRM< // executes and routes the echo: >RSSXP0011;ID=...< >QDA $Pos:| QCQ,7,20;@GP< // queues the composed text to the server >QDA $Alive;@GP!< // ephemeral: goes out if there is a socket, otherwise it is lost

Fine details

  • Reserved characters: inside $ segments they are escaped in UPPERCASE hex: \3E (>), \3C (<), \3B (;), \7C (|), \0D/\0A (CR/LF). The comma goes between double quotes in the command segment.
  • If an internal command needs its own ;@, write the ; as \3B: the last ;@ on the line always belongs to SDA/QDA.
  • A > in the template executes ANOTHER command (the parser anchors on the last >): >SDA hola>QID< executes QID.
  • In Wialon mode, queuing plain text to ;@GP/;@WI/;@BGP/;@BWI/;@ALL/;@BACK answers RDAERR DST (the queue only accepts IPS frames). Use ! (ephemeral, wrapped in #D#) or compose a frame that starts with #.
  • Templates to ;@SM0: do not use \XX escapes (the SMS path reinterprets them).
  • From an event engine rule (ACC={QDA ...}) the local response is not emitted: use an explicit ;@DEST.
  • Two simultaneous SDA/QDA through different channels: the second one receives RDAERR BUSY.
  • Nothing persists in NVS and no UC slots are used.

Compatibility

💾Firmware:v1.09.25
SP-IOT
SM-IOT
ZE-IOT

See Also

Last updated