top of page
WFU Robotics

Setting Up Your Raspberry Pi

Updated: Apr 10, 2021

The Raspberry Pi is a miniature, very portable computer which we will use onboard most of our robotics projects. If you have never used a Raspberry Pi, it may be intimidating at first, but you will soon see that it is not too difficult to work with.


First, we should try connecting to the Raspberry Pi. There are two main ways you can access the Pi, through an external monitor with keyboard and mouse, or through ssh tunneling, a method used for accessing machines remotely. We will go over both of these methods. While using the Pi through an external monitor is the easiest method, to instruct the Pi when it is mounted onboard a robot, you will have to ssh, so everyone should know how to do this.


For those with an external monitor, mouse, and keyboard:

First, connect an hdmi to hdmi cable from the hdmi slot on the Pi, to your monitor. Then, connect your mouse and keyboard via one of the usb ports on the Pi. Then simply connect the Pi to the supplied power cord via the micro-usb port on the Pi. Your monitor should display four raspberries in the upper left corner, and shortly the desktop display should appear.


If you are using an assigned robotics club Pi, it should automatically connect to WiFi. This allows you to download any Python packages you wish to use for your programs. For Diddybot programs, all necessary packages are already installed.


We recommend writing your Python scripts directly on the Pi using the pre-installed Thonny Python IDE, since that is the easiest way. If you prefer writing your code on your local machine, we provide instructions for transporting files from a local machine to the Pi in a future tutorial.


For those without an external monitor:

Without a monitor, you can still use the Pi's full functionality, but it will just be a little bit harder. If you want to put programs on your Pi for execution, you can either create and edit them directly using ssh tunneling and linux commands, or you can create them on your local machine and then transfer them to the Pi using scp. We will cover both methods in this tutorial and the next.


SSH Tunneling:

SSH tunneling is a method for accessing, creating, and editing files on a remote computer through the command line (Windows) or Terminal (Mac/Linux).


What you need:

The Pi's IP address. This number is a code which will allow you to connect to your specific Pi. Check your robotics club-issued box for this number.

The Pi's ssh username and password: The default username is 'pi', and the default password is 'raspberry'. The robotics club uses this default login.

Some basic knowledge of how the file system works and how to navigate in on Linux. See this tutorial for a great introduction to this system.

A turned on Raspberry Pi, connected to power.


For Mac/Linux Users:

Open up an instance of the Terminal program. Then enter:


ssh <username>@<ip_address>

Do not include the "< >" when entering username and ip address. If the ssh username has not been changed, it should be "pi".

You will be prompted to enter the password. By default, this is "raspberry".

You will also be asked if you want to connect, enter "yes".

You should now be successfully connected to your Raspberry Pi, and placed in the home directory. Navigate around the file system using Linux commands to get an idea of how we have laid out the files. If you are more familiar with Linux, you can create and edit files in whichever directories you want.


For Windows Users:

ssh is a function meant for Linux-based systems. That means you will have to tunnel to the Pi through a third-party application. The most common method is through PuTTY, download it here.

Open the application. In the field labeled "Host Name (or IP address)", put the given IP address of the Raspberry Pi. Then click "Open", and say yes to the security alert. Then, enter the username "pi" when prompted, and then the password "raspberry".

Feel free to play around in the file system and get used to navigating it with Linux commands. These will be helpful in the future.


That's it! Since your programs will have to be placed on the Raspberry Pi and be ran through SSH tunneling, it is important that you are confident in your ability to access a Pi remotely. Next time, we will go over copying files to and from the Pi.

17 views0 comments

Recent Posts

See All

Comments


bottom of page