本帖最后由 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
其对应修改的配置文件是: /etc/default/gpsd
重启gpsd服务: sudo service gpsd restart
5.查看GPS信息: 使用cgps可以直观的查看GPS信息: cgps -s
|