Difference: GPSReceiver (4 vs. 5)

Revision 52020-08-23 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

The Neo 6M GPS receiver

Line: 26 to 25
 Here is a photo of the device:

gps.png

Added:
>
>

Connecting the GPS receiver to your PC

In order to read out the GPS receiver from the PC we need a USB to serial converter:

usb2serial.png As can be seen on the photo the connections must be made as follows (pin 1 is the leftmost pin)

Pin no on the USB to serial converter Label Connection on GPS receiver
1 DTR nc
2 RX Tx
3 TX Rx
4 VCC 3.3V
5 CTS nc
6 GND GND
If you now communicate with the USB to serial adapter on /dev/ttyUSB0 with a terminal emulator like minicom or gtkterm running on 9600 baud you should see NMEA messages sent be the GPS receiver.

nmeaPC.png

ublox u-center

ublox provides a Windows application for its GPS receivers named u-center which you can download from https://www.u-blox.com/en/product/u-center. Its user guide can be found at https://www.u-blox.com/sites/default/files/u-center_Userguide_%28UBX-13005250%29.pdf. It is possible to run this application on Linux using the Windows emulator wine. u-center allows you to connect to a Windows com port in order to communicate with the receiver. When running the u-center installation you will get the executable in
~/.wine/drive_c/Program Files (x86)/u-blox/u-center_v20.06.01

Finally we must figure out to which Windows com port our USB to serial adapter corresponds to. Looking at ~/.wine/dosdevices shows that /dev/ttyUSB0 is mapped to com33.

dosdevices.png

ublox GPS receivers use 2 different protocols

  • the NMEA protocol
  • a proprietary binary protocol, which not only transmits GPS data but also allows to configure the receiver
As mentioned above, the standard baud rate on the ublox neo 6M is 9600 baud, which is very slow. It takes ~ 600 ms to transmit the batch of NMEA sentences the receiver sends every second. When trying to parse the sentences as they come in real time I see many CRC errors, which may come from the fact that there is simply not enough time left for the data treatment before the next batch comes in.

u-center allows you to change the baud rate (I selected 115200 baud, which I also use to communicate with the ESP32) and to save this change in battery backed up RAM such that it can be recovered when the receiver is restarted after a power down.

Here is a screen dump of the running u-center application:

u-center.png

gpsd

The GPS daemon gpsd connects to a GPS receiver and provides its data to clients over a TCP connection.You can find it on https://gpsd.gitlab.io/gpsd/index.html

Reading NMEA sentences with the ESP32

  Once the connection is made and the UART instantiated all you need is an endless loop to read the UART line by line. This is what you will see if you print the result:
Line: 45 to 82
 
META FILEATTACHMENT attachment="gps.png" attr="" comment="" date="1593594185" name="gps.png" path="gps.png" size="173994" user="UliRaich" version="1"
META FILEATTACHMENT attachment="gpsdata.png" attr="" comment="" date="1596200640" name="gpsdata.png" path="gpsdata.png" size="91972" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="usb2serial.png" attr="" comment="" date="1598177873" name="usb2serial.png" path="usb2serial.png" size="275116" user="UliRaich" version="1"
META FILEATTACHMENT attachment="u-center.png" attr="" comment="" date="1598177875" name="u-center.png" path="u-center.png" size="190473" user="UliRaich" version="1"
META FILEATTACHMENT attachment="nmeaPC.png" attr="" comment="" date="1598177877" name="nmeaPC.png" path="nmeaPC.png" size="110073" user="UliRaich" version="1"
META FILEATTACHMENT attachment="dosdevices.png" attr="" comment="" date="1598177877" name="dosdevices.png" path="dosdevices.png" size="93199" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback