Connect your simpleRTK2B to a Raspberry Pi

Raspberry Pi with simpleRTK2B

Some users have asked us how can they connect their simpleRTK2B boards to a Raspberry Pi and we have prepared this guide to show all the steps necessary.
Notice that there are many different models of Raspberry Pi, to prepare this tutorial we have used Raspberry Pi 3 Model B v1.2.

In this tutorial we will use a remote connection to the Raspberry Pi to avoid using a dedicated keyboard/mouse/screen for the Raspberry Pi.
If you have them you can skip all the steps related to the remote connection.

Required hardware:

  • Raspberry Pi 3 Model B  v1.2 (this tutorial will probably work with any model)
  • micro SD card for the Raspberry Pi OS
  • simpleRTK2B
  • Raspberry Pi adapter for simpleRTK2B
  • Computer for remote connection (we use Windows 10 for this tutorial)
  • Network cable (RJ45)

Required software:

Step 1: Install Raspberry Pi operative system

  • Connect the micro SD card to your computer
  • Run SDFormatter and select the SD card drive letter
  • Go to Options and select Format Size Adjustment ON
  • Click the Format button (acknowledge all warnings)
  • Download the last version of Raspbian operative system.
    Choose the option with Desktop and recommended software.
  • Unzip the file and store the .img file in your Desktop
  • Run Win32DiskImager
  • Select the .img file from your Desktop and click Write (acknowledge all warnings)
  • With the micro SD card still in your computer, open the BOOT drive
  • Open the file cmdline.txt with a text editor and add the following text at the end: ip=10.0.0.1 and Save the file
  • Create a new empty file in BOOT called ssh, without any extension (you can create a txt file and remove the extension)
  • Eject the card from Windows

Step 2: Setup remote connection

  • Go to the Windows Control panel > Network and Internet > Network connections
  • Make sure your Ethernet connection is enabled (if not, right click on Ethernet and select enable)
  • Right click on the Ethernet connection > Properties > Select Internet Protocol Version 4 (TCP/IPv4) > Click Properties button
  • Set addresses as in the below picture, click OK, click Close
  • Connect the micro SD card to your Raspberry Pi
  • Connect a network cable between your Raspberry Pi and your computer
  • Power your Raspberry Pi, wait a few seconds
  • Open PuttY application and set Host Name to 10.0.0.1, click Open (acknowledge all warnings)
  • A command prompt will open, use the following credentials
    Username: pi
    Password: raspberry
  • Congratulations, your have remote access to your Raspberry Pi!
    If you have a screen and keyboard for your Raspberry Pi, you can skip all the previous steps and continue from here

Step 3: Configure Raspberry Pi UART to communicate with simpleRTK2B

  • On terminal, run sudo raspi-config
  • Select 5 Interfacing Options
  • Select P6 Serial
  • Choose <No> (Would you like a login shell to be accessible over serial?)
  • Choose <Yes> (Would you like the serial port hardware to be enabled?)
  • Choose <Ok> and <Finish>
  • When asked to reboot, choose <Yes>, PuttY session will close automatically

Step 4: Testing communications

  • Plug the GNSS antenna to your simpleRTK2B
  • Connect the simpleRTK2B (with default configuration) to the Raspberry Pi with the adapter
  • Open PuttY again and connect as in Step 2
  • Enter credentials and type: sudo nano test.py
  • Type the following code:

    This is a script that will read information from the simpleRTK2B.
    The baudrate configuration is valid for the default configuration of the simpleRTK2B and can be changed if needed.
  • Press Ctrl+X and Save changes
  • Type: python test.py
  • You should see incoming NMEA sentences like in the below picture
  • Press Ctrl+C to exit
  • Congratulations, you can now read GNSS data streams in your Raspberry Pi!!

Bonus: GNSS diagnostics on your Raspberry Pi

  • Let’s enable the Raspberry Pi WiFi to connect to the Internet and download some sw packages
  • Type sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
  • Add the network part as in the below picture,where ssid is your WiFi SSID and psk is your WiFi passworkd
  • Press Ctrl+X and Save changes
  • Type sudo reboot, which will reboot your Raspberry Pi (and close the PuttY session)
  • Open again the PuttY session
  • Type sudo aptget install gpsd gpsdclients python-gps and wait for the package installation (acknowledge all warnings)
  • Type:
    sudo systemctl stop gpsd.socket
    sudo systemctl disable gpsd.socket
    sudo gpsd /dev/serial0 F /var/run/gpsd.
    sock

  • Type gpsmon and you will see a monitor of the GPS status
  • Press Ctrl+X to exit the monitor
  • Type cgps for a lighter monitor
  • Press Ctrl+X to exit the monitor