Jump to content
Ryan_Vickers

[Guide] Getting started with Raspberry Pi 3

Recommended Posts

Posted (edited) · Original PosterOP

I'm still new to this myself so this will not be covering anything too advanced, nor will it be complete at the time of writing (I'll be adding more over time), but hopefully it will give anyone interested a leg up so they don't need to spend quite as long as I did getting to what I would consider a basic level of functionality.

 

 

Choosing your OS

There are many OSes available for the Raspberry Pi - some "general" and some "specialized".  If you are looking to made a dedicated emulation machine or Kodi machine, look into one of the specialized ones designed for this.  They will act like a Steam machine in that they just do that thing and don't give you a normal desktop environment.  I was looking for a general desktop experience, however, and tried the following:

 

Raspbian

https://www.raspberrypi.org/downloads/raspbian/

This is the OS it ships with, assuming it ships with one at all.  It is based on Debian and so anyone familiar with Debian-based Linux (like Ubuntu for example) won't feel too out of their element, despite this being an ARM device, and everything that this implies.  In my experience, it is the quickest, best optimized experience that is both simple, yet fully capable.

 

Ubuntu MATE

https://ubuntu-mate.org/raspberry-pi/

Note for users of MicroSD cards 8 GB or less!  The image is slightly more than 8 GB, so despite them saying this will install directly to an 8 GB card, it will most likely not.  I tried 3 and none of them were large enough.  I would suggest writing the image to a sufficiently large device of any kind (USB flash drive, other SD card, etc.) and then using a tool like gparted to shrink, and then copy the partitions it lays down on to the microSD card you intend to use.  If you do this, it will fit on an 8 GB card since the actual amount of used space is only about 4 GB.

 

Being that this is Ubuntu, it was even more familiar to me (someone who used Ubuntu for many years and knows it well).  While still quite usable, it felt sluggish and bloated compared to Raspbian and ultimately provided no extra functionality.  In fact, certain things (like in-browser YouTube playback) were noticeably poorer.

 

Android

Yes, the same Android you might have on a phone.  I thought that since Android was built from the ground up in a now well-established ARM ecosystem it would perhaps run the best and offer the best harnessing of the hardware.  Not so much... I didn't even get around to testing video playback and other performance metrics since just navigating the menus and launchers was laggy.  Don't use this, it won't do what you want xD

 

 

Installing the OS

To install your OS of choice, there are two options.

 

NOOBS

https://www.raspberrypi.org/downloads/noobs/

As the name suggests this is ideal for inexperienced users and as such is very very easy to use.  I've never seen anything quite this easy.  Anytime I've had to make a bootable "thing" it's required a special tool, or at least a procedure of some description.  Not the case here.  Just download the zip, extract it and dump the files on a microSD card, put the card in your PI and turn it on.  That's it.  The rest will be obvious once you see what's on screen.  Simply check the OS(es) you want from a list and it will automatically download, partition, and install them!  You might be thinking "wait, the partition it's running on takes up the whole card... how will that work?"  Don't question it, just trust in the NOOBS :D 

 

While easy, this method does have a downside.  ~1.2 GB of your card gets dedicated for a recovery partition, leaving the rest free for your OS.  If you're using a 8 GB card, this is a considerable amount of space and I would suggest the next method.

 

Not NOOBS

https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Even the manual method is fairly straightforward, especially since the instructions are all very clear.  Once you have downloaded an image (.img) (note, you will likely have to extract it from the compressed file you downloaded, be that a zip or some other kind) simply write it to your SD card using Win32DiskImager if you're on Windows or GNOME Disk Utility if you're on Linux (the terminal instructions for Linux on the page above are insane, just grab this tool and it's easy), pop it in your PI and boot!  Using this method will allow the entire card to be used for your OS, which helps when you're short on space to begin with.

 

 

Configuring your OS

At this point I'm going to assume you're using Raspbian like I suggested.

 

First, I would connect to wifi (if necessary) using the icon in the corner (same as any OS these days).  It appears the Pi does not support 5 GHz, fyi.

 

Next, you might want to go into the Menu > Preferences > Raspberry Pi Configuration > Localisation and set each of the things to your region since it seems to default to England for everything.

 

Next, I'd open a terminal and run the following commands to get up to date, and be ready to wait - there will probably be a lot of them.

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade

 

I would also suggest installing samba (sudo apt-get install samba) before trying to access any Windows shared folders or you might be greeted by an endless loop of asking you for a password only to be asked again even though you entered it correctly.

 

Finally, take note of the volume control.  If you right click, you can select your output device.  If you connect additional devices (through bluetooth for example) they will show up and become detectable here.  It's all very nicely done in my opinion.

 

OMXPlayer

Now, at this point you might want to listen/watch something, and here's the tricky bit.  I have tested the Pi's video playback ability and it effortlessly played a 1080p 60 fps ~10 Mbit H.264 file.  It is very particular about how you do this, however.  Your temptation might be to install VLC or another familiar program... don't!  It will not work, trust me.  The Pi doesn't seem to handle playing back things in a manner we are all familiar with (opening an app, having the media contained to that app, with onscreen controls, etc.).  Instead, it comes bundled with a player called omxplayer that you can launch from the command line.  This is what allows it to play most common formats (I tested the video I mentioned as well as MP3s).  In the case of playing video, it seems to output at a very low level, since the video appears over top of everything else, and even keeps playing if you use Control + Alt + F1 to switch to a terminal session.  You will need to use keyboard shortcuts to control it.  You can look these up easily I'm sure but the important ones are:

  • q to exit playback
  • space to play/pause
  • left/right arrows for 30s skip
  • up/down arrows for larger skip

This player can be used for music as well and the same shortcuts apply.

 

Open With OMXPlayer

Ok, that's all fine and good, but I'm not planning to call up a terminal every time I want to play a file!  Well, don't worry, you don't have to... or at least, not manually.  Select a media file you're interested in and go into Properties > Open With > Customize > Custom Command Line.  For the command to execute, enter omxplayer -o alsa %f and check off "Execute in terminal Emulator" (don't forget this or it will be uncontrollable in my experience!).  You can then give this a name, like "omxplayer" for example.  This is the name that will show up when you go "open with".  If you mess this up and want to delete or edit the thing you created, go to your home folder /home/pi/.local/share/applications and play with the text files in there.  Now you should be able to just double click any media file (or at least the ones you've setup like this) and it will launch right away just as it would on a "normal" OS! :D  To control it, you will have to click the terminal and use the keyboard shortcuts I listed above.  If you ever get trapped, you can always just Control + Alt + F1 and killall omxplayer, then Control + Alt + F7 to get back to where you were.

 

For those who are curious, the "-o alsa" in the command tells it to obey the output device selection you've made using the volume control in the system tray.  Without this, it will play using HDMI regardless.

 

Other Considerations

  • Watching YouTube videos, the experience is surprisingly decent.  Videos played smoothly and properly up to 720p (not 60 fps), while 1080p only played smoothly in-between half-second freezes, (so not really watchable).
  • You might be thinking "wait this only has 1 GB of RAM, and the default browser is Chrome!?"  Fear not, it works just fine.  With 6 tabs open I only use about 1/3 of the RAM, so you should have plenty of room for anything you would conceivably do on such a low performance device.
  • I have a HUION 1060 PLUS drawing tablet and it works, "plug & play", out of the box with no drivers!  Well, it would appear the buttons on the tablet do nothing and the pressure sensitivity for the pen is not active [*1], but it controls the cursor perfectly, and taps send a click signal, while the two pen buttons send the right and middle click, as expected.  There is no obvious jitter or un-smoothness in the lines drawn.
  • While there is no official version of Spotify compatible with the Raspberry Pi (yet... they're working on a Linux one and perhaps it will work on ARM eventually) you can use Spotify!  I looked into a program called Mopidy, which is a command-line service that runs in the background.  You can then "plugin" any number of different GUIs to it and control it that way.  Note that this will not make your Pi show up to other Spotify players on the LAN as an "available device" the way running the actual client would, but it can still function as a standalone player if that's all you need.
  • I attempted to play Amazon Prime video, and it refused, citing a missing DRM plugin for the browser (Chromium).  Perhaps adding another browser and this plugin would allow it to play, but I will have to save trying that for another day, especially since my hopes are not high after seeing how it plays 1080p YouTube.  Maybe I'll be pleasantly surprised though...
  • I have not tried Netflix but I intend to, and expect it to behave the same as Amazon Prime video.
  • I have a Blue Yeti microphone and it works perfectly, again, plug & play.  Audacity is also available for the Pi, and everything I tested (recording and playback) works perfectly.  Parts of the interface are a little messed up (the drop down to select input and output devices is an icon-less, label-less box only a few pixels large) but it all functions.
  • This is the perfect travel computer!  You'll probably have a phone with you, but phones can only do so much, even when augmented with OTG adapters.  Sometimes you just can't beat the ability of a desktop that can easily handle transferring files between multiple external devices, editing images in a real image editor like GIMP, etc.  If you're someone who backs up all their photos from the camera's SD card(s) to a flash drive [*2] at the end of the day, this is ideal for you.  You're probably thinking "well, my laptop can do all that... why should I bring this?".  A laptop is portable, but not quite this portable.  You'd look a little strange carrying a laptop with you into a restaurant, movie theatre, or just generally walking down the street.  The Pi is small enough you could conceivably keep it in your pocket and it would stick out no more than a thick wallet.  But it gets better!  Laptops are expensive and tend to have a lot of personal information on them.  The Pi lets you avoid both these issues.  When you go out for the day, pull out the microSD card and take it with you.  All your personal data is safe with you, and the bare hardware you leave behind is worth less than $50 - not the end of the world if it gets stolen.  So go!  Buy one now!  Take it with you for your next trip and you won't be disappointed! :D 

 

[1*] It is possible it actually works and I just didn't notice it.  I tried in GIMP and it didn't work, but then, I've since tried GIMP in "normal" Linux and was unable to make it work there too, despite the fact that it worked perfectly in other programs (Krita)

[*2] It works with flash drives but don't expect it to power an external 2.5" HDD... that's a bit beyond the power supply's abilities (or, at least beyond the abilities of mine).

Edited by Ryan_Vickers
Fixed typos and other minor things
Link to post
Share on other sites

https://www.tech-knowhow.com/2017/01/raspberry-pi-disk-images-definitive-list/

 

Arch Linux ARM is my default choice so I made a script to auto install onto an SD card.

 

#!/bin/bash
#set -x
ARCH=$(mktemp -dt XXX)
URL="https://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz"

trap cleanup SIGHUP SIGINT SIGTERM TERM
cleanup(){
	umount -Rv "$ARCH"/*
	rm -rf "$ARCH"
	exit 0
}

if [[ "$1" == "-h" || "$1" == "--help" ]]; then
	echo -e "\x1B[01;31m$ $0 /dev/sdb\x1B[0m"
	exit 1
fi

if [[ -z "$(which bsdtar)" || -z "$(which parted)" || -z "$(which mkfs.vfat)" || -z "$(which wget)" ]]; then
	echo -e "\x1B[01;31mInstall bsdtar, parted, dosfstools and wget.\x1B[0m"
	exit 1
fi

if [[ -n "$1" ]]; then
	DEVICE="$1"
else
	lsblk -f
	echo -en "\x1B[01;31mDevice to format: \x1B[0m"
	read -r DEVICE
fi

if [[ "$DEVICE" =~ "/dev/sda" ]]; then
	cat <<-EOF
		WARNING
		========
		This will overwrite data on  irrevocably.
		
		Are you sure? (Type uppercase yes):
	EOF
	read -r DELETE
	if [[ "$DELETE" != "YES" ]]; then
		exit 1
	fi
fi

if [[ -z "$1" ]]; then
	echo -e "1 - Raspberry Pi ARMv6\n2 - Raspberry Pi ARMv7"
	read -r OPTION
	case "$OPTION" in
		1)
			URL="https://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz"
			;;
		2)
			URL="https://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz"
			;;
		*)
			echo "Invalid option"
			exit 1
			;;
	esac
fi

MOUNTED="$(findmnt -n "$DEVICE" | awk '{print $1}')"
if [[ -n "$MOUNTED" ]]; then
	umount -Rv "$MOUNTED"
fi

wipefs -af "$DEVICE"
parted "$DEVICE" -s -- mklabel msdos
parted "$DEVICE" -s -- mkpart primary fat32 1 25
parted "$DEVICE" -s -- mkpart primary ext4 25 100%
partx -uv "$DEVICE"
mkfs.vfat -v "$DEVICE"1
mkfs.ext4 -F "$DEVICE"2
mkdir -v "$ARCH"/{boot,root}
mount -v "$DEVICE"1 "$ARCH"/boot
mount -v "$DEVICE"2 "$ARCH"/root
lsblk -f
wget "$URL" -P "$ARCH"
tar -xpf "$ARCH"/"$(awk -F "/" '{print $5}' <<< $URL)" -C "$ARCH"/root
mv "$ARCH"/root/boot/* "$ARCH"/boot
sync
cleanup
eject "$DEVICE"

 

Link to post
Share on other sites
Posted · Original PosterOP
1 minute ago, Name Taken said:

https://www.tech-knowhow.com/2017/01/raspberry-pi-disk-images-definitive-list/

 

Arch Linux ARM is my default choice so I made a script to auto install onto an SD card.

Cool :D 

Link to post
Share on other sites
Posted · Original PosterOP
28 minutes ago, Linksys120n said:

I find the raspi 3 to still be too slow for my liking I own all 3 but my pi 1 A is broken I can't get it to boot anymore... But I simply cannot find a use for the pi 3. tell you what PM me and I'll mail it to you if you pay shipping.

Well I do like mine but I don't think I could make use of 2, so I'll have to pass on that.  Thanks though :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.


×