MENU

Fun & Interesting

Raspberry Pi SMS And Mobile Internet

Tall Paul Tech 35,918 lượt xem 2 years ago
Video Not Working? Fix It Now

This shows you how to set up smstools so you can use a ttyUSB controlled modem to send and receive SMSes on a Raspberry Pi. Also, I show how to set it up to access the mobile Internet so you can use that as a backup.

Links:
https://whirlpool.net.au/wiki/sierra_advanced

Send command directly to serial port:
echo -n -e 'at!scact=1,1\r\n' (redirect output to) /dev/ttyUSB3
(YouTube doesn't allow the greater than sign for redirect)

AT Commands:


##################
## General info ##
##################


# Get information
ati

# Get manufacturer
at+cgmi

# Get IMEI
at+cgsn

# Get IMSI
at+cimi

# Get signal quality (RSSI,BER) RSSI=13 means 113-13*2 = -87dBm
at+csq

# Check if SIM is present
at+cpin?

# Check SIM registration
at+cgreg?
+CGREG: 0,1 (registered)
+CGREG: 0,0 (not registered)

# Show status
at!gstatus?

# Show custom options
at!custom?

# Password to set custom options
at!entercnd="A710"

# Set region to Australia
at!custom="PRLREGION",03

# 01 Europe (and the rest of the world)
# 02 North America
# 03 Australia
# 04 Japan


#########
## SMS ##
#########


# Set storage, and sms mode
AT+CPMS="ME"+at+cmgf=1

# Read all SMSes
AT+CMGL="ALL"

# Read individual SMS
at+cmgr=0

# Send SMS
at+cmgs="+61phonenumber"
type message here and press CTRL+Z when finished

# Delete SMS number 'x'
AT+CMGD=x


##################
## DATA NETWORK ##
##################


# Set up a profile
at+cgdcont=1,"IP","mdata.net.au"

# Verify profile is created
at+cgdcont?
+CGDCONT: 1,"IP","mdata.net.au","0.0.0.0",0,0
+CGDCONT: 3,"IP","telstra.internet","0.0.0.0",0,0
+CGDCONT: 15,"IP","telstra.bigpond","0.0.0.0",0,

# Connect with profile 1
at!scact=1,1

# Get IP address
at!scpaddr=1

Comment