This is the API V2 documentation. To switch out of beta revert back to our API V1.

Open SidemenuDocs
Docs
Close Sidemenu

SIM7600-A Raspberry Pi 4G Hat Setupsim7600-a-raspberry-pi-4g-hat-setup

Prerequisitesprerequisites

  1. 1A Telnyx Portal account and active Telnyx SIM card with data plan. Check out this Quickstart Guide to get set up.
  2. 2Raspberry Pi 3 Model B or Raspberry Pi 4 (this guide will use 4 but the steps are the same).
  3. 3Internet connection for initial setup and configuration.

Alright, let's get started!


Preparationpreparation

First, we are going to start by updating the Raspberry Pi so let's run these commands:

  • sudo apt update -y
  • sudo apt dist-upgrade -y
  • sudo rpi-update
    • You may see a prompt like this. Press Y and press enter:
      wireless_7600_a

Once all of the steps are complete, reboot your Pi using sudo reboot command.

With the updates out of the way, let's start on installing prerequisite software and libraries: libqmi-utils and udhcpc are first up. Install them by running this command: sudo apt 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 HAT and the Pi will have its own IP. This is used to solve IP addressing conflicts between the Pi and the HAT.

Now we will enable UART to communicate with the device. To do that, run this command and then follow the prompts as shown:

  • sudo raspi-config
  • Choose Interfacing Options (5):
    wireless_7600_b
  • Choose P6 Serial:
    wireless_7600_c
  • Press No to the prompt below then Reboot.
    wireless_7600_d

Configurationconfiguration

Next, we're going to configure the SIM7600A module. To turn on the module we will be 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:

  • qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
    • Response: Online or Offline
  • qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength
    • Response: Signal strength and signal quality values
  • 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-qosheader' --wds-start-network="apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD',ip-type=4" --client-no-release-cid

Please replace the username and password field with the username/password that you use for your Pi.

Finally, let's set the default route and IP using udhcpc: sudo udhcpc -i wwan0 And tell the udhcpc library to receive a DHCP lease from the network using WWAN0: ip a s wwan0

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

Was this page helpful?was-this-page-helpful