I have Python code from source which let to treat GPRMC format. I modified the code where data is from "gpsd -d | awk -F ':' 'BEGIN{OFS=\":\"}{print $2}' | grep GPRMC"
and is a list like this:
$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
$GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
So when i launch it i got this error :
data = ser.readline()
AttributeError: 'str' object has no attribute 'readline
Below is a part of the code:
port = "gpsd -d | awk -F ':' 'BEGIN{OFS=\":\"}{print $2}' | grep GPRMC"
print("Receiving GPS data")
ser = port
find = False
while find == False:
print("Waiting for GPRMC data")
data = ser.readline()
if data[0:6] == "$GPRMC":
parsingData = data.split(",")
print(parsingData)
if parsingData[2] == "A":
parseGPS(data)
find = True
Please help me to fix this. ps: i'm not python coder it's just several days i begin this language and sorry for my bad english