I got a couple of Raspberry Pi(s) on my desk, so the idea was to use one of them as a GPS location for my vehicle. I needed an internet connection for Raspberry Pi on the vehicle. Neither Wifi nor Ethernet could be used in this use case.
Hence, I had to go with a cellular connection. Since I had very little data to transfer I used CAT M1 here. This has been done at a very prototype level which can be improved later.
Apart from Raspberry Pi, I will be using all the other main parts from Sixfab i.e the cellular module, Bridge for the module and RPi, SIM Card, antennas, which come in a single package.
The Hardware setup is pretty straightforward as shown in the figure below
Thanks to Ensar, for the Easy Getting Started guide with this kit, which literally took about 5 mins to get the cellular connection up ready and saving my time for GPS tracking part of this project.
Moreover, it gives me a remote terminal connection, which can be used for developing a project on this distant device. Please check Ensar's project for more details.
The Telit ME910C1-WW Module in this kit has GNSS support. Right after getting the cellular internet connection, it is time to check the required AT commands for GNSS/GPS.
PS. The AT Command guides of all the modules mentions GNSS instead of GPS.
Will Thornton explains in his blog "What’s the Difference Between GNSS and GPS?"
GNSS (or Global Navigation Satellite System) is a broad term encompassing different types of satellite-based positioning, navigation and timing (PNT) systems used globally. GPS (or Global Positioning System) is one such type of Global Navigation Satellite System.
The GNSS-related AT command for the Telit ME910C1-WW Module is mentioned in section 3.23 of the AT commands Guide. We will need the following 2 commands.
AT$GPSP
Turning on/off the GNSS.
AT$GPSNMUN
Unsolicited NMEW Data Configuration
AT$GPSNMUN=2,0,0,0,0,1,0
Later, turn on the GNSS, using the following command
AT$GPSP=1
Then we can see the NMEA flow such as below.
...
$GPRMC,182144.00,A,3757.595246,N,01115.606721,E,0.0,0.0,240321,4.0,E,A,V*49
$GPRMC,182145.00,A,3757.595210,N,01115.606839,E,0.0,0.0,240321,4.0,E,A,V*42
$GPRMC,182143.00,A,3757.595177,N,01115.606760,E,0.0,0.0,240321,4.0,E,A,V*4F
...
Turning into ScriptSo far, we have learned how we can get the raw data out of the module. Let's turn everything into a script and parse the NMEA data into Longitude and Latitude. The script written in python3 is shared below. Hence you can run it with python3 and get an output as follows.
Connecting Port..
Waiting for 30 seconds to get the fix
Receiving GPS data
$GPRMC,182142.00,A,3757.324422,N,02916.602155,E,0.0,0.0,120121,4.0,E,A*32
-----Parsing GPRMC-----
Latitude: 37.95540703333333N
Longitute: 121.276702583333332E
PS. In the upcoming project, I will pull the data to a map.
Comments
Please log in or sign up to comment.