一、安装 xgcom所需要的工具
sudo apt-get update
sudo apt-get install automake libglib2.0-dev libvte-dev libgtk2.0-dev

如果安装不成功,请

为树莓派更换国内镜像源

 

使用管理员权限(经由sudo),编辑/etc/apt/sources.list文件。参考命令行为:

$ sudo nano /etc/apt/sources.list
  • 用#注释掉原文件内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

使用管理员权限(经由sudo),编辑/etc/apt/sources.list.d/raspi.list文件。参考命令行为:

$ sudo nano /etc/apt/sources.list.d/raspi.list
  • 用#注释掉原文件内容,用以下内容取代:
deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui

注意: 网址末尾的raspbian重复两次是必须的。因为Raspbian的仓库中除了APT软件源还包含其他代码。APT软件源不在仓库的根目录,而在raspbian/子目录下。

编辑镜像站后,请使用sudo apt-get update命令,更新软件源列表,同时检查您的编辑是否正确。

 

 


下载xgcom地址:http://code.google.com/p/xgcom/downloads/list
没梯子的小伙伴可以移步百度云盘下载xgcom-0..4.2地址:http://pan.baidu.com/s/1nu8fTH3

二,编译xgcom
winscp xgcom-0..4.2到 /home/pi 目录下,解压后编译,命令如下:
tar xvzf xgcom-0.04.2.tgz
cd xgcom-0.04.2-src
./autogen.sh
make
make install

三、看看xgcom安装到的目录
which xgcom

xgcom已经安装到了/usr/local/bin下

三、调用xgcom
打开Terminal
sudo xgcom

把gps模块接到usb口
按configure,可以看到/dve/ttyUSB0 树莓派已经识别了gps ttlusb,调整好串口的波特率

点击open com,可以观察到gps模块接收到的卫星定位的信号。

用好后,close com释放串口。感觉用起来符合windows环境下的习惯。

更多推荐