-
Download the file sim908.sh
-
type
sh sim908.sh
in your terminal
Inspired by Adafruit's FONA tutorial
- create/modify the file
/etc/ppp/peers/fona
:
# Example PPPD configuration for SIM908 on Archlinux-ARM.
# MUST CHANGE: Change the -T parameter value **** to your network's APN value.
# For example if your APN is 'internet' (without quotes), the line would look like:
# connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet"
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs -T internet.mbqt.net"
# MUST CHANGE: Uncomment the appropriate serial device for your platform below.
# For Raspberry Pi use /dev/ttyAMA0 by uncommenting the line below:
#/dev/ttyAMA0
# For BeagleBone Black use /dev/ttyO4 by uncommenting the line below:
#/dev/ttyO4
# For ODROID C1 use /dev/ttyS2 by uncommenting the line below:
/dev/ttyS2
# Speed of the serial line.
9600
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route to the internet.
defaultroute
# Makes PPPD "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth
# No hardware flow control on the serial link with FONA
nocrtscts
# No modem control lines with FONA.
local
- create/modify the file
/etc/chatscripts/gprs
(you may need to create the folder/etc/chatscripts
):
# line option of chat(8).
ABORT BUSY
ABORT VOICE
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
ABORT "ERROR"
# cease if the modem is not attached to the network yet
ABORT "+CGATT: 0"
"" AAAAAA # init the baudrate
"" AT
TIMEOUT 12
OK ATH
OK ATE1
# +CPIN provides the SIM card PIN
#OK "AT+CPIN=1234"
# +CFUN may allow to configure the handset to limit operations to
# GPRS/EDGE/UMTS/etc to save power, but the arguments are not standard
# except for 1 which means "full functionality".
#OK AT+CFUN=1
OK AT+CGDCONT=1,"IP","\T","",0,0
OK ATD*99#
TIMEOUT 22
CONNECT ""
- export pins 115 and 116
echo "115" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio115/direction
echo "116" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio116/direction
- init pin states
echo "0" > /sys/devices/virtual/gpio/gpio115/value
echo "0" > /sys/devices/virtual/gpio/gpio116/value
- power on
echo "1" > /sys/devices/virtual/gpio/gpio116/value
- reset
echo "1" > /sys/devices/virtual/gpio/gpio115/value
- check if it works
chat -t 5 -vs '' 'AT' 'OK' > /dev/ttyS2 < /dev/ttyS2
This command start a communication with the modem. If it doesn't answer, there is a problem.
the first ''
means that we don't wait anything before sending the AT
-
in your terminal, type
pon fona
-
use
journalctl -b -f --no-pager | grep chat
to see the serial communication -
use
journalctl -b -f --no-pager | grep pppd
to see PPPDs logs
-
As long as the ODROID is alimented (even when rebooting), the SIM908 won't restart.
-
power ON/OFF and reset pins work by rising edge.
-
powering ON may fail if reset pin is up