Dr. Franz Fasching designs, develops, and manages IT and telecommunications solutions. more ...
Prior to installing the RasPiGNSS make sure you have:
Note: The Raspbian images from 2014-09-09-wheezy-raspbian.img onwards enable pulldowns on the GPIOs and therefore the RasPiGNSS RESET pin (P1 pin 12, GPIO 18) by default. This keeps the NV08C-CSM always in a RESET state, and the board seems “dead”. In order to make the RESET pin work as intended you first have to disable the pulldowns with
rpio pulloff 12prior to using the device. This restores normal behaviour of this pin as was the case with the previous 2014-06-20-wheezy-raspbian.img. All tools mentioned below have been updated to reflect this new firmware change.
Note: On the newer Raspberry Pi models (A+, B+, 0, 2, 3), which feature a 40-pin expansion port, the RasPiGNSS needs to be mounted on the first 26 pins, which are electrically compatible to the earlier models A and B. The first 26 pins on the new models are the ones starting right beside the power and activity LEDs. You can see how it needs to be mounted on a model A+ on the picture above.
/boot/config.txtthe UART clock is set to 6 MHz. Insert the line
/boot/config.txtand reboot. Otherwise you cannot switch the RasPiGNSS to BINR mode which requires a baud rate of 230400 baud on the UART.
/dev/ttyAMA0serial port is unused! (see Preventing Linux from using the serial port on the eLinux wiki)
/dev/ttyAMA0, so add the user under which you’re executing those scripts to the ‘dialout’ group or execute them with root privileges. These tools are provided under a GNU public license.
nvsmodeswitches serial port parameters and NV08C operating modes
nvsfwflashes new firmware onto the NV08C; Note: Package
sudo apt-get install lrzsz)
nvsctlfor intialising and controlling the NV08C
nmeacmdissues a NMEA command to the NV08C, see NMEA protocol specification
binrcmdissues a BINR command to the NV08C, see BINR protocol specification
rpiogeneric tool to read and set the RasPi’s GPIO ports; Note: Device::BCM2835 module from CPAN required. For the Pi2 use at least version 1.39 of Mike McCauley’s bcm2835 library. For convenience you may download a compiled and packaged Debian package of this library here.
nmeaparsehelps to get an overview of the satellites in view and used for a solution in NMEA mode. Remember to switch to NMEA mode with
nvsmode nmeabefore using this command! You can find a more detailed description of this command in the FAQ.
Note: Most of the tools need access to the RasPi GPIO ports and therefore to the
/dev/memspecial device, which needs root privileges to be accessed. So either execute those tools as root, use
sudo sometoolor set the tools
chmod ug+s sometool.
Note for Debian “Jessie”: In
/boot/cmdline.txtthere is no reference to
/dev/ttyAMA0, this is called
console=serial0,115200- remove that. Also, with the switch from
/etc/inittabhas vanished. In order to disable a
/dev/ttyAMA0run the commands
sudo systemctl stop serial-getty@ttyAMA0.serviceand
sudo systemctl disable serial-getty@ttyAMA0.service.
Note: On the Pi3 there has been a hardware change: The previous PL011 UART
/dev/ttyMA0is now used by the Bluetooth chip. The pins used by the RasPiGNSS for serial communication with the NV08C-CSM are now mapped to
/dev/ttyS0mini-UART. This mini-UART, however, does not have its own clock generator, but uses the CPU clock. CPU clock scaling due to undervoltage or heat causes baud rate glitches and therefore transmission errors. Therefore I strongly discourage use of the
/dev/ttyS0port for use with the RasPiGNSS. Fortunately there’s a device tree overlay
pi3-miniuart-btthat restores the old behaviour and remaps
/dev/ttyAMA0to the GPIO pins used by the RasPiGNSS, and makes the Bluetooth chip use
/dev/ttyS0. For this to work, insert
/boot/config.txt. Look up the details in the Raspberry Pi forums.
Note: On the Pi3 with the latest Raspbian Jessie release (from 2016-05-27) you need to manually re-enable the UART, because it will be switched off by default now. Put
/boot/config.txtto re-enable the UART, otherwise
/dev/ttyAMA0will be gone.
The NV08C can operate in various operating modes, the most important are NMEA mode (which is the default), and BINR mode (for raw data streaming). Furthermore, each of these modes supports a range of different baud rates on the serial port. To simplify mode switching, use the tool
nvsmode, which switches the RasPi
/dev/ttyAMA0 serial port and the NV08C from NMEA 115200 8N1 to/from BINR 230400 8O1. The following examples assume that you have all of the above utilities installed at a location included in your shell’s
-vcommand line option turns on “verbose” mode for all tools below. You may omit that when using the tools in your own scripts. You may obtain detailed help and usage information for each command with the
--helpcommand line options.
IMPORTANT! Before using the RasPiGNSS make sure you initialise the GPIOs on the expansion port with the following command:
# nvsctl -v init
Otherwise the RasPiGNSS seems to be “dead”, because due to the new firmware settings the NV08C will be kept in RESET!
First you have to switch the NV08C to NMEA mode, in case it isn’t:
# nvsmode -v nmea
Then you can view the NMEA message stream simply with:
# cat /dev/ttyAMA0
You can send NMEA commands to the NV08C, e.g. set navigation parameters to include SBAS corrections, 60 degrees elevation mask, 10Hz navigation rate, 30dBHz min SNR, and no position filter:
# nmeacmd -v PONAV 1 60 10 30 0
You can find the full NMEA documentation for the NV08C at the NVS website.
You may obtain the full BINR specification for the NV08C at the NVS website.
First you have to switch the NV08C to BINR mode, in case it isn’t:
# nvsmode -v binr
Then you have to enable the binary message types you like to show up in the BINR stream. The following sequence will set the navigation rate to 2 Hz, enable raw data output for use with RTKLIB, and enable SBAS corrections:
# binrcmd -v NAVRATE 2 # binrcmd -v DIFFCOR 2 1 # binrcmd -v RAWDATA 5
Note: When scripting initialization sequences for the NV08C it may be necessary to wait a certain amount between initialization commands for the NV08C to properly process the command. You may achieve this using e.g.
binrcmd WAIT 200to wait 200 ms.
Besides the command line utilities the tar file provided above also contains an example initialisation script
rtkrcv.conf configuration file.
binrcmd -v init.cmd to initialise the RasPiGNSS.
init.cmd looks like this:
# reboot without erasing saved parameters WARMSTART WAIT 200 # set navgation rate in Hz (1,2,5,10 Hz) NAVRATE 2 WAIT 200 # differential correction SBAS w/ RTCA troposphere model DIFFCOR 2 1 WAIT 1000 # raw data output in intervals of dezi-secs (100ms) # 1 -> 10Hz, 2 -> 5Hz, 5 -> 2Hz, 10 -> 1Hz (inverse # setting but must be the same or greater than NAVRATE !!) RAWDATA 5 WAIT 200 # bit information transmitted by satellites BITINF 1 WAIT 200 # reboot without erasing saved parameters WARMSTART WAIT 200
Then you can dump the BINR message stream to a
.nvs file for processing with RTKLIB simply with:
# cat /dev/ttyAMA0 >binrfile.nvs
Consult the NVS BINR specification for a detailed description of available message types.
Note: If you intend to use
rtkrcvfrom RTKLIB v2.4.2 make sure you enabled NVS support (see issue #91 at RTKLIB support). We provide a precompiled RTKLIB version 2.4.2p4 commandline binaries for your convenience for the Raspberry Pi including a sample configuration file for
rtkrcvin PPP mode.
When initialised properly you may then run
rtkrcv -s -p 2950 -o rtkrcv.conf to start the server reading commands from
/dev/ttyAMA0, providing a monitor stream on port 2950 and an NMEA output stream on port 2947.
To help setting up an RTK system consisting of base station and rover, additional files are included in the
rtkbasewith config file
/etc/rtkbase.conf- this sets up an RTK base station as an RTCM3 server, to which the rover connects to.
/etc/rtkrover.conf- a sample rover config file for
rtkrcvusing base station RTCM3 input.
You may configure this setup to directly deliver NVS BINR protocol to the rover. This setup needs more bandwidth than a pure RTCM3 one, but delivers more information to the rover (esp. bit information from satellites), that is not present in the RTCM3 protocol. In this case you have to modify both
/etc/rtkrover.conf to use NVS BINR (“nvs”) as the communications protocol.
You have to have a communication channel between base station and rover for those messages. This can be anything from a WiFi link, a Bluetooth connection, or a dedicated RF communications module (e.g. the ISM-band XBee modules).
You can flash new firmware onto the NV08C with:
# nvsfw -v nv08_p2_CSM_WRITE_NNNN.bin
Firmware updates may be obtained from the NVS website. As of this writing, firmware version 2.06 is the most current one, however 2.07 seems to be about to be released soon.
You can reset the NV08C with the following command:
# nvsctl -v reset
This pulls the RESET line of the NV08C low, waits for 100ms, and sets it high again.
The LEDs and switches are connected to regular GPIO pins on the RasPi P1 expansion port, and may be controlled with any suitable GPIO switching tool like the WiringPi library. The
rpio utility is included for that purpose that simplifies GPIO handling significantly; however you have to install the
Device::BCM2835 Perl module from CPAN first. To switch all LEDs on simultaneously use:
# rpio -v hi out 15 16 18
This switches pins 15, 16, and 18 to output mode and sets them to a high level thus turning on the LEDs. To switch them off again use:
# rpio -v lo 15 16 18
The pins still remain configered as outputs after this command. To configure pins as input, enable pullups, and read their pin status use:
# rpio -v in pullup read 7 11 22
This configures pins 7, 11, and 22 as inputs, enables pullup resistors on them, and reads their pin status, thus querying if any of the tactile switches or the reed contact have been actuated.