Showing posts with label Gammu. Show all posts
Showing posts with label Gammu. Show all posts

Sunday, December 13, 2020

Connecting USB GSM / 3G / 4G Dongles to Raspberry Pi 4 (Huawei E303, usb-modeswitch, and Gammu)

USB cellular modems (such as the ubiquitous Huawei E303, E173, and E3372) enable Raspberry Pi 4 projects to send SMS notifications, handle emergency alerts, and provide cellular backup connectivity. However, modern USB modems initially boot into a virtual CD-ROM storage mode (ZeroCD) to deliver Windows drivers, requiring usb-modeswitch to toggle them into serial modem mode.

Hardware: Raspberry Pi 4 • Huawei E303 USB Dongle • usb-modeswitch • Gammu SMS Gateway

1. Installing usb-modeswitch and Gammu

sudo apt-get update
sudo apt-get install usb-modeswitch usb-modeswitch-data gammu minicom -y

2. Switching from Mass Storage to Modem Mode

Check lsusb to identify your device vendor and product ID:

# Example: ID 12d1:1f01 (Mass Storage Mode)
lsusb | grep Huawei

# Mode-switch into serial modem mode (12d1:1001 or 12d1:14db):
sudo usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000011062000000100000000000000000000'

Confirm the modem serial nodes are created under /dev/ttyUSB0, /dev/ttyUSB1, and /dev/ttyUSB2.

3. Sending a Test SMS via Gammu

Configure ~/.gammurc:

[gammu]
port = /dev/ttyUSB0
connection = at115200

Send an automated test message:

echo "Alert: Raspberry Pi online!" | gammu sendsms TEXT +1234567890

How Google Antigravity Solved the Mysterious NVIDIA Sleep Reboot on My Dell Inspiron 7567 (Ubuntu Linux)

If you run modern Ubuntu or Linux on a Dell Inspiron 15 Gaming (7567) or a similar 7th-gen Intel laptop paired with an NVIDIA GeForce GTX ...