我有一个霍勒克斯 M-1200GPS接收器和pl2303
数据线。
电缆显示为/dev/ttyUSB0
,但是当我打开接收器和cat /dev/ttyUSB0
设备时,仅出现随机符号,如下所示:
➤ cat /dev/ttyUSB0
E<�\E ��&��Q��]����Y��Ʉ�)W��E��$T_��/������^C
我唯一能找到的是这个邮件列表主题。
如何从设备读取有效数据?
答案1
用于stty -F /dev/ttyUSB0 38400
设置正确的波特率。
然后您将获得有效的 NMEA 输出cat /dev/ttyUSB0
:
$GPGGA,230859.000,5035.1348,N,00712.8746,E,1,8,1.37,97.7,M,47.8,M,,*62
$GPGSA,A,3,11,01,32,03,22,14,08,10,,,,,1.63,1.37,0.88*0C
$GPGSV,3,1,12,11,82,240,34,01,67,295,31,22,62,227,40,14,43,100,24*7D
$GPGSV,3,2,12,08,42,174,37,32,40,069,31,03,33,232,24,28,26,286,*7F
$GPGSV,3,3,12,10,15,058,28,17,12,319,,27,10,157,,24,02,010,*74
$GPRMC,230859.000,A,5035.1348,N,00712.8746,E,0.37,354.64,260417,,,A*6D
$GPVTG,354.64,T,,M,0.37,N,0.68,K,A*37