============================================================= INSTRUCTIONS FOR INSTALLING RTKLIB ON RASPBERRY PI 2016-12-20 ============================================================= This configuration will get a base station and a rover (both Raspberry Pis with M8Ts attached to them) working with RTKLIB. This configuration runs rtkrcv (the program which actually computes the position of the rover) on the rover itself. There is no particular reason why it must be done this way, but it is convenient. It makes the rover less dependent on other computers (kind of the spirit of autonomous robots), and reduces the required bandwidth between the rover and the rest of the network. 1. GET HARDWARE =============== You will need a) Raspberry Pi for the base station. I used an old Raspberry Pi B+ for this. It seems to work fine - the computational requirements are not very demanding. b) Raspberry Pi for the rover. You may need a Raspberry Pi 3 for this to work properly if you want to run rtkrcv on the rover, I don't know why. c) Two (preferably identical) GNSS (GPS) systems - one for the base, one for the rover. I used two of: "CSG CSGShop M8T U-BLOX", and these seem to work pretty well. 2. CONFIGURE IT =============== a) Copy all the files in this directory to /usr/local/rtklib into both Raspberry Pis. b) On the BASE STATION Pi, plug in one of the GNSSes. Then $ sudo bash # cd /usr/local/rtklib # cp str2str.service.BASE /etc/systemd/system/str2str.service # systemctl enable str2str.service # systemctl start str2str Test whether it works # telnet localhost 2831 You should see a stream of unreadable gobbledygook. This is good. use "control-]" to get out of telnet. c) On the ROVER Pi, plug in the other GNSS. Then $ sudo bash # cd /usr/local/rtklib # cp str2str.service.ROVER /etc/systemd/system/str2str.service # systemctl enable str2str.service # systemctl start str2str Test whether it works # telnet localhost 2831 You should see a stream of unreadable gobbledygook. This is good. Use "Control-]" to get out of telnet. Edit /usr/local/rtklib/rtkrcv.conf and set ant2-pos1, ant2-pos2, ant2-pos3 to the exact(ish) position of your base station: ant2-pos1 =DEGREESNORTHOFEQUATORASADECIMAL # (deg|m) ant2-pos2 =DEGREESEASTOFEQUARTERASADECIMAL # (deg|m) ant2-pos3 =METERSABOVESEALEVELASADECIMAL # (m|m) The best way to determine the exact location of your base station is to average the uncorrected GPS positions over time - say a week. Or if you are in a hurry, you could just get the best measurement you can using Google maps. # cp rtkrcv.service /etc/systemd/system/ # systemctl enable rtkrcv.service # systemctl start rtkrcv Test whether it works: # telnet localhost 2833 You should get one line per second of readable numbers like 2017/02/18 03:01:11.000 -16.4745 23.1705 -3.8062 2 7 0.0314 0.0233 0.0429 -0.0080 0.0266 -0.0115 0.00 1.3 Which should accurately tell you where you are (in this case (-16.4745, 23.1705, -3.8062) from the base station, with FLOAT solution (the '2') with seven satellites. The machine which runs rtkrcv must be a RPi-3 (or some other desktop type machine). If your rover is a RPi-1 or RPi-2, this step will just never produce any output. I don't know why, something to do with floating point implementation in the gcc compiler and the CPU. Just get a RPi-3. A RPi-3 is better for robotics anyway, as it is more powerful / faster than a RPi-2, and the headroom can be used to make the robot smarter/faster. The _base_ _station_ can be a RPi-1 or RPi-2, as it only runs str2str, which doesn't have a problem. Use "Control-]" to get out of telnet. Now you need to write your robot software to connect to the localhost via TCP port 2833 and interpret the stream of numbers. (You could also write your robot software to connect to port 2832 on the rover and read the original GNSS data, which has useful stuff in it, like heading and speed, but this would involve taking stuff out of m8t_rover_1hz.cmd). Scott 2016-12-20 12:20:12 2016-12-31 17:55:38 2017-02-14 12:12:04 2017-02-18 15:51:02