1 year ago

#241989

test-img

labradoor l

Python NMEA GNSS Cold Start command

On my hardware, I translate the usb port to com using the usb_transit_on internal command. After that, I connect to the port using the program and when I enter this command "b5 62 06 04 04 00 ff ff 00 00 0c 5d" enter image description here

I perform a cold restart and note the time spent by the satellites, the task is to do the same only without the program, the question is whether it is possible how then send command "b5 62 06 04 04 00 ff ff 00 00 0c 5d" or "$PMTK103*30" With Python, I tried but nothing happened.

import time
import pynmea2
import serial
import csv
import io

def status():
    # ser = serial.Serial('COM12')
    ser = serial.Serial(
        port = "COM12",
        baudrate = 9600,
        bytesize = serial.EIGHTBITS,
        parity = serial.PARITY_NONE,
        stopbits = serial.STOPBITS_ONE
    )
    print("Waiting for data")

    ser.write(b"b5 62 06 04 04 00 ff ff 00 00 0c 5d")

    while True:
        message = ser.readline().decode()
        message = message.strip()
        if "$GNRMC" in message:
            gnrmc = pynmea2.parse(message)
            gnrmc_status = gnrmc.status
            return gnrmc_status
        else:
            continue

print(status())

I thought with this command you can send a message to the GNSS module enter image description here

python

gps

pyserial

nmea

cold-start

0 Answers

Your Answer

Accepted video resources