--[ Raspberry Pi and USB LTE Modem ]--
          --[       Sort of HOWTO            ]--

So far today the Raspberry Pi is now trully independent island. 
The package with D-Link Corp. Mobile Connect has been delivered 
to me.

What it is. A LTE modem. With USB connector. One SIM card slot. And
one MicroSD card slot.

The installation was easy. I just inserted SIM and connected the
modem to the RPI via micro USB to USB A.

The SIM connected to the operator mobile network. But the rpi didn't
communicate to the Internet just right.

To find out where if my device I entered:

$ lsusb
Bus 001 Device 003: ID 2001:7e35 D-Link Corp. Mobile Connect
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The modem is there and connected.

Next step was to examine what linux device it provides. This
was done by:

$ dmesg | grep modem
...
[   42.314756] usbserial: USB Serial support registered for GSM modem (1-port)
...
[   42.315565] option 1-1:1.0: GSM modem (1-port) converter detected
[   42.320775] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
...

Now I know the Modem is connected and it found it's place in /dev. It's
now /dev/ttyUSB1.

I wanted to find out what's my operator registrering about the modem.
So the next step was to logon to opeator's web. I could login with
my phone number. But to confirm my access I had to enter the SMS.
How to do it when there is no display on my RPI? Just plain shell.
I did install gammu:

$ sudo apt-get install gammu

Now I knew my modem is on /dev/ttyUSB1 and this had to be configured.
So I used and configured gammu:

$ gammu-config

                  ┌─────────────────────────────────────────┐
                  │ Current Gammu configuration             │
                  │                                         │
                  │  P Port                 (/dev/ttyUSB1)  │
                  │  C Connection           (at)            │
                  │  M Model                ()              │
                  │  D Synchronize time     (no)            │
                  │  F Log file             ()              │
                  │  O Log format           (nothing)       │
                  │  L Use locking          ()              │
                  │  G Gammu localisation   ()              │
                  │  H Help                                 │
                  │  S Save                                 │
                  │                                         │
                  │                                         │
                  │         Ok              Cancel          │
                  │                                         │
                  └─────────────────────────────────────────┘



Now it was easy to get the operator's web sms to verify the SIM card
is mine.
I entered:

$ gammu getallsms

And there it was. My verificatino message:

Location 0, folder "Inbox", SIM memory, Inbox folder
SMS message
SMSC number          : "MY_PHONE_NUM"
Sent                 : Fri 22 Apr 2022 12:51:24  +0200
Coding               : Default GSM alphabet (no compression)
Remote number        : "OPERATOR_NAME"
Status               : Read

To verify use code: MY_CODE

I happily logged onto the operator's web and reviewed the tarif etc.

Now I knew how many data can I burn. And I wanted to get to the 
Internet.

I found out there was a new network interface on my rpi.

I viewed it by:

$ ifconfig

and there is a new wwan0 interface.

I could bring it down and up using:

$ sudo ifconfig wwan0 down

$ sudo ifconfig wwan0 up

But the rpi dind't communicate to the Internet just right now.

I had to use:

$ sudo apt-get install libqmi-utils

And start the network over mobile modem

$ sudo qmi-network /dev/cdc-wdm0 start

That was it. My RPi is now connected to the Internet via USB LTE modem.

Till Next Time