This post is intended to show how to set up a data connection over SIM7600 with Raspberry pi using QMI protocol.

QMI is a binary protocol designed to replace the AT command based communication with modems, and is available in devices with Qualcomm chipsets.

 

 

The library libqmi-utils installs libraries that allow you to interact with Qualcomm-based modems. SIM7600 comes with a Qualcomm MDM9607 chipset. udhcpc is used for modem DHCP leasing.

 

Test Setup

 

  • The modem can be powered using a '''5-12V/9V 1A''' adapter to the power jack provided on the modem. The voltage regulator regulates the voltage to 3.6 V.
  • Switch on the modem using the ON/OFF switch provided, note when you switch on, the Power LED will glow. It shows that the modem has got the power required for its operation. After 2 or 3 seconds, the Status LED, Network LED, Ring LED will be ON and remains constant.
  • Connect the DATA1 and DATA2  port  of the modem to the USB ports of Raspberry pi using a micro USB cable.
    • DATA1 - AT command port for accessing  AT commands.
    • DATA2– Data  serial  port for  accessing  Internet, Audio, Calling and SMS, GPS.
  • Insert the Jio 4g SIM card in the SIM slot of the modem.

Note:- When you insert the SIM, the network led( blue led) starts blinking after 1 or 2 seconds, that means the modem is  registered with the network.

 

Switching the SIM7600 to WAN mode

 

SIM7600 supports Wan mode and LAN mode. Customer can use AT command to change the mode. For sharing the internet to raspberry pi, the Wan mode has to be used.


AT commands can be send to the 4G modem for changing the network mode through the AT command port.


GTK Term is a  terminal like PuTTY for communicating with serial port of the raspberry pi.
The link to download GTK Term is given below:

https://sourceforge.net/projects/gtkterm/

 

Extract the zip file , then install the gtk term using the following command:

 

sudo apt-get install gtkterm

 

Run the gtkterm  using the following command:

 

gtkterm

 

Click Configuration, then select the Port in which the data port is connected, here it is /dev/ttyUSB0 and Speed is 115200(baud rate).

 

Note: If you want to know in which port you are connected, run the command dmesg in the pi terminal.

 

 

By default the SIM7600 PID is 9001 and the PID configuration is 9001:Diag, NMEA, At, Modem, Audio, Rmnet. You can check the current PID value by using

 

AT+CUSBPIDSWITCH?

 

If the response is 9001, no need to change the mode or if it is different PID value you can change the PID to 9001 by using

 

AT+CUSBPIDSWITCH =9001,1,1
OK

 

SIM7600E Module works in wan mode by default. You can check the current mode using

 

AT+CLANMODE?

 

Module should respond with

 

OK, 1

 

If the module is not in Wan mode then the mode can be switched using the following command.

 

AT+CLANMODE=1

 

After running this command, modem will restart automatically, then the modem will work in wan mode.

 

LAN9730 is not opened in default, if want to open the LAN9730, you can run
AT+CENABLELAN=1 After run this command, the modem will restart automatically, then the LAN9730 will be opened.

 

 

 

 

Preparing SIM7600 for QMI connectivity

 

QMI protocol is easily accessible in recent enough Linux kernels (>= 3.4), through the cdc-wdm and qmi_wwan drivers. Once these drivers are in place and the modem gets plugged in, the kernel will expose a new /dev/cdc-wdm device which can talk QMI, along with a wwan interface associated to each QMI port.

First, we are going to start by updating the Raspberry Pi by

 

sudo apt-get update

 

Then we are going to install two libraries: libqmi-utils and udhcp by running this command

 

sudo apt-get install libqmi-utils udhcpc

 

libqmi-utils installs libraries that allow you to interact with Qualcomm-based modems. SIM7600 comes with a Qualcomm MDM9607 chipset. udhcpc is used for modem DHCP leasing. The cellular network gives a unique IP to the 4G modem and the Pi will have its own IP. This is used to solve IP addressing conflicts between the Pi and the modem.

To verify that you have installed the qmi_wwan driver ,use the following command:

 

lsusb –t

 

 

Configuration of the SIM7600 module

 

Next, we're going to configure the SIM7600 modem ,for that we are using the qmicli commands which are used to control Qualcomm devices. This command will activate the device:

 

sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online'

 

Now let's verify that the module is online. These are sample commands you can send to the device:

 

  • sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
    • Response: Online or Offline
  • sudo qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength
    • Response: Signal strength and signal quality values
  • sudo qmicli -d /dev/cdc-wdm0 --nas-get-home-network
    • Response: Carrier name or carrier PLMN

You should now see a WWAN0 interface in net-stats (ifconfig). Unless specified by user, WWAN0 is the default interface this device uses.


We're now going to configure the module to use raw-ip protocol with the following commands:

 

  • sudo ip link set wwan0 down
  • echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip
  • sudo ip link set wwan0 up

 

And connecting to a mobile network:

 

sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='jionet',ip-type=4" --client-no-release-cid

 

Finally, let's set the default route and IP using udhcpc:

 

sudo udhcpc -i wwan0

 

You are connected to the Internet! Open up your web browser and browse away!