Quantcast
Channel: Firedancer Unleashed!
Viewing all articles
Browse latest Browse all 84

Getting Started with Raspberry Pi

$
0
0
A couple of months back, I wasn't sure what hit me but I got myself a Raspberry Pi 2. It was also quite silly because my Pi 2 came two days after the released of Raspberry Pi 3 *ARGHS!* Anyway, I had started playing with it since then and now I would like to share some of my experiences with other Software Engineers who maybe interested to get started with the Raspberry Pi.

Short introduction - A Raspberry Pi is a low cost, low-power, credit card-sized computer that is developed by the Raspberry Pi Foundation in the U.K., a non-profit organization with the noble goal of advancing computer science knowledge in adults and children. It is supported by the University of Cambridge Computer Library and Broadcomm.

So what can a Software Engineer do with a Pi? Well, short-off trying to use it like a small computer, you can use it for various home automation projects, learn low-level programming, create little irritating autonomous robots (no vacuum cleaners though) and best of all, use it to delve into the world of Internet of Things (IoT). IoT is a big buzzword nowadays (together with Data Science) and it is set to boom in the upcoming years so it might be a good idea to equip yourself with some skills now. *HeHe*

By now if you have googled for Raspberry Pi, you will see that it resembles a small mobo with familiar HDMI and USB ports, and being a Software Engineer, you would probably think it is no sweat! Here are some things I feel that you should know:

Don't Waste It As A Cheap PC

