GPRS-GPS-notes.md 5.2 KB

Raspberry Pi GPRS/GPS notes

2019-11-01

I'm focusing on a SIM4320(A) chip:

GPRS

Raspberry Pi Pin FONA Pin Description
3.3v (1) Vio (4) Sets logic level, must be externally powered (RPi -> FONA)
GND (6) GND (3)
TXD (8) RX (6) RPi transmit -> FONA receive
RXD (10) TX (7) RPi recieve <- FONA transmit
GND (6) Key (11) Pulse 3-5s to ground to switch state (initially off)

Key is tied to the power button on the FONA. We want this to be permantly on without the need for the Pi to turn it on or off, so this should be tied to ground (?).

On the Raspberry Pi (RPi 3B+, Raspbian 2019-07-10 Buster)

sudo bash
apt-get update
apt-get install ppp screen minicom

# disable rpi serial interface so we can use it from FONA
# also disable bluetooth and wifi as we don't need it
#
cat >> /boot/config.txt <<EOF
enable_uart=1
dtoverlay=pi3-disable-bt
dtoverlay=pi3-disable-wifi
EOF

# setup ppp configuration
#
cat > /etc/ppp/peers/fona <<EOF
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs"
/dev/serial0
115200
noipdefault
usepeerdns
defaultroute
persist
noauth
nocrtscts
local
EOF

shutdown -r now

At this point, after reboot, I tested to make sure the serial connection was at least responding to AT commands:

sudo bash
minicom -c on -D /dev/serial0
AT
  • The AT command should show up because the FONA should echo the commands
  • The FONA should respond with OK

To setup a ppp connection, issuing:

pon fona

as root should work.

If there are troubles, look at dmesg and /var/log/syslog for clues as to what went wrong.


  • After setup, I'm having trouble with wwan0. Doing ifconfig wwan0 down and then resetting the ppp connection (poff fona ; pon fona), I get internet connectivity.
  • I have to physically hold down the 'on' button for 5s to turn on the GPRS and GPS functionality

GPS

I'm using an active antennae.

I've soldered the 'bias' bin on the 3G Fona module.

Note that I couldn't find any reference on Adafruit's site about soldering the 'bias' bridge. I only found this information when looking at other users problems (src). It turns out Adafruit does mention it in one of their PDF guides (src).

There is a USB connection to the FONA which is how, I believe, the ttyUSB interfaces are coming up. The USB to serial connection can be used for the GPS information whereas the direct serial connection is used for the GPRS modem.

  • I was not getting a fix on the satellites until I soldered the 'bias' bridge on the FONA.
  • I had to reseat the small GPS antennae connector
  • Connect to serial interface via /dev/ttyUSB3
    • Note that /dev/ttyUSB2 looks to be another viable candidate but maybe what goes on in /dev/ttyUSB3 is mirrored in /dev/ttyUSB2
    • /dev/ttyUSB0 and /dev/ttyUSB1 show up when the FONA is powered on but I haven't been able to get any response when connecting via minicom to either of those interfaces
    • to connect from the command line minicom -c on -D /dev/ttyUSB2 (8N1 115200, hardware flow control off)
  • Turn on the GPS functionality by issuing AT+CGPS=1
  • To poll every 3 seconds with full NMEA message output, issue AT+CGPSINFOCFG=3,31
    • Look for the $GPRMC,... line as that has the easiest to read lat/lon positions

See NMEA sentence information and the AT command set.

References