Tag Archives: GPS

Using u-Center to connect to the GPS on the OzzMaker SARA-R5 LTE-M GPS + 10DOF

u-Center from u-Blox is a graphical interface which can be used to monitor and configure all aspects of the GPS module on a OzzMaker SARA-R5 LTE-M GPS + 10DOF

u-Center from uBlox
U-Center

 

u-Center only runs on Windows. It can connect over the network to a Raspberry Pi.  This will require us to redirect the serial interface on the Raspberry Pi to a network port using ser2net.

Pi Setup

You will first need to have multiplexing enabled for the serial interface and have GPS data streaming to the /dev/ttyGSM2 virtual serial interface, which is covered in these two guides

  1. How to enable multiplexing on the Raspberry Pi Serial interface
  2. Using the GPS on OzzMaker SARA-R5 LTE-M GPS + 10DOF

 

Then, do an upt-get update and then install ser2net;

pi@raspberrypi ~ $ sudo apt-get update
pi@raspberrypi ~ $ sudo apt-get install ser2net

Edit the ser2net config file and add the serial port redirect to a network port. We will use network port 6000

pi@raspberrypi ~ $ sudo nano /etc/ser2net.yam

And add these line at the bottom;

connection: &con1197
    accepter: tcp,6000
    enable: on
    options:
      banner: *banner
      kickolduser: true
      telnet-brk-on-sync: true
    connector: serialdev,
              /dev/ttyGSM2,
              115200n81,local

you can now restart ser2net using;

pi@raspberrypi ~ $ sudo systemctl restart ser2net

If you need to disable it, you can disable it using;

pi@raspberrypi ~ $ sudo systemctl disable ser2net

And you can use the below command to check if it is running by seeing if the port is open and assigned to the ser2net process;

pi@raspberrypi ~ $ sudo netstat -ltnp | grep 6000

If it is running, you should see something similar to the output below;

check result of ser2net

Windows PC Setup and Connecting to the GPS module

You can download u-Center from here.

Once installed, open u-Center. You will get the default view as shown below.  No data will be shown as we are not connected to a GPS.

u-Center default view

The next step, is to create a new network connection and connect to the GPS which is connected to our Raspberry Pi. You can create a new connection under the Receiver and then Network connection menus.

u-Center connect to Raspberry Pi
In the new window, enter the IP address of the Raspberry Pi and specify port 6000. This is the port we configured in ser2net on the Raspberry Pi.
u-Center Raspberry Pi Address

This is what the default view looks like when connected and the GPS has a fix.u-Center connected

 

u-Center

Below I will list of the more useful windows/tools within u-Center.
You can also click on the images below for a larger version.

Data View
This window will show you the longitude, latitude, altitude and fix mode. It will also show the HDOP, which is the Horizontal Dilution of Precision.  Lower is better, anything below 1.0 means you have a good signal.

u-Center Data View
u-Center Data View

Ground Track
This window will show you where the satellites are as well as what time.

u-Center Ground Track
u-Center Ground Track

Skye View
Sky view is an excellent tool for analyzing the performance of antennas as well as the conditions of the satellite observation environment.

u-Center Sky View
u-Center Sky View

Deviation Map
This map shows the average of all previously measured positions.

u-Center Deviation Map
u-Center Deviation Map

Continue reading Using u-Center to connect to the GPS on the OzzMaker SARA-R5 LTE-M GPS + 10DOF

Using CellLocate with OzzMaker SARA-R5 LTE-M GPS + 10DOF

What do you do if you have a poor or no GNSS signal, such has being indoors, inside a parking garage or in urban canyons? You could try CellLocate.

CellLocate

In a nutshell

CellLocate provides an estimated location based on visible network cell information reported by the cellular module. When CellLocate is activated, a data connection to the CellLocate server is established and the network cell information is passed to the server which provides an estimation of the device position based on the cell information.

CellLocate is fully integrated into the SARA-R5 which is on the OzzMaker SARA-R5 LTE-M GPS 10DOF board. The technology enables stand-alone location data based on surrounding mobile network information as well as hybrid technology that works in conjunction with GNSS. Through the single AT command interface, it is possible to define all the location settings for optimized performance.

When using CellLocate, the position accuracy is not predictable and is determined by the availability in the database of previous observations within the same area. CellLocate does not require a GNSS receiver to be present or active.

