How to send MAC commands from an Application server to debug test devices ?

How to send MAC commands from an Application server to debug test devices ?

During testing of new device firmware, it may be useful to send MAC commands to check the behaviour of the network from an Application server..
Depending on the Connectivity plan associated to the device and the LRC settings, you may need to request specific rights to be able to perform the actions listed below. Do not use this feature for production mode AS communication with devices.


To send MAC commands to the device, use the AS to LRC tunnel interface and transmit the command payload over port 0 (reserved for MAC commands). You need to form the hexadecimal payload yourself, an example shell script is provided below.

Note that the LRC and the network will not attempt to analyse this message, and therefore the internal LRC RF state will not be updated, which may end up with RF inconsistencies. For instance you may change the spreading factor to a value other than the value required by the network (which will result in ADR alarms in the ThingPark wireless device manager application), or you may add uplink channels that are not defined in the network (creating uplink packet loss).

Example script :

 # Port 0 : MAC commands

# Payload :

#       07=NewChannelReq

#       03 : ChIndex

#       84ADD2 : 869.525 MHz (ex LC6)

#       50 : DrRange DR0-DR5 ie SF12-SF7

#       00 : DutyCycle (00=no control)

PayLoad=0703D2AD845000

RES="http://127.0.0.1:8807/sensor/?DevEUI=000000000F1D8693&FPort=0&Payload=${PayLoad}"

TYPE="Content-Type: application/x-www-form-urlencoded"

curl -H "$TYPE" -X POST $RES