1. Home
  2. Docs
  3. AWTRIX Documentation
  4. API

API

You can control Awtrix via UDP or MQTT. Some commands consist of the command itself and a payload which is passed, separated by a percentage symbol (%).

UDP With UPD Awtrix listens to the port 52829. Each API command is exactly one UDP packet containing one line.
If you send a known command, Awtrix send “ACK” as a response back to the remoteIP.
The UDP listener is always active.

MQTT
With MQTT Awtrix listens to the Topic “awtrix/com”. If you send a known command, Awtrix send “ACK” to Topic “awtrix/com/response”.
For MQTT the broker connection information must be entered in config.json.

Please note:
The User Datagram Protocol (UDP) is the simplest form of IP data transmission. Data is simply chased off in one direction. UPD does not take care that the data is transmitted without errors. It doesn’t even guarantee the arrival of the packages. This form of data transmission is the fastest and simplest but the ESP8266 is much less busy than with TCP.

COMMANDPAYLOAD EXAMPLE DESCRIPTION UDP MQTT
textSTRING text%Hello World Scroll the given textXX
snakemove0-3snakemove%1Change the Snake direction (0=TOP/1=RIGHT/2=BOTTOM/3=LEFT)X-
settingsget settings%getSend back all Settings as one JSONX-
settingsJSON settings&{"BIG_TIME": "1"} Save all Settings from the given JSON to Flash. You can send any number of settings in a JSONX-
save-save Save all Settings to the flash memoryXX
reset-reset reset AwtrixXX
pongmove0-1000pongmove%500Move the paddle from left to rightX-
next-next Switch to next ApplicationXX
mood0-3mood%2Change the emotion of the virtual petXX
gamemode0-1 gamemode%1 Activate gamingmodeXX
game0-1 game%1Change the Game (0=Snake/1=Pong)XX
colorHEX color%#4286f4 Sets the textcolor to the given payloadXX
bri1-255bri%50Sets the Matrix Brightness to the given payload X X