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