Computing stuff tied to the physical world

DIJN.06 – Boot the Raspberry Pi

In Uncategorized on Feb 10, 2013 at 00:01

Welcome to the sixth instalment of Dive Into JeeNodes. We’re halfway there!

(Note: these instructions have been updated to use the Feb 9th Raspbian image)

This part is probably the most complex piece of the journey called DIJN. Then again, you’re about to set up a self-contained server which can be used for a truly astonishing number of tasks. Linux is everywhere nowadays, and this is probably one of the easiest, lowest-cost, and most risk-free ways to tap into that world which has driven – and evolved alongside – the Open Source Software trend for so long already.

One could probably spend a decade exploring all the software that runs on Linux, and a lot of it may well be affecting your daily life (ever heard of this thing called “internet”?). The good news of course is that you don’t have to spend years, but that whatever interests you is going to be totally in reach, if and when you choose to, eh, dive in…

Let’s get rollin’, shall we?

  1. Insert the SD card you prepared according to yesterday’s post into the RPi. Note that it has to be inserted with the label facing down.
  2. Connect the Ethernet cable on both sides to hook up the RPi to your LAN.
  3. Connect the 5V power adapter to the RPi’s micro-USB port. This will power it up.

LEDs will start flashing, the world will start spinning, and a loud roar will emerge as the positron drive starts up. Oh, wait… wrong movie. Here’s what will really happen:

  • The red LED marked “PWR” will turn on.
  • The other LEDs will blink in a various patterns – after some 30s they’ll look like this:

DSC_4361

This indicates that everything has started up properly. Now it’s time to try and connect to it over Ethernet. How, depends on your platform. On Windows, you can use the putty program. On Mac and Linux, the built-in “ssh” command will be perfect.

Now is the time to shed your Fear Of The Command Line, if it’s all new to you. It’s very simple, really: the GUI we tend to use is like the body of a car, and the command-line its chassis. This DIJN series is about what goes on under the hood. That’s where the “real” stuff happens. There’s no other way – we need to look inside. We need to operate inside, in fact. Soooo… welcome to the machine, I’m sure you’ll like it. It’s fascinating in there :)

But first, we need to solve a small network puzzle: what IP address does the RPi have? There are two ways to find out: 1) have a monitor plugged into the RPi when it boots up, and the value should show up on the screen, or 2) consult the “DHCP client table” in your network router, which is usually the DHCP server for your local network. In my case, the IP address is 192.168.1.127, so that’s what I’ll use in the rest of this post.

The next step is to log into your RPi over the network, using ssh or Putty. Putty has its own GUI way of logging in, but in the Mac’s “Terminal” app or from the Linux command line, this is the way to do so (i.e. user name “pi”, IP address 192.168.1.127):

ssh pi@192.168.1.127

Here’s a transcript of what it will look like the first time around:

Screen Shot 2013-02-20 at 18.37.25

Bingo, you have logged into your RPi – welcome to the Linux command line!

You now need to go through some specific first-time RPi configuration adjustments, as hinted on that last line above. See also an earlier post for some more info (but don’t install Node.js just yet: that will be covered later on):

Screen Shot 2013-02-20 at 18.37.54

It’s a menu-based step, just type sudo raspi-config, and once finished, reboot the system (by typing the command sudo reboot). This last step is essential in this case.

Then wait a minute or two and log back in as before. You’ll again be connected to the Linux “shell”, patiently awaiting your command(s). If it’s all totally new to you, then trying out a few commands to familiarise yourself might be a good idea at this point. See this site for some tips and ideas. As long as you use the “sudo” command with caution, which gives you full “superuser” (admin) rights, there’s not much that can really go wrong. And if things ever get totally out of hand, you can always get back to this starting situation by re-formatting the SD card and starting over.

In the next step, we’ll make the RPi the central node of our Wireless Sensor Network.

Onwards!

(This series of posts is also available from the Dive Into JeeNodes page on the Café wiki.)

  1. Have you ever thought about using the Carambola board as a central communications hub?

    • Yep, I have one here – it’s MIPS, not ARM, and won’t run Node.js. For Lua it should be fine, though.

  2. So far as I know, the distros that I have downloaded for the Pi have all had Avahi (Bonjour) pre-installed, so simply ssh into pi@raspberrypi.local worked for me.

    • Doesn’t seem to be the case on this Raspbian distro, alas… would indeed be a lot simpler.

  3. Looking forward to see how you will use the R-Pi in your network. Although, for some reason, the positron drive is missing on mine…

  4. I can sympathise with those who don’t know the command-line and Linux commands. I used to manage UNIX and VMS systems some years back, but I still found it took time to get started again. I ended up adding precise NTP to my Raspberry Pis, and my experience included documenting some Linux commands for my own use during the process, and adding some SNMP for monitoring. If it’s of use to anyone:

    http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

Comments are closed.