简体   繁体   English

Ubuntu-从软件狗获取GPS坐标(BU-353)

[英]Ubuntu - getting GPS coordinates from dongle (bu-353)

I am trying to get longitude and latitude coordinates from a GPS dongle I have here (BU-353). 我正在尝试从我在这里的GPS加密狗(BU-353)获取经度和纬度坐标。 I have installed gpsd and gpsmon. 我已经安装了gpsd和gpsmon。

Gpsmon correctly show my location and updates it. Gpsmon会正确显示我的位置并进行更新。 Whenever I run this command: 每当我运行以下命令时:

sudo gpsd -n -N -D 2 /dev/ttyUSB0

I get this output: 我得到以下输出:

gpsd: launching (Version 2.95)
gpsd: listening on port gpsd
gpsd: running with effective group ID 0
gpsd: running with effective user ID 0
gpsd: opening GPS data source type 3 at '/dev/ttyUSB0'
gpsd: speed 9600, 8N1
gpsd: attempting USB device enumeration.
gpsd: 1d6b:0001 (bus 1, device 1)
gpsd: 80ee:0021 (bus 1, device 2)
gpsd: 067b:2303 (bus 1, device 3)
gpsd: vendor/product match with 091e:0003 not found
gpsd: speed 9600, 8O1
gpsd: speed 9600, 8N1
gpsd: gpsd_activate(): opened GPS (fd 6)
gpsd: speed 4800, 8N1
gpsd: NTPD ntpd_link_activate: 1
gpsd: /dev/ttyUSB0 identified as type SiRF binary (1.497303 sec @ 4800bps)
gpsd: GPS on /dev/ttyUSB0 is offline (0.000016 sec since data)
gpsd: GPS on /dev/ttyUSB0 is offline (0.000017 sec since data)
gpsd: GPS on /dev/ttyUSB0 is offline (0.000565 sec since data)
gpsd: GPS on /dev/ttyUSB0 is offline (0.000018 sec since data)
gpsd: GPS on /dev/ttyUSB0 is offline (0.000019 sec since data)

And clearly isn't working. 显然是行不通的。

My goal is to be able to have a script which keeps returning something like: 我的目标是能够拥有一个不断返回类似以下内容的脚本:

XX.XXXXX N, XX,XXXXX E XX.XXXXX N,XX,XXXXX E

So, that I can read it from another program (in Erlang) and use it accordingly. 因此,我可以从另一个程序(在Erlang中)中读取它并相应地使用它。

More info: 更多信息:

Xgps works correctly. Xgps正常工作。

I believe the speed '9600' might be incorrect and something with the vendor ID, not sure though. 我认为速度'9600'可能不正确,但带有供应商ID的信息可能不确定。

This worked for me, I'm using BU-353 on Angstrom: 这对我有用,我在Angstrom上使用BU-353:

Change from binary to NMEA: 从二进制更改为NMEA:

$ gpsctl -f -n /dev/ttyUSB0

Configuration of serial port: 串口配置:

$ stty -F /dev/ttyUSB0 ispeed 4800

If you want to keep NMEA, then type just -b flag: 如果要保留NMEA,请仅输入-b标志:

$ gpsd -b /dev/ttyUSB0

Output id shown with this: 显示的输出ID与此:

$ cat /dev/ttyUSB0

Hope it helps! 希望能帮助到你! You have to write sudo in front of lines. 您必须在行前编写sudo。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM