4. Connect to the PI Robot

4. Connect to the PI Robot

How to use the Raspberry Pi and BrickPi.

We have some guidance on setting up the network aspect of Raspberry Pi and the BrickPi.

Because most robots end up moving, hooking up a monitor and micro USB cable power supply might be impractical.  We have developed extra options to make network configuration quick with the BrickPi.  Here we explain the options we have worked into the BrickPi Image for Network Configuration here and offer some hints on how to get started using the BrickPi.

These are “run once” operations.  After setting up your BrickPi, you will be able to connect without making the changes again.

The last two options are for controlling your Raspberry Pi; once you have a connection setup, you can use the Putty Command Line or VNC to start programming.

Option 1: Setup as Desktop

RPi_quick_setupUsing a monitor, mouse, keyboard: the bullet-proof option.  The BrickPi case 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 BrickPi.  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 with Ethernet Cable

This option explains how to connect to the Raspberry Pi using a LAN / Ethernet cable.  The option is almost as bullet-proof as Option 1, but it’s much less cumbersome than setting up a monitor, keyboard, and mouse.  All you need is a separate computer with a LAN card and a LAN cable.  Here’s a step by step set of instructions for connecting to your Raspberry Pi robot with an ethernet cable.

Windows:  Setup your LAN Connection to Obtain IP address automatically.  (Looking to connect from a Mac?  Look here!)

  1. Find your “Network Sharing Center”.
  2. Find the “Change Adapter Settings” –> Local Area Connection, click on “Properties”.
  3. Click on Internet Protocol Version 4 (TCP/IPv4).  Make sure that you’ve selected “Obtain an IP address automatically”
1 - Wired Connection - Network Connections

1 – Wired Connection – Network Connections

2 - Wired Connection - LAN Connection Properties

2 – Wired Connection – LAN Connection Properties

3 - Wired Connection - TCP Connections - Check you're obtaining IP automatically.

3 – Wired Connection – TCP Connections – Check you’re obtaining IP automatically.

 

 

OLYMPUS DIGITAL CAMERA

Now, we setup the Raspberry Pi SD card and connect:

The latest SD Card image has Bonjour printer services installed and will show up on your network on the “raspberrypi.local” as your IP address if you’ve successfully installed Bonjour on your PC.

  1. Install Bonjour.  If you have installed iTunes on your PC, Bonjour is already installed.
  2. Plug one end of your ethernet cable into your Raspberry Pi, and the other into your computer ethernet card.
  3. Power the Raspberry Pi up.
  4. You should see all of the lights flashing on the Raspberry Pi!
  5. You should be able to connect to the IP via Putty or VNC.
  6. To test if your Pi is connected on the network, open the windows command line and type “ping raspberrypi.local”.  If you have successfully connected, you should see a response.

Option 3: Connect with WiFi

The most autonomous way to connect to your BrickPi robot is through a WiFi dongle.  The most reliable way to set this up on your local WiFi network is to use Option 1 or Option 2, and change your wifi setting on the Raspberry Pi.

interfaces_fileWe have developed a more convenient way to set this up using a USB drive.  You simply put your network information in a file in the root directory of your USB.  Here’s a step-by-step:

  1. Open the example file in the BrickPi/Image directory in github here.
  2. Copy the file “interfaces.dat”.  Open in WordPad on your Windows computer, or your preferred text editor on the Mac.  Do NOT open in Windows text editor as the formatting will be destroyed.
  3. The file should have the SSID, PASSWORD, IP address and other configurations necessary to make a connection to a WiFi network.  Change these to the appropriate values to connect to your WiFi network.  (You can quickly see your network settings in the Windows command line by typing “ipconfig” in Windows).
  4. We recommend adding a static IP address so you can log directly onto the Raspberry Pi over WiFi.
  5.  Save the file to the root directory of a USB thumb drive, as “interfaces”.  This should not be interfaces.txt, or interfaces.dat, it should be “interfaces” (no extension).
  6. Remove any WiFi dongle from your Raspberry Pi.
  7. Place the USB thumb drive in your Raspberry Pi and power it up.
  8. Let the Raspberry Pi setup the interface.  It should automatically reboot after about 2 minutes, and restart.  After waiting 2 minutes, remove the USB thumb drive.
  9. Insert your wifi dongle into the Raspberry Pi.
  10. Your Raspberry Pi should now automatically connect to your wifi network.

Note: This operation will be performed only on boot.  This will not work if you first start your Raspberry Pi, and then insert the pen drive.

Note: If this operation is successful and the WiFi information is correctly setup, it will delete the interfaces file from your dongle.

Questions?  Ask away on the forum.