GPS data reading

Hi everyone,
I’m trying to read data from a GPS device:

#!/usr/bin/env python
import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('', 2947))

while True:
    data = sock.recv(10240).decode().strip()
    if len(data) == 0:
        print("No data!")

I get the output: {“class”:“VERSION”,“release”:“3.22”,“rev”:“3.22”,“proto_major”:3,“proto_minor”:14}
but no more.
gpsmon connects to the address and displays data.
What could be the problem?

It might just be that it reports the version when you connect to it, but tells you the coordinates only on demand. You’ll have to check the documentation to see what’s required.

Why should there be more data? What do you expect the rest of the data to look like, and why? Did you try to look up and read any documentation in order to understand how this works? (For example, are you expecting it to send you everything all at once? What is “everything”, anyway? Or should it periodically send you new information, or just what?)

NMEA data comes from the gps device in a continuous stream, something like this:


It can be read by accessing TCP port 2947. With the gpsmon program, it can be seen that the data is coming. It can be seen here:

The problem occurs when I try to connect to with Python socket…