How to send AT commands through ModemManager

Question

When trying to send AT commands in ModemManager I get the following error:

"Cannot send AT command to modem: operation only allowed in debug mode"

Solution

AT commands can only be sent to your cellular modem when you're running ModemManager in debug mode. This FAQ will show you how this is done as well as explain some syntax standards.

To set ModemManager into debug mode you will first have to stop the process. This needs to be done for NetworkManager as well because NetworkManager runs ModemManager as a child process.

  1. Mask and stop the services:

    $> sudo systemctl disable NetworkManager ModemManager

    $> sudo systemctl stop NetworkManager ModemManager

  2. Manually run with debug enabled:

    $> sudo /usr/sbin/ModemManager --debug

  3. Open a new terminal, find the modem index and send the AT command:

    $> sudo mmcli -m --command="ATI" (mmcli -L to find the index)

If you write a command without the prefix it will automatically put an "AT" right before it. So sudo mmcli -m --command="cgmr" will send "ATcgmr". This will result in an error obviously, but you could send sudo mmcli -m --command="i" which will send "ATi" which is a supported command.

You can write sudo mmcli -m --command="AT" and it will send "AT" and not "ATAT". The same will not work for a lowercase "at"

To send a command you should therefore either write out the whole command as "AT+CGMR" or "+CGMR".

Sierra Wireless syntax

Sierra Wireless specific commands that uses the prefix ! has a specific way in which the command needs to be written. Instead of enclosing the command in " " you now need to use single quotation marks ' ' instead. 

The beginning of the command follow the same convention as above. So for example one can write sudo mmcli -m --command='AT!impref?' or sudo mmcli -m --command='!impref?'.

The commands which includes a string uses double quotation marks for that string. Example sudo mmcli -m --command='AT!entercnd="A710"'.

Recent FAQ

Shopping cart

No items added yet

Check out our products and product categories

Continue to products