SIMCOM Modem GPS Setup

SIMCOM mPCIe modems combine HSDPA/3G/LTE wireless connectivity along with GPS functions (with support for active GPS antenna)

These modems are very cost-effective for medium to high volume usage and provide excellent results in both upload/download speeds and GPS response for tracking applications.

For this example we'll be using a SIM5360E modem, but the same process will be similar on all SIMCOM modems. Start by installing the udev rule (20-modem-5360e.rules) in /etc/udev/rules.d from the modem rule pack

This sets up shortcut references to allow us to consistently identify which of the ttyUSBx ports do which functions

root@raspberrypi:~# ls /dev/modem* -l
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemAT -> ttyUSB3
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemGPS -> ttyUSB2
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemPPP -> ttyUSB4
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemS0 -> ttyUSB0
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemS1 -> ttyUSB2
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemS2 -> ttyUSB3
lrwxrwxrwx 1 root root 7 Jan  1  1970 /dev/modemS3 -> ttyUSB4

As the SIMCOM 5360E device uses a Active GPS antenna we can use most of the gps aerials on the market or combo antennas.

After connecting up a combo antenna let's do a quick check to make sure the modem is configured correctly:

root@raspberrypi:~# modemstat
SIM status                         : SIM unlocked and ready
Signal Quality                     : 10/32    (Bit error rate cannot be determined)
Network Registration               : Automatic network selection
Network ID                         : "vodafone UK"
Registration state                 : Registered to home network
GPRS/EDGE/UMTS/HSDPA Availability  : UMTS,HSDPA,HSUPA


GPRS/EDGE/UMTS/HSDPA Mode Status   : HSPA




Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM5360E
Revision: SIM5360E_V3.5
IMEI: 863789022380855
+GCAP: +CGSM,+DS,+ES

There are a few commands we need to understand to correctly configure the GPS setup on the modem

 

AT+CGPSCOLD Starts GPS service + NMEA Feed on /dev/modemGPS
AT+CGPS=0 Stops GPS Service + NMEA Feed on /dev/modemGPS
AT+CGPSNMEA=xxx Configure which NMEA output sentences are generated
AT+CGPSINFO Run on AT command port to give a one-shot reading

To do the tests below we'll need to setup two terminal windows to monitor /dev/modemAT and /dev/modemGPS so we'll use a LAN connection to allow us to run two minicom sessions.

To do this run the below commands, one per windows

minicom -D /dev/modemAT
minicom -D /dev/modemGPS

This will allow us to keep track of the NMEA output whilst we run the GPS AT configuration commands

Starting with the default configuration, activate the GPS service on the AT window

MyPi Industrial Raspberry Pi SIMCOM 5360 Modem GPS Configuration Step 1

AT+GPSCOLD starts the NMEA Feed, AT+CGPSINFO does a one-shot read, this will just show a row of commas if the GPS aerial has not been attached or no fix has been obtained yet.

Once the GPSCOLD command has been issued the NMEA window should start it's feed updating a new set of readings once per second

MyPi Industrial Raspberry Pi SIMCOM 5360 Modem GPS Configuration Step 2

To begin with the readings will be mostly blank, once a fix has been obtained (allow 60-90 seconds) the data will begin to fill in. 

The sets of information the NMEA feed data reports can be configured via the AT+CGPSNMEA command, here's what the user guide has to say:

AT+CGPSNMEA - Configure NMEA sentence type

Description

This command is used to configure NMEA output sentences which are generated by the gpsOne
engine when position data is available.

Syntax

Test Command         Responses
AT+CGPSNMEA=?        +CGPSNMEA: (scope of )
                     OK

Read Command         Responses
AT+CGPSNMEA?         +CGPSNMEA: 
                     OK

Write Command        Responses
AT+CGPSNMEA=         OK
                     If GPS engine is running:
                     ERROR

Values for 
Range – 0 to 511

Each bit enables an NMEA sentence output as follows:
Bit 0 – GPGGA (global positioning system fix data)
Bit 1 – GPRMC (recommended minimum specific GPS/TRANSIT data)
Bit 2 – GPGSV (GPS satellites in view)
Bit 3 – GPGSA (GPS DOP and active satellites)
Bit 4 – GPVTG (track made good and ground speed)
Bit 5 – PSTIS (proprietary string at the beginning of each GNSS session)
Bit 6 – GNGNS (fix data for GNSS receivers; output for GPS-only, GLONASS-only, hybrid GLONASS+GPS fixes & AFLT fixes)
Bit 7 – GNGSA (DOP and GLONASS satellites; GPS+GLONASS or GLONASS-only fixes. 
              Contains DOP information for all active satellites, but other information is GLONASS-only)
Bit 8 – GLGSV (GLONASS satellites in view GLONASS fixes only)

Set the desired NMEA sentence bit(s). 
If multiple NMEA sentence formats are desired, “OR” the desired bits together.

NOTE: If bit 1 isn't set, AT+CGPSINFO doesn’t output correctly on AT/modem port

Examples

AT+CGPSNMEA=511  (default)
OK

AT+CGPSNMEA=3 (recommended minimum data feed)
OK

So we can reduce the amount of information generated to the minimum via the command sequence below :

MyPi Industrial Raspberry Pi SIMCOM 5360 Modem GPS Configuration Step 3

Then we'll see the below info appearing on the NMEA Feed:

MyPi Industrial Raspberry Pi SIMCOM 5360 Modem GPS Configuration Step 4

If you find you get no GPS lock after 5-10mins, double-check that the GPS pin has been activated and the GPS bias voltage has been set correctly via the commands below :


Correct operation should have AT+CVAUXS return 1 and AT+CVAUXV return a vaule of around 3000000 (3V)

 

For more information please refer to the SIMCOM user guides:

SIMCOM GPS Application Note

SIMCOM AT COMMAND REFERENCE

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us