Many people I knew thought to use the Raspberry Pi as cheap substitute for a PC. My advice is, if you can afford a PC, please forget about thinking to use the Raspberry Pi as a PC because at its processing power today, you will be frustrated (unless you don't mind the slowness). Some people also told me they want to use it to learn another operating system - fine, but if you wanna learn linux (yup, the official OS is a Linux variant), why not just virtualize a full-fledged environment to learn? (Ok, maybe it is the smaller size that makes it less scary).

Knowledge of Electronics

The awesome thing about the Raspberry Pi is not really that it is a small PC but it is the row of pins you see on the board - the 40 GPIO pins. GPIO stands for General Purpose Input-Output and those pins are the key to the world of physical computing (and awesomeness). The GPIO pins will allow you to light up LEDs, read data from sensors, power up motors and servos and do all kinds of tok-kong stuff (interesting things).

To make use of the GPIO pins, you will need some basic electronics knowledge which can be somewhat a challenge to some Software Engineers, particularly - Googlepers.

Know Your Stuff 

It is very common for Software Engineers to just google for code to get things done. What happens when you found bad code? - Just delete it and start over with zero risks. Your computer ain't gonna explode just because you googled an endless loop. Now things are a bit different when it comes to electronics - you need to know your stuff well.

I spend a lot of time reading and re-reading before I even poke my first pin to the Pi. The reason for all these paranoia is because when you wire-up things wrongly, you will "fry your Pi" (and yes, it rhymes). You will also need to be careful when you google for stuff because there are times, the information you get could be different (i.e. different pins for your version of sensors) and you could just see smoke coming out from your precious Pi.

Running Windows 10 IoT

As I mentioned earlier, the official supported OS for the Raspberry Pi is Raspbian, a debian-based linux and you will be using Python to program it. But what about Windows? Yes, you can install Windows 10 IoT on it (in fact, I got to know about Raspberry Pi after Microsoft made a big hoo-hah about it). However, the Windows 10 that you are going to get on the Raspberry Pi ain't gonna be the Windows that you are familiar with (and NO it is not just a command prompt like Windows Server Core - it is something more different).

But if you are curious to try it out (because Visual Studio is the most awesome IDE on the planet and you love C#), head over to the Windows 10 IoT site to get the image or you can wait for me to talk about it later.

Buy the Pi

Now that I have pre-empt you and you are still interested, the first thing to do is to get a Raspberry Pi 3 and all its required accessories i.e. Power Adapter, HDMI to VGA adapter etc.. You can get them from:


If you are worried about not having the right components to get started, I would recommend that you get a Starter Kit. I got myself a Raspberry Pi 2 Ultimate Starter Kit from Canakit via Amazon.com. You can also checkout AdafruitSparkfun and Sunfounder. By now you must be thinking - Why everything overseas wan, got any local sites or not? Ok, for local sites you can try Ubitap (recommended), Cytron or MyDuino.

Ok, I know that face, that's the - Walaueh! Why so expensive wan? look. Well, if you want to save up some $, you can be daring a-bit and go try out eBay or AliExpress. But don't say I never warned you, you probably get your stuff after weeks or months or maybe .... never.

So what's next after you got your Pi. You will need a micro-SD CARD. The specs say you should be getting something Class 10 (or if there is something higher) with at least 8GB. Now, Class 10 micro-SD cards also have multiple variants. If you can spend some $, try to get some high-end Samsung cards like the EVO+ or even better, the PRO series if you have deep pockets.

The Pi doesn't have a hard-disk like a PC, so you load the OS and store stuff on the micro-SD card (and that's why you need to have a fast card). If you beh-song and don't want to use a micro-SD card, you can checkout Western Digital's PiDrive.

Installation

To install your OS, first you need to download the OS image (or images). The best way to do it is from NOOBS (New Out-Of-Box Software). Recall earlier I mentioned about Windows 10 IoT? If you try to install from NOOBS, you can actually select multiple OSes to dual, triple, quardro boot and Windows 10 IoT will be one of the option. For me, I will go with Raspbian.

Just extract the downloaded .zip file and copy the files over to your micro-SD Card. Put the card into your new Pi and power it up. Follow the simple installation steps, make some coffee and then everything should be done.

Go here if you need more detail instructions.

Installation Caveats

Now, some of you may be a bit kiasu (like me) and go buy a big micro-SD Card i.e. 64GB. You will then noticed that the Pi will not recognize the card. The reason is because the larger cards are usually formatted in exFAT. Follow the instructions here to format your card to FAT32.

Post-Installation Tips

Usually most people will tell you that you are now ready to go and say bye-bye, but I would like to give you a few more post installation tips. All the following should be done on your Raspbian OS.

Tip #1 Get Up-to-date

Make sure you are connected to the Internet. Open up a Terminal and enter:

sudo apt-get update

then

sudo apt-get upgrade

You will see that almost everywhere, people will ask you to do that all the time. As to why they didn't script that on OS boot-up, I don't really know. These are something like your Windows Update but in command line style.

Tip #2 Change the Keyboard Layout

Before you start to think your keyboard is spoilt, you should go and change the keyboard layout to US. By default, I think it is default to U.K. How to do it? Own self go find in the settings la. Take this chance to explore the OS a bit.

Tip #3 Install Remote Desktop

I find it more convenient (and productive) to remote in to the Pi to do work. To enable remote desktop, open up a Terminal and enter:

sudo apt-get install xrdp

After you have installed that, you will be able to Remote in to the Pi using Remote Desktop Connection or (mstsc.exe) from your Windows machine.

Tip #4 Share Files

After a while, you may have written sibeh a lot of python programs or have some stuff you have to backup to your PC. You may also want to copy things from your PC to the Pi. In order to do this, install samba.

The installation is a bit lengthy, you can visit here for full instructions.

Tip #5 Date Time Format

Not sure if it bugs you, but when I look at the date time at the taskbar, I feel sibeh boh-song. I changed the format to

%a %x %I:%M %p

which will display something like Wed 7/6/2016 6:20 pm.

Where to change it? Again, you own self go find in the settings la.

Conclusion

I hope you have find it informative (and entertaining) so far and I hope you can do something awesome with the Raspberry Pi (since nowadays, even 8 year old kids are starting to play with it). Now, if you somehow bought the Pi, took pictures of it and put on facebook to fish likes and then felt that it is too difficult to work on, you can always convert it into a Media Centre - How to do it? You own self google la. ;)

Viewing all articles
Browse latest Browse all 84

Trending Articles