C
I tried to send a lot of MTK messages, but without any success. But I get now GLL sentences at irregular intervals.
The communication between the GPS and the LoPy seems to be the problem. I read the data from the GPS into a fix buffer
self._lenBuffer = 64
self._buffer = bytearray(self._lenBuffer)
while True:
self.i2c.readfrom_into(GPS_I2CADDR, self._buffer)
build_sentence_from_buffer()
parse_sentence()
This seems to work for less then 10sec. Then it starts to send a lot of \n at the end of each sentence. A few seconds later it also adds \n inbetween a sentence.
bytearray(b'1,1,02,25,,,16,06,,,14*78\r\n$GLGSV,1,1,00*65\r\n$GPGLL,,,,,221320\n\n')
bytearray(b'.307,V,N*7E\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
bytearray(b'\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
My workaround is simple: ignore all \n
But I like to fix the cause. I tried to sleep for 250ms between each read. This reduced the amount of buffers containing only \n, but there still exist sentences with \n inbetween.
Has someone an idea how to fix the communication between GPS and LoPy?