CellLocate requires a data connection (PDP) from the SARA-R5 module to the carrier.

 

Getting started

Connect to the SARA-R5 cellular module

pi@raspberrypi ~ $ minicom 115200 -D /dev/serial0

Setup the Packet Data Protocol (PDP) context.

First task is to setup the connection parameters for the PDP context using AT+CGDCONT. Any setting applied with this commend is persistent over power cycles. This means it only needs to be done once. You will however need to enter it again if you do a factory reset.

First, turn off the radio

 AT+CFUN=0

Then set up a connection profile with the APN for your network operator, using the AT+CGDCONT  command (Packet Switch Data configuration). In this example we are using a Hologram SIM, so the APN would be hologram.

AT+CGDCONT=1,”IP”,””hologram”

Now turn the radio back on;

 AT+CFUN=1

Once your SARA-R5 connects to the carrier, you can use AT+CGDCONT? to get your current IP address

AT+CGDCONT?
+CGDCONT: 1,”IP”,”hologram.mnc050.mcc234.gprs”,”10.170.92.244″,0,0,0,2,0,0,0,0,0,0,0

Now active the PDP context

AT+CGACT=1,1

Set the PDP type to IPv4

AT+UPSD=0,0,0

Profile #0 is mapped on CID=1

AT+UPSD=0,100,1

Activate the PSD profile

 AT+UPSDA=0,3

 

Your SARA-R5 should now have internet access. If you want to test the data connection, you can use AT+UPING

AT+UPING=”www.google.com”
OK
+UUPING: 1,32,”www.google.com”,”142.250.179.228″,113,617
+UUPING: 2,32,”www.google.com”,”142.250.179.228″,113,637
+UUPING: 3,32,”www.google.com”,”142.250.179.228″,113,636
+UUPING: 4,32,”www.google.com”,”142.250.179.228″,113,637

 

Using CellLocate

When using CellLocate, There are two modes to choose from:

normal scan: the cellular module reports the serving cell and the neighboring visible cells designated by the network operator, which are normally collected by the module during its “network” activity. This configuration is suggested for a quick update of location

deep scan: the cellular module scans and reports all visible cells providing in addition to serving and neighboring cells by the serving network operator, also the cells of all other available (visible) network operators, thus increasing the probability of obtaining a successful position estimation. Although this takes a bit longer (approximately 30 sec to 2 minutes is needed to perform a deep scan), uses more data (each reported cell requires a few bytes), and more power, coverage and reliability are potentially better in corner cases.

Continue reading Using CellLocate with OzzMaker SARA-R5 LTE-M GPS + 10DOF

New Product: OzzMaker SARA-R5 LTE-M GPS + 10DOF

We have released a new product ; OzzMaker SARA-R5 LTE-M GPS + 10DOF

OzzMaker LTE-M GPS IMU 10DOF

This is an all in one module which can provide location tracking and LTE-M services such as data, text and SMS to your project. It comes in the same form factor as a Raspberry Pi Zero, which makes it nice and compact when used with a Raspberry Pi Zero.

It is a feature packed board, which includes the  following components;

  1. LTE-M cellular modem
  2. GPS  receiver (including assisted GPS)
  3. Accelerometer
  4. Gyroscope
  5. Magnetometer (Compass)
  6. Barometric/pressure sensor (altitude)
  7. Temperature sensor

 

This board includes a SARA-R510M8S  module from uBlox,  this module can be used for LTE-M connectivity and includes an integrated GPS receiver. Using both these features together results in obtaining a GPS fix in seconds, using Assisted GPS.

The below video shows a comparison between assisted and normal GPS.

  • Asisted GPS takes 19secs to get a fix
  • Normal GPS takes 8min 22Sec to get a fix


 

Typically, a GPS module can take a few minutes to get  Time To First Fix(TTFF), or even longer if you are in  built up areas.  This is because the Almanac needs to be downloaded from  satellites before a GPS fix can be acquired and only a small portion of the Almanac is sent in each GPS update.

Assisted GPS speeds this up significantly by  downloading  ephemeris, almanac, accurate time and satellite status over the network, resulting in faster TTTF, in a few seconds. This is very similar how to GPS works on a smartphone.

 

 

GPS Position accuracy and how to tell if you have a good fix?

One of the main contributing factors to GPS position accuracy is the geometric configuration (the position in the sky) of the satellites used to obtain a position.
The best position fix is given when a satellite is directly overhead and another three are equally spaced around the horizon.

This aspect is called the ‘geometry’ of the system and is measured as DOP (Dilution of Precision).

The influence of satellite geometry on imprecision is demonstrated in the image below. When both satellites are widely separated (figure left) the position error (area in red) is smaller. If the satellites are close to one another (right figure), then the area of error is more spread out. This is valid when the uncertainty for determining the position,
known as the Range Error (R-E: yellow and blue areas), is the same for both satellites. R (R1 and R2) refers to the
measured distance of the satellites to the user (pseudorange).

HDOP overlap
Satellite precision error

 

There are a number of different DOP elements which can be used, we will focus on HDOP (Horizontal-DOP).

The HDOP can be seen when using gpsmon. The image below has HDOP highlighted;gpsmon HDOP

The HDOP can also be found in the GSA sentence.  Below it is shown as 1.3;

$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39

A HDOP value of 1 or below would give you an accuracy of about 2.5 meters.

When in mountainous areas, forests and urban canyons, you can experience high HDOP values as  some of the available satellites will be obstructed. The satellites used will be closer together creating a large area of error as the signal from each satellite have a larger intersect.

Low accuracy in a city
Low accuracy in a city

Out on the open sea, you should be able to see a low HDOP value as the satellites used would be spread out and has less area of a intersect.

HDOP
Good accuracy

How to save GPS data to a file using Python

Below is an example python script which will save GPS data (time, Lon, Lat, speed and sats in view) to a file.

The gpsd client libraries  will be used to get the data from GPSD. We will be using the TPV class to get time, latitude, longitude and speed.

We can get the number of satellites in view by getting the length of the satellites object.

This page shows how to get gpsd up an running on a Raspberry Pi

Every time the script is run, it will create a new file beginning with the current date and time.

In this example, I am writing in a csv format, where each GPS attribute is separated by a comma.

#! /usr/bin/python
from gps import *
import time, inspect

f = open(time.strftime("%Y%m%d-%H%M%S")+'_GSPData.csv','w')
gpsd = gps(mode=WATCH_ENABLE|WATCH_NEWSTYLE)
print 'GPStime utc\t\t\tlatitude\tlongitude\tspeed\tsats in view' # '\t' = TAB to try and output the data in columns.
f.write("GPStime utc,latitude,longitude,speed,sats in view\n")
try:
    while True:
        report = gpsd.next() #
        if report['class'] == 'TPV':
            GPStime =  str(getattr(report,'time',''))
            lat = str(getattr(report,'lat',0.0))
            lon = str(getattr(report,'lon',0.0))
            speed =  str(getattr(report,'speed','nan'))
            sats = str(len(gpsd.satellites))
            print  GPStime,"\t",
            print  lat,"\t",
            print  lon,"\t",
            print  speed,"\t",
            print  sats,"\t"
            f.write(GPStime + ',' + lat +',' + lon + ',' + speed + ',' + sats + '\n')
            time.sleep(1)
except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
    print "Done.\nExiting."
    f.close()

New Products : BerryGPS and BerryGPS-IMU

We have released two new products:

BerryGPSGPS for the Raspberry Pi

BerryGPS-IMU GPS and IMU for the Raspberry Pi

Both GPS modules use the  M10478-A2 from Antenova, which is a high quality GPS module which is able to track 22 satellites and has an internal antenna. This means no external antenna is needed if the module has clear access to sky.  Both feature a SuperCap to store ephemeris data for up to four hours. This and many more features are included.

Raspberry Pi GPS
BerryGPS

 

 

 

Both have been specifically designed for the Raspberry Pi Zero, however they will work with any version of Raspberry Pi.

 

The BerryGPS-IMU also includes all the components found on the BerryIMU.  And is compatible with the existing code in our repository. The BerryGPS-IMU present a lot of sensors in a very, very small package.

 

 

Raspberry Pi GPS
BerryGPS-IMU

 

 

 

Raspberry Pi GPS
BerryGPS-IMU on a Raspberry Pi Zero

 

BerryGPS-IMU
BerryGPS-IMU on Raspberry Pi 2

berrygps-skull