How to setup USB GPRS

Example instructions for setting up USB-type GPRS modems with Raspberry Shake.

Warning

This solution will work from v0.9+

Warning

There are many types of 3G modems/ dongles and each of their installations/ configurations is completely different. These examples will serve to give you an idea what needs to be done. You will have to Google your way to success.

Example 2: Huawei Mobile Broadband Mobile Wifi Smart E82778

Step 0: Plug the GPRS modem into the USB port on the Raspberry Pi computer

Step 1: ssh into your Raspberry Shake

Step 2: Determine what USB devices are connected and confirm you see GPRS modem

$ lsusb

Example output:

Bus 001 Device 005: ID 12d1:14fe Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 1951:1000 Hyperstone AG
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

In this example, Bus 001 Device 005 is what is of interest to us. Note the Huawei at 12d1:14fe.

Step 3: Now we try to set the Huawei as wwan0 device (there’s a lot of ways to do that) we should use:

$ sudo usb_modeswitch -v 0x12d1 -p 0x14fe -J

Step 4: Now the Huawei will turn into wwan0 device, to verify use again lsusb:

$ lsusb

Example output: ::

Bus 001 Device 006: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
Bus 001 Device 004: ID 1951:1000 Hyperstone AG
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and

$ ifconfig -a  | grep wwan0

Example output (shortened): ::

wwan0     Link encap:Ethernet  HWaddr 0c:5b:8f:27:9a:64

Step 5: Now that you have your device connected as wwan0, in the next step we will create a service to run the necessary command at boot

$ sudo nano /lib/systemd/system/usbmode.service

Edit the file with the lines:

[Unit]
Description=USB MODE SWITCH
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/./usb_modeswitch -v 0x12d1 -p 0x14fe -J

[Install]
WantedBy=multi-user.target

Step 6: Enable the service at boot using:

$ sudo systemctl enable usbmode.service

Step 7: Reboot

$ sudo reboot

NOTE: There’s a lot of ways to make the HUAWEI E8278 work.