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.
Mask and stop the services:
$> sudo systemctl disable NetworkManager ModemManager$> sudo systemctl stop NetworkManager ModemManager
Manually run with debug enabled:
$> sudo /usr/sbin/ModemManager --debugOpen 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
You can write sudo mmcli -m
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
The commands which includes a string uses double quotation marks for that string. Example sudo mmcli -m