linux ntripcaster

1.download source code

git clone https://github.com/nunojpg/ntripserver.git

git clone https://github.com/nunojpg/ntripcaster.git

2.complie 

#sudo chmod +x configure
#./configure 
#make
#make install

3. modify confiure file

vi ntripcaster.conf
encoder_password jason
server_name 127.0.0.1
port 2101
/SZ:jason:jason

vi sourcetable.dat
STR;SZ;shenzhen;RTCM 3;1005(10),1074-1084-1124(1);2;GNSS;POPNET;CHN;0;0;0;0;GPSNet V2.10;none;N;N;560;Demo

4.set auto start when bootup
#vi /etc/init.d ntripcaster.sh

#!/bin/sh
### BEGIN INIT INFO
# Provides:          ntripcaster.sh
# Required-Start:    $remote_fs
# Required-Stop:
# Should-Start:      ntripcaster
# Default-Start:     2 3 4 5
# Default-Stop:
# X-Interactive:     true
# Short-Description: setup RTK for High Precision Positionng
### END INIT INFO

    case "$1" in
        stop|status)
        # kill process ntripcaster
        echo "stop ntripcaster service in /usr/local/ntripcaster/bin/ntripcaster"
        sudo  kill -9 $(pidof ntripcaster)
        ;;
        start)
        echo "start ntripcaster service in /usr/local/ntripcaster/bin/ntripcaster"
        sudo /usr/local/ntripcaster/bin/ntripcaster &
        ;;
        restart)
        sudo kill -9 $(pidof ntripcaster)
        sudo /usr/local/ntripcaster/bin/ntripcaster &
        ;;
        *) echo "usage: /etc/init.d/ntripcaster start|stop"
        exit 3
        ;;
    esac  

problem: can't be bootup automatically.
solution:  put ntripcaster.sh to /etc/rc0.d/

5. start the server
   #make  
   #sudo ntripserver -M 1 -i /dev/ttyZED -b 460800 -O 3 -a 127.0.0.1 -p 2101 -m SZ -c ublox 

6. there is no /dev/ttyUSB* 
#lsusb
Bus 001 Device 013: ID 1546:01a9 U-Blox AG
Bus 001 Device 012: ID 1546:0503 U-Blox AG
Bus 001 Device 011: ID 1546:0502 U-Blox AG
#lsmod | grep usb   // whether usb driver is load
# modprobe usbserial    //load the usb driver
#dmesg -c  
##echo <vid> <pid> >/sys/bus/usb-serial/drivers/generic/new_id
#echo "1546 0503" >/sys/bus/usb-serial/drivers/generic/new_id
#dmesg -c 
#echo "1546 0502" >/sys/bus/usb-serial/drivers/generic/new_id
 

set auto load usb driver when bootup
#vi /etc/modules.conf

set auto add usb device /dev/ttyUSB*

 

problem: no data output from /dev/ttyUSB0 or /dev/ttyUSB1

#cat /dev/ttyUSB0 or cat /dev/ttyUSB1 
#minicom -D /dev/ttyUSB0 -b 38400  or minicom -D /dev/ttyUSB1 -b 38400

solution: add file xxx.rules to /etc/udev/rules.d
## c099 linux udev rules
ACTION=="add", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="0503", SYMLINK+="ttyODIN", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 1546 0502 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"
ACTION=="add", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="0502", SYMLINK+="ttyZED", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 1546 0503 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'" 

#minicom -D /dev/ttyZED -b 38400 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值