Firefly ubuntu上使用GPS
本帖最后由 lipa 于 2016-3-12 11:33 编辑1.GPS模块安装小编使用的模块支持NMEA 0183协议,有VCC、GND、TXD,分别接到板子对应的扩展口,其中TXD我们接的UART1的RX。
2.打开kernel uart1接口
diff --git a/kernel/arch/arm/boot/dts/firefly-rk3288.dts b/kernel/arch/arm/boot/dts/firefly-rk3288.dts
index c715261..18d2c1e 100755
--- a/kernel/arch/arm/boot/dts/firefly-rk3288.dts
+++ b/kernel/arch/arm/boot/dts/firefly-rk3288.dts
@@ -408,6 +408,11 @@
status = "disabled";
};
+&uart_bb {
+ status = "okay";
+ dma-names = "!tx", "!rx";
+ pinctrl-0 = <&uart1_xfer &uart1_cts>;
+};
&i2c0 {
status = "okay";
编译后烧写resource.img,开机后会有对应的设备节点:/dev/ttyS1
验证GPS设备可以直接cat设备节点,:# cat /dev/ttyS1 $GPGGA,221646.000,2230.9220,N,11323.6786,E,0,00,0.0,56.1,M,0.0,M,,0000*5D$GPGLL,2230.9220,N,11323.6786,E,221646.000,V,N*43$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30$GPGSV,4,1,13,13,80,065,,15,55,225,,02,49,104,,29,46,291,*7F$GPGSV,4,2,13,20,43,314,,05,42,028,,30,11,063,,24,08,184,*72$GPGSV,4,3,13,06,08,122,,18,03,270,,12,02,204,,21,02,313,*7B$GPGSV,4,4,13,25,01,235,*49$GPRMC,221646.000,V,2230.9220,N,11323.6786,E,000.0,000.0,100316,,,N*71$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02$GPZDA,221646.000,10,03,2016,00,00*54
3.安装服务软件sudo apt-get install gpsd gpsd-clients
4.配置GPSD
GPSD是收集GPS信息的监视服务,支持USB和串口设备。详情参考man gpsd。配置gpsd,推荐使用dpkg-reconfigure,使用方法为:sudo dpkg-reconfigure gpsd
[*]开机自动启动gpsd服务:
[*]是否自动挂载USB GPS:
[*]配置GPS接收器的设备,此处需要与kernel接口匹配:
[*]配置gpsd启动的参数,除了-F参数
[*]配置gpsd socket路径:
其对应修改的配置文件是: /etc/default/gpsd
重启gpsd服务:sudo service gpsd restart
5.查看GPS信息:使用cgps可以直观的查看GPS信息:cgps -s
好贴 {:3_61:} Well Done. 折腾起来~ 请问gps模块哪儿买的,型号多少? 淘宝上搜gps模块 串口,有很多
我那个是别人送给我的,不知道在哪买的,一般串口TTL电平输出,9600bps,标准NMEA-0183协议输出的可以直接用
想拿来做什么:lol 非常的实用,不过9600是不是传输率慢了点噢
页:
[1]