... | @@ -212,7 +212,10 @@ To get modem information: |
... | @@ -212,7 +212,10 @@ To get modem information: |
|
|
|
|
|
* Using the command: `mmcli -m any` will display information on all modems installed on the device, in the case of the Librem 5, there is only one.
|
|
* Using the command: `mmcli -m any` will display information on all modems installed on the device, in the case of the Librem 5, there is only one.
|
|
|
|
|
|
But you can also search by modem number, to do that:
|
|
Likewise to get SIM information, you can use the command: `mmcli -i any`
|
|
|
|
That will show you your IMSI, among other pieces of information.
|
|
|
|
|
|
|
|
But you can also search explicitly to get modem indexes and SIM indexes.
|
|
|
|
|
|
* Firstly, `mmcli -L`
|
|
* Firstly, `mmcli -L`
|
|
to list the modems. For example, gives: /org/freedesktop/ModemManager1/Modem/**1**
|
|
to list the modems. For example, gives: /org/freedesktop/ModemManager1/Modem/**1**
|
... | @@ -222,9 +225,64 @@ to list the modems. For example, gives: /org/freedesktop/ModemManager1/Modem/**1 |
... | @@ -222,9 +225,64 @@ to list the modems. For example, gives: /org/freedesktop/ModemManager1/Modem/**1 |
|
* You can also check what mobile network you are on with `mmcli -m M | grep operator`. The operator id comprises three digits for the Mobile Country Code (MCC) followed by two or three digits for the Mobile Network Code (MNC).
|
|
* You can also check what mobile network you are on with `mmcli -m M | grep operator`. The operator id comprises three digits for the Mobile Country Code (MCC) followed by two or three digits for the Mobile Network Code (MNC).
|
|
* The output for the SIM index looks like: SIM | dbus path: /org/freedesktop/ModemManager1/SIM/**1** - so the SIM index is 1.
|
|
* The output for the SIM index looks like: SIM | dbus path: /org/freedesktop/ModemManager1/SIM/**1** - so the SIM index is 1.
|
|
* Finally, `mmcli -i S` where S is replaced with the SIM index.
|
|
* Finally, `mmcli -i S` where S is replaced with the SIM index.
|
|
That will show you your IMSI, among other pieces of information.
|
|
|
|
* `-i` and `-m` are abbreviated forms of `--sim` and `--modem` respectively.
|
|
* `-i` and `-m` are abbreviated forms of `--sim` and `--modem` respectively.
|
|
|
|
|
|
|
|
## Executing an AT command on the modem
|
|
|
|
|
|
|
|
There are two ways of doing this.
|
|
|
|
|
|
|
|
Method A:
|
|
|
|
|
|
|
|
`mmcli` can execute an AT command for you but Modem Manager has to be in "debug" mode for that to work. So:
|
|
|
|
|
|
|
|
change the ExecStart line in the file `/lib/systemd/system/ModemManager.service` by adding
|
|
|
|
`--debug` so that the line looks like this:
|
|
|
|
|
|
|
|
`ExecStart=/usr/sbin/ModemManager --debug`
|
|
|
|
|
|
|
|
After that, run the following commands to make the change take effect:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
sudo systemctl restart ModemManager.service
|
|
|
|
```
|
|
|
|
|
|
|
|
Then Modem Manager should be running in debug mode, and you can execute an AT command on the modem e.g.
|
|
|
|
|
|
|
|
`sudo mmcli -m any --command=ATI`
|
|
|
|
|
|
|
|
The `ATI` command is useful to identify the make and model of modem e.g. what variant of the Broadmobi 818 you have.
|
|
|
|
|
|
|
|
This approach has the advantage that if you want to execute the same command more than once, you can repeat the command in the shell.
|
|
|
|
|
|
|
|
It is _recommended_ that you take Modem Manager out of debug mode once you have finished i.e. revert the change to the file that you edited above and re-execute the two `systemctl` commands.
|
|
|
|
|
|
|
|
Method B:
|
|
|
|
|
|
|
|
You can communicate directly with the modem. This involves installing a program like `minicom`, so do that first:
|
|
|
|
|
|
|
|
`sudo apt install minicom`
|
|
|
|
|
|
|
|
Then `mmcli -m any | grep ttyUSB`
|
|
|
|
|
|
|
|
The output will look like:
|
|
|
|
```
|
|
|
|
| ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at),
|
|
|
|
| ttyUSB3 (at), wwan0 (net)
|
|
|
|
```
|
|
|
|
|
|
|
|
Pick any `ttyUSBn` device that is followed by `(at)` e.g. in the above output 1, 2 and 3 are good to use.
|
|
|
|
|
|
|
|
`sudo minicom -D /dev/ttyUSBn`
|
|
|
|
|
|
|
|
Type Ctrl/A and then E in order to enable local echo.
|
|
|
|
|
|
|
|
Type your AT command(s) e.g.
|
|
|
|
|
|
|
|
`ATI`
|
|
|
|
|
|
|
|
Type Ctrl/A and then X in order to exit from `minicom`.
|
|
|
|
|
|
## Mobile Country Reference Data
|
|
## Mobile Country Reference Data
|
|
|
|
|
|
* Reference data for APNs (used to access the internet on the mobile network) is stored in the directory `/usr/share/mobile-broadband-provider-info`
|
|
* Reference data for APNs (used to access the internet on the mobile network) is stored in the directory `/usr/share/mobile-broadband-provider-info`
|
... | | ... | |