Skip to content

Raspberry Pi B Plus Raspbian setup

Jason Charney edited this page Nov 4, 2015 · 6 revisions

UPDATE: Anything about the Wifi should be ignored. Install wicd-curses!

But what about the Raspberry Pi 2?

Funny story about that. About a month after I considered getting a Raspberry Pi B+, the Raspberry Pi 2 came out. When and If I feel like getting a RPi 2, I'll let you know.

How to build a Pi Hacktop

Introduction

Before I started using my ODroid as my primary Single-Board Computer (SBC), I used a Rasberry Pi B. With the introduction of the Rasberry Pi B+, creating a hacktop is so much better. If you really want to go all out, get an Odroid.

What you'll need for this project

  • Raspberry Pi B+ (If you have a Pi B, you can still do this.)
  • A Raspberry Pi B+ enclosure (if you have a Pi B, then Pi B enclosure.)
  • Stick-on alluminum heatsinks. (You can find these on Amazon for about $5. They don't really come with most enclosueres.)
  • A Motorola Atrix Lapdock (search eBay!) (Don't get the Motorola 100 or 500 Lapdock. I think the Lapdock for the Motorola Droid Bionic should be OK. The only difference is that the Atirx and Bionic's microUSB and microHDMI ports are on different sides.) Be sure that it comes with the charger.
  • A Class 10/U-1 microSD Card. 16 GB or larger (8 GB is NOT enough; you can get it cheap at MicroCenter) with a Kang image loaded on it. 32 GB is recommended.
  • Wifi Dongle (I find Trendnet's N150 to be discreet as well as good enough for any Raspberry Pi or ODroid project.)
  • A roll of black industrial Velcro. (About 10 feet. You can find this at your local hardware store. The width should be 1 inch.)
  • A pair of fabric shears (used to cut the Velcro)
  • 6 to 8 inch USB male (USB male A) to microUSB female cable. We will call this cable "Cable A". (See note below.)
  • 10 to 12 inch HDMI male (HDMI type A male) to microHDMI female (HDMI type D female) cable. We will call this cable "Cable B". (See note below.)
  • 6 to 8 inch microUSB male to USB male (USB male A) cable. We will call this cable "Cable C". (See note below.)

The last three items on this list will be hard to find, but it is important that you do not go on to eBay to get them. With things like "Rubber Duck" devices that could easily be embedded into questionable products, most of them becoming more Chinese in origin, especially for computers, as a security caution, it would be best to stick with a reputable dealer either in the United States or within your own country. (Assuming your country isn't being a jerk about electronic privacy. A trip to EFF.org might help.) I'm trying to think of where is a good spot to get these items.

I prefer wires over adapters as adapters require the need for cutting or breaking something. If we can avoid that, that would be much better.

I will post links to these items from a site that seems trustworthy enough in the future.

Hardware Instructions

  1. Assemble Raspberry Pi by putting the B+ into the B+ enclosure. Be aware that the B+ enclosure at MicroCenter needs to be put in in a certain direction so that the B+ clips into the enclosure.
  2. Stick on the aluminum heatsinks. There should be a larger one that sicks on top of the CPU and a smaller one that sticks on top of the smaller processor.
  3. Add any Pi accessory like a GPIO cable (sold separately) or Camera module (sold separate) or various shields. If you can, then put the top half of the enclosure on.
  4. Place two pieces of industrial Velcro on the bottom half of the Pi enclosure. Do not cover any of the slots or the two mounting holes. I recommend putting the soft side on the Enclosure and the rough side on the back of the lapdock. Also, put the rough and soft sides together then use sewing shears to cut a two pieces of slightly smaller than the length of the enclosure pieces. Take the plastic backing off the soft side when sticking onto the enclosure, but not the rough side until we get to the lapdock step. Industrial Velcro is not effective unless the adhesive on the back of the soft and rough sides are stuck on the hard surfaces for more than a few hours. Choose where to put it wisely! Alternatively, cutting two long strips of rough side and sticking them at a parallel distance as the soft sides on the enclosure might be a good idea, especially if you upgrade to an Odroid or get another Pi. The first piece 2 inches from the hinge of the lapdock and the second piece about 1 1/2 inches above that. (Do that around step 9 later in these instructions.)
  5. Plug the WiFi dongle into one of the four USB female slots. The top one in the middle is the best spot.
  6. Plug Cable A into a USB female slot. We recommend the one below where you plugged in the WiFi dongle.
  7. Plug Cable B into the HDMI female slot.
  8. Plug Cable C into the microUSB female slot. If you have a Raspberry Pi model B (not B+), this step can be skipped.
  9. With the laptop in the closed position, prepare to adhease the Raspberry Pi to the back of the screen. DO NOT place it near the hinge! Instead put it two inches above the hinge such that the enclosure can't touch hinges and the wires can connect freely. The second piece should be put about 1 1/2 inches above that piece, parallel to that piece. It is preferred the rough side is aheased to the back of the monitor rather than the soft side.
  10. Open the lapdock, and watch the machine boot up. If Wifi still doesn't work, you may need to hook up the Pi to a router via Ethernet. But that is why I recommend that any distro be loaded with Wifi drivers preinstalled.

Software Instructions

THIS IS IMPORTANT, ESPECIALLY ON THE FIRST BOOT! On the first boot, a dialog will appear. This will open raspi-config

  1. Select Expand Filesystem, Item 1, and press Enter. This will resize rootfs from 4GB to the size of the SD Card. Press Enter when it is done.
  2. Change the user password, Item 2, and press Enter. The default password is raspberry for the default user pi. If you don't feel like it you can do that later using chpass.
  3. Enable Book to Desktop, Item 3, and press Enter. I'm more of a command line person, but if you are setting this up for kids to learn computers or if you are new, saying yes won't hurt. Leaving it disabled is ideal on the Raspberry Pi. You can always launch LXDE (or another Desktop if you set that up) using startx later.
  4. Internationalisation options, Item 4, and press Enter. Because everything is setup to be British, you will need to do this especially if you are American. Also, the keyboard on the Atrix Lapdock will be screwed up if you don't.
  5. Change Locale, Item 1, and press Enter. American English isn't the same as British English. So deselect anything en_GB or en_UK and select en_US.UTF-8 UTF-8. If you want, also en_US.ISO-8859-1 and en_US.ISO-8859-15 ISO-8859-15. These may be useful for software compatibility. Press SPACE to select and deselect. Press TAB when you are done to select OK then Press Enter.
  6. Another prompt may show up asking to select a default locale. I would recommend selecting en_US.UTF-8 then pressing enter. If anything we can reconfigure this later with sudo dpkg-reconfigure locale.
  7. When that is done, we find ourselves back at the main menu. Select Item 4 again and press Enter and this time Change Timezone, Item 2, then press enter.
  8. Again, since we're in America, we can select US from the list then press Enter. Since I am in the Central Time zone, I'll select Central then press enter. Keep in mind, Raspberry Pi does not have a clock battery, so in order for the computer to since with the Atomic Clock, it needs to find an Internet Conenction. We'll need to deal with that later. Also, we can reconfigure our timezone later if need be with sudo dpkg-reconfigure tzdata.
  9. Option 4 and Enter again one last time to set our keyboard. Select Change Keyboard Layout, Item 3, then press enter. Again, the British keyboard layout is in effect. If we don't set this to something more America, the keyboard will not type correctly. Also, because I like to converse in Spanish sometimes, I'll want to set up my keyboard to allow me to input Spanish characters. This step will be very important if you are taking Spanish, French, Portuguese, or German: We're going to enable the Alt Greater (AltGr) key, that is the right Alt key, to type special characters.
  10. Select Generic 105-key (Intl) PC then press Enter. Scroll to the bottom and select Other then press Enter. Select English US then press Enter. Select English (US) - English (international AltGr dead keys) (NOT English (US) - English (US, international AltGr dead keys)!) then press enter. Select The default for the keyboard layout and press Enter. Select No compose key then press Enter. Select No then press Enter. If we need to fix anything, we can use sudo dpkg-reconfigure keyboard-configuration later.
  11. If you have the camera module, you can go to Enable Camera, Item 5, press enter, then select Enable, then press enter. Otherwise, you can skip this step.
  12. You don't need to use Add Rastrack, so skip that too.
  13. Unless you have like a dozen Raspberry Pis you are willing to sacrifice, I'd also recommend skipping Overclock.
  14. Select Advanced Options, Item 8, then press Enter. More than likely, after setting each one of these settings, you'll be sent back to the main menu. Just remember to come back here.
  15. If you have this set up in an Lapdock setup, you don't need to worry about setting up the Overscan unless you actually see black bars. Se we can skip that.
  16. You should change the host name of you device. Select Hostname, Item 2, and press Enter. Press Enter again. The default is raspberrypi. Type in the new name then press Enter.
  17. Let's not mess with the memory split. The default is 64 (64 MB), but for now we'll keep it as is.
  18. SSH should definitely be enabled for Raspberry Pi. Select SSH, Item 4, press enter, then select Enable, then press Enter. Press Enter again. This will allow us to talk to the Pi from another computer using an SSH program like PuTTY on Windows or the ssh command on Linux.
  19. I'm not familiar with with what Device Tree does, so lets skip that. If you are in the prompt, you can press Escape and nothing should change.
  20. Let's not concern ourselves with SPI, I2C, or Serial. So skip those.
  21. Audio is fine. Basically, Audio will go through HDMI unless you stick a set of headphones in the headphone jack. So we don't need to mess with that.
  22. Finally, I wouldn't mess with the Update option. Just don't. (This step probably should be moved in the future so it is one of the first things done.)
  23. Everything should be set to go. Go to the main menu. Right arrow twice to select FINISH.
  24. sudo reboot to make those changes happen.
  25. The next thing we need to do is set up Wifi. Assuming you inserted the USB Wifi dongle, using the nano editor (since we don't have vim installed yet), sudo nano /etc/network/interfaces and make the changes according to the New part of the /etc/network/interfaces section. Press CTRL+O, press enter, then press CTRL+X.
  26. sudo service networking reload. If successful, when you run ifconfig the wlan0 section should have an inet addr line with something like 192.168.1.something.
  27. sudo apt-get update && sudo apt-get upgrade -y to update any software.
  28. sudo reboot one more time and you are ready to roll...of course you'll still want to install some software.

/etc/network/interfaces

Old

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

New

#loopback
auto lo

# ethernet
iface lo inet loopback
iface eth0 inet dhcp

# wlan (dhcp config)
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
	wpa-ssid "<Networkname>"
	wpa-psk "<Networkpassword>"

As much as I'm not a fan of setting up WiFi like this in this fashion, it is necessary as, wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf will not work unless iface wlan0 inet manual.

The reason I am not keen about doing it this way is that you have to change the settings manually and still need to know what the local networks are. Odroid users don't have to worry about this because a GUI boots up on start up and is way better than what Raspberry Pi uses.

But I really want to set up Wicd to handle my connections not the Wifi GUI that Raspberry Pi still comes with. Which is why this section is still under construction.

A few caveats!

  • Raspberry Pi is SLOOOOOOOOW. [insert turtle emoji here]. If you are looking for something faster, I would suggest using an ODroid. The Kodos project has the instructions for building an Odroid lapdock.
  • NEVER CLOSE THE LID! The lapdock will stay operational as long as the lid stays open. If you close the lid, even for a second, it powers off. Odroid lapdocks don't have that problem.
  • B+ needs power from the Lapdock, NO EXCEPTIONS! If you read the instructions for Kodos on hwo I managed to get power supplied to the Odroid, you may have noticed I used a powerpack. With the B+, you can't really use this hack. Sure, you can run the B+ off of a powerpack (i.e. the Anker Astro E4 external battery), but plug the B+'s power into a battery pack and you'll get nothing when you open up the lapdock. If you are to run the B+, you MUST have the MicroUSB power port plugged into one of the Lapdocks USB ports. Not the microUSB plug next to the microHDMI plug. You standard USB Type A outlet. Older Pi B users don't need to worry about this. Pi B+ users still get the advantage of one extra USB port even with this setup.
  • Don't use Adapters to do a Cable's Job. As I previously stated, I prefere using cables over a whittled set of adapters. Sure, a couple of the cables are hard to find, but if you can get them, get them!
  • Be sure to take it apart before going to the airport. In a post 9/11 world, there's bound to be some fool who thinks your harmless computer project is malevolent. Until there is a way to enclose all the "spooky parts", we've designed these instructions to be modular. So when the TSA asks you "What's this thing" you can say in their face "This is a computer! I built it. I'm proud of it. And I would prefer that your dirty latex gloves that have been touching other people's dirty sweaty bodies all day not touch it, thank you very much!" I'm not sure how they would react, but there are enough places in this world where you need to get an intimate pat down.

What do do after you've done this

I recommend using your Hacktop in conjunction with a more powerful computer, like a desktop or laptop. You can use SSH, SSL, and VNC on this to remotely access a more powerful machine. I plan on writing something about that later.

But if you're looking for something to do some quick hacking on the go, or if you're completely new to Linux and want to use Scratch or the other resources for new programmers to use to get started with making stuff on a computer, this setup is idea.

Clone this wiki locally