交叉编译GPSD

1、编译udev
https://blog.csdn.net/lc250123/article/details/78910476
编译结果放入交叉编译环境
2、编译libusb
编译结果放入交叉编译环境
3、下载gpsd
wget http://download.savannah.gnu.org/releases/gpsd/gpsd-3.24.tar.gz
或则:git clone https://github.com/ukyg9e5r6k7gubiekd6/gpsd.git

所有连接:http://download-mirror.savannah.gnu.org/releases/gpsd/
4、编译其他依赖库(可不编译)
ncurses 交叉编译 https://blog.csdn.net/weixin_38184741/article/details/98844812
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz
注意: --without-ada --without-manpages --enable-overwrite --without-debug --without-tests --with-shared --without-tests --without-progs

5、加载环境变量
注释掉LD,否则出现-wl等问题:export LD=arm-linux-gnueabi-gcc

6、修改需要编译文件主要配置文件为SConscript
gedit SConscript(gpsd-3.24.tar.gz)
gedit SConstruct (git下载的)
注释掉dbus,增加ntrip
7、编译,参考 https://blog.csdn.net/weixin_40407893/article/details/102936836
*** 从imx6ul依赖库拷贝出libtinof.so.5,否则编译不出cgps

7.1 编译:
下载:https://ftp.gnu.org/gnu/ncurses/
./configure --host=arm-linux --prefix=$PWD/install --with-shared --with-termlib --with-normal --target=arm-linux
会编译生成libtinfo.so

8、scons 注意事项
清理命令是 scons -c

9、使用

sudo apt-get install gpsd gpsd-clients
sudo systemctl stop gpsd.socket
sudo systemctl disable gpsd.socket
sudo gpsd /dev/serial0 -F /var/run/gpsd.sock

sudo cgps -s

sudo systemctl stop [email protected]

v查看端口是否被占用

1、1.lsof命令查看
[root@dtvl3000 /usrdata0/work/bin]#lsof | grep ttyS1
933 /system/bin/xds /dev/ttyS1

2.proc文件系统
ls /proc/112/fd -l #格式为ls /proc/pid/fd -l
3.ps

4.top
找到进程号,并杀死进程,目前找到的是xds,进程号933

export LD_LIBRARY_PATH=/usrdata0/work/lib:$LD_LIBRARY_PATH
gpsd -D 5 -N -n /dev/ttyS1
gpsd -D 5 -N -n /dev/ttyS1 /dev/pps1 (带pps)
10、pps查看
[root@dtvl3000 /usrdata0/work]# dmesg |grep pps
[ 0.686889] pps_core: LinuxPPS API ver. 1 registered
[ 0.686920] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti [email protected]
[ 0.882629] pps pps0: new PPS source ktimer
[ 0.882659] pps pps0: ktimer PPS source registered
[ 0.882659] pps_ldisc: PPS line discipline registered
[ 0.882843] pps pps1: new PPS source pps-gpio.0
[ 0.882965] pps pps1: Registered IRQ 193 as PPS source
此处, PPS0为内核模拟的pps信号,pps1 gnss模块的pps 信号
在应用层,使用ppstest工具可查看pps信号时间值(pps信号发生时刻的系统时间点)

精品参考:
Gpsd pps移植_天晓-workspace的博客-CSDN博客_gpsd移植

你可能感兴趣的:(交叉编译GPSD)