My Development Environment on the Raspberry Pi

I have been playing around the the Raspberry Pi for a while now, doing basic projects to get the hang of it. These projects have been very simple so far, not even worth blogging about them, but I found myself recreating the same (or very similar) environment on the RPi every time I started a new project. The reason I start from scratch every time is to learn all the special settings/setups a specific project requires.

I, however, found, that I can’t remember ever step and I keep researching the same thing on the internet over and over again. So I decided to create this article to serve me (and possible other beginners) as a collection of setups steps for different kinds of projects. This article may grow in the future as I progress, so I expect it to contain some advanced stuff as well later on.

I always start with the latest Raspbian (Debian Wheezy) image found at the RPi downloads page.

For the very first steps, until the SSH connection is established from my desktop PC to the RPi, I use a rig I created from a broken laptop and a small wireless keyboard.

Let’s see the steps now:

Stuff to set up in raspi-config

After the first time the RPi boots up:

Actions:

  • Expand Filesystem
  • Change User Password
  • Internationalization Options
    • Change Locale (if you’re not happy with the default one. I usually leave this as it is.)
    • Change Timezone
    • Change Keyboard layout (if you’re not happy with the default one. I usually leave this as it is.)
  • Advanced Options
    • Hostname: I tend to use the same one at the beginning. When it becomes a full blown, permanent device, then I come back here and I give it a specific name.
    • Memory split: Since I normally use a headless system, i.e. no graphical desktop is used, I assign as little to the GPU as possible. I usually go with 16 – the smallest recommended setting.
    • SSH: Enable

Reboot.

At this stage, the RPi starts with DHCP on, so it will take an IP address from the local DHCP server. There are a few ways of finding out what IP address it took. If you have a monitor connected to the RPi, you can simply read the new IP address from it. It says something like this:

If you have a headless system, then you may need to go to the DHCP server and see the connected devices’ list. Or you can use a network discovery app, like Fing to show you all the properties of all the connected devices.

Setting up a static IP address on the Raspberry Pi

Once connected to the RPI using SSH, using the following command you need to edit the file /etc/network/interfaces:

Change the lines related to the network interface you are using (eth0 or wlan0, usually) to something like this:

On Debian Jessie you need to edit the file /etc/dhcpcd.conf instead:

At the end of the file enter something like this:

Reboot.

Once the system is up and running again, it will use the new, static IP address.

Sharing a directory on the Raspberry Pi with Windows computers on the same network

Once I finish working on a project at the end of the day, I create a backup of my work. To do that I need access to my project files on the RPi from my desktop PC. This is how to set it up:

Install samba parts:

Modify /etc/samba/smb.conf:

Change the following areas:

In the Share definitions section:

Restart the Samba service:

Finally, create samba password for the user “pi”:

Done!

User “Pi”‘s home folder seen on a Windows PC

Your thoughts?

This site uses Akismet to reduce spam. Learn how your comment data is processed.