4. Connect to the GoPiGo

4. Connect to the GoPiGo

How to connect to your GoPiGo robot to start programming it!

If you are brand new to the GoPiGo, just go to option 2 below to connect it to your computer and start programming!

If you are familiar with the Raspberry Pi, you know that it is a complete computer, and some people like to program it by just hooking it up to a monitor, keyboard and mouse. But, because most robots end up moving, hooking up a monitor, keyboard and mouse might be impractical.  We have developed extra options to make network configuration quick with the GoPiGo.  Here we explain the options we have come up with and offer some hints on how to get started using the GoPiGo.

STEP 1: Connect to your GoPiGo robot

Option 1: Setup as Desktop

RPi_quick_setupUsing a monitor, mouse, keyboard: the option great for those that area already familiar with the Raspberry Pi. The GoPiGo is designed to allow space for a keyboard, monitor, and mouse.  You may find that you need a USB hub to add a WIFI device to the GoPiGo.  The advantage of this configuration is that you don’t have to configure the WIFI on the Raspberry Pi, or login remotely on the computer.

For more information on this, we recommend browsing the Raspberry Pi Foundations Quickstart Guide.

Option 2: Connect to your computer with an ethernet cable

The Dexter Industries SD card comes configured with Bonjour, software which allows you to get the networking up and running with zero configuration.

  • If you are using Windows and don’t have iTunes installed, download Bonjour from here and install it, then move down to the Windows section below.
  • If you are on a Mac or already have iTunes installed then you have everything you need, and just move on down to the Mac section below.
  • If you are using your own image, just install avahi-daemon in your Raspbain image:
sudo apt-get update
sudo apt-get install libnss-mdns

Windows

  1. Make sure the GoPiGo board is switched off, motors are not connected and the batteries are not connected.
  2. Make sure your sd card is in the Raspberry Pi securely.
  3. Plug in your wifi dongle to a USB port on the Raspberry Pi.
  4. Connect your ethernet cable to your computer and to the Raspberry Pi.
  5. Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. Once the power is  connected to the wall, the GoPiGo will be on as well. You can switch it on if you’d like as well.
  6. On your computer, open Putty.  If your image is earlier than 2015.11.01, please update it using these directions.  If your image is later than 2015.11.01, your hostname is “dex.local” and your password is “robots1234”.  Press open.

putty_home

If everything goes according to plan, you’ll be prompted with a security prompt. Press “Yes

security

This will open a terminal and ask for a Username and Password. The username is “pi” and the password is “robots1234”. After entering the credentials, you’ll get logged on to the Raspberry Pi terminal.

opened

Next, go down to Step 2, where you will set up your Wifi.

Mac

These directions are for the Raspbian for Robots image “2015.11.01” or later.  If you have an earlier image, we highly recommend you update it.  Directions for doing this are here.

  1. Make sure the GoPiGo board is switched off, motors are not connected and the batteries are not connected.
  2. Make sure your sd card is in the Raspberry Pi securely.
  3. Plug in your wifi dongle to a USB port on the Raspberry Pi.
  4. Connect your ethernet cable to your computer and to the Raspberry Pi. (If you have a Macbook air you may need an ethernet to USB adapter)
  5. Plug in the wall power adapter into the Raspberry Pi, and then plug it into the wall to turn the power on. Once the power is  connected to the wall, the GoPiGo will be on as well. You can switch it on if you’d like as well.
  6. Open “Terminal” on your computer. This can be found in Applications/Utilities folder. You can also just search through it with “spotlight” (click on the magnifying glass on the top right hand side of your screen or press “command + spacebar which will open up the search bar and you can type in “Terminal”) to find it. Click on the terminal icon.
  7. Type in:
ssh pi@dex.local

You’ll be prompted to verify you’re trying to login to the Raspberry Pi.

7. Type “yes” and press return. Type the password, which is “robots1234” and press return.

Boom!  You’re logged into your Raspberry Pi and ready to start programming the GoPiGo!

8. The next step will be to get setup with VNC, which is a way to see a mini desktop version of what is going on in your GoPiGo.

Mac SSH into a Raspberry Pi

STEP 2: Connect to Wi-fi

To make your GoPiGo robot car work remotely, without keeping it plugged into the computer and wall at all times, we’ll want to set up the Wifi!

1. Your wifi dongle should already be in the Raspberry Pi and you are connected to it through terminal.

In order to setup your wifi dongle to work properly, you need some software. Also, make sure you know which wifi network your computer is using, as well as the password for that wifi network.

2. Go to:    https://www.realvnc.com/download/vnc/

3. Click Download for whichever version matches your computer.

4. If you don’t know what version of OS X you are running, click the apple icon in the far left top part of your screen and choose “About This Mac” and it will display the version of OS X you are  running.

5. Open the VNC file in your browser, of if it is not there, go to Finder->Downloads, and you will find it there.

6. Select Continue.

7. Select Continue.

8. Select Agree on this pop up.

9. Select Continue.

10. Deselect VNC Server, because you only want VNC Viewer. Select Continue.

11. Select Install and then you will get confirmation that the installation was successful. Select  Close.

12. Go to Finder-> Applications-> Real VNC -> VNC Viewer to open VNC Viewer.

13. In the VNC Server box type: dex.local:1

This is telling the VNC Viewer the following:

  • look for the “dex”
  • location is “local” (connected to your computer)
  • port = 1 (port is …)

You will probably get a pop up that looks scary and is a warning. Don’t worry!

It just means that the connection between your Raspberry Pi and your computer is not encrypted, which is a secure way of transferring data. This isn’t a big concern if you are doing this at home or in a trusted place, because no one else can get access to your computer.

14. Select Continue (and choose the check box if you don’t want to be warned about this again).

15. You will be prompted to put in a password to access the Raspberry Pi “hard drive” (SD card)  connected to your computer. The password for all Dexter Industry SD cards is: “robots1234”

16. Type: robots1234

17. Select OK.

You’ve done it! This screen is the VNC desktop. Remember, the VNC (virtual network computer) is basically a little virtual computer you are running inside your computer. This is the “desktop” for the Raspberry Pi computer connected to your computer!

It works pretty much the same way that your normal desktop does. The files and shortcuts you see will open files and run programs on the SD card in your Raspberry Pi.

18. Click on the icon in the middle of the desktop that says “WiFi Config”

19. Select the second tab: Manage Networks. Select the Scan button. The program will scan for wifi networks nearby.

manage_networks

This may take a moment, and in the meantime your screen will just be still.

20. Select the same network your computer is on by double clicking and you will get a pop up where you will enter  your PSK (which is the password for your wireless network).

SSID_Scan

Network_Info

21. It will take you back to the Scan screen, and just select Close.

22. Click on the first tab Current Status, then choose your network from the dropdown Network list, then select Connect.

23. This might take a few minutes. Do not panic if it tries to connect and comes back without an IP  address. Just select Connect again and after 3-5 minutes you should have an IP address showing.

24. If you do not get an IP Address to show, check the following:

  • Go back to Manage networks, select your wifi network by double clicking and re-enter the PSK (password). Maybe you entered in the password incorrectly before.

Good test to see if you are connected:

  1. Open LXTerminal icon on the VNC desktop (the Dexter Industries desktop).
  2. Type: ping google.com
  3. If you get a response like the picture below, then YOU ARE CONNECTED!!! Press “Control + c” to  get this to stop.
  4. Check the wifi Dongle and make sure it is securely attached, and there should be a red blinking light

Now that you are connected, go here for the next step!

For the more advanced that wants to setup Wifi With the Command Line.

If you want to setup wifi using the terminal or SSH, In the terminal, open your interfaces file for editing with the following command:

sudo nano /etc/network/interfaces

4.2 Interfaces File.  Your interfaces file should look like this:

RPi_Network_Command_line

 

4.3  Edit the File.  Edit the file by adding the network configuration information, and your networks SSID and passphrase below the last line.  Indent one tab!.

     wpa-ssid "ssid"
     wpa-psk "password"
 RPi_Network_Command_line_with_PSK_and_SSID

4.4  Save your File.  After adding your information, save and exit by typing “Ctrl-x” and choosing to save the file.

4.5  Reboot your Raspberry Pi.

4.6  Test your Wifi Adapter.  Test that your Pi recognizes the WiFi Adapter.  You can test by typing “ifconfig” in the terminal of the GoPiGo.  If  “wlan0″ is showing, the wifi dongle is recognized.

wlan0_unsuccesfully

wlan0 is successfully recognized by the Raspberry Pi. The Raspberry Pi knows you have a wifi device installed.

5.  Check for a Connection.  Check that you are successfully connected to the network.  In the command line, type

ifconfig

When RX and TX are showing 0 bytes, no data has been exchanged.  Below is a successfully connected Raspberry Pi to a wifi network.

wlan0_success

Successfully connected to a network. Note that RX bytes and TX bytes at the bottom have values greater than 0, indicating we’re connected and sending and receiving information.

Got a question?  We’ll do our best to answer in the forums here.