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
Using 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!)
- Find your “Network Sharing Center”.
- Find the “Change Adapter Settings” –> Local Area Connection, click on “Properties”.
- Click on Internet Protocol Version 4 (TCP/IPv4). Make sure that you’ve selected “Obtain an IP address automatically”
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.
- Install Bonjour. If you have installed iTunes on your PC, Bonjour is already installed.
- Plug one end of your ethernet cable into your Raspberry Pi, and the other into your computer ethernet card.
- Power the Raspberry Pi up.
- You should see all of the lights flashing on the Raspberry Pi!
- You should be able to connect to the IP via Putty or VNC.
- 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.
- Open the example file in the BrickPi/Image directory in github here.
- 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.
- 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).
- We recommend adding a static IP address so you can log directly onto the Raspberry Pi over WiFi.
- 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).
- Remove any WiFi dongle from your Raspberry Pi.
- Place the USB thumb drive in your Raspberry Pi and power it up.
- 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.
- Insert your wifi dongle into the Raspberry Pi.
- 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.