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(('127.0.0.1', 2947))

while True:
    data = sock.recv(10240).decode().strip()
    if len(data) == 0:
        print("No data!")
    else:
        print(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 127.0.0.1:2947 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:

$GPRMC,060007.870,A,5813.3699,N,02625.6594,E,0.19,59.88,020523,,*38
$GPGGA,060008.870,5813.3699,N,02625.6593,E,1,03,4.2,-20.0,M,20.0,M,,0000*45

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:
simplescreenrecorder-2023-05-02_09.18.09

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