Python NMEA GNSS 冷启动命令
在我的硬件上,我使用 usb_transit_on 内部命令将 USB 端口转换为 com。 之后,我使用该程序连接到端口,当我输入此命令“b5 62 06 04 04 00 ff ff 00 00 0c 5d”时
我执行冷重启并记下卫星所花费的时间,任务只是执行相同的操作如果没有该程序,问题是是否可以发送命令“b5 62 06 04 04 00 ff ff 00 00 0c 5d”或“$PMTK103*30” 使用Python,我尝试过,但什么也没发生。
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())
我想用这个命令你可以向 GNSS 模块发送消息
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"
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论