Wednesday, October 22, 2014

Raspberry Pi B+ boot up and connect to laptop

Just received B+ and could not wait to power it up!

1. Put into the case

I also ordered a Vilros clear case for the B+ model from Amazon. I thought this should be a fairly easy process, but it turned out to take more than 25 min! I think the case is simply too tight, at least for the case and Pi I received. I tried various ways and realized that unless I pressed it really hard, it just would not fit. But I was afraid to break my Pi!

After trying some more time I was able to click the Pi into the case. What I did was to seat the HDMI side on the bottom case, and press really hard on the GPIO side, all the way down through the two slide-shaped bumps. Of course I could not press on the GPIO pins, so I had to press a little below the pins. It was uncomfortable, and excessive force had to be used. And I guess there is no way I can get the Pi out of the case in future unless I break the case.


2. Boot up

I ordered a micro SD card Kingston Digital 16 GB Class 4 microSDHC Flash Card with SD Adapter (SDC4/16GBET). I followed the procedure on this link to install the Raspbian Wheezy 2014-09-09 on the SD card using a Ubuntu laptop. After that, if I inserted the micro SD card into the laptop, it showed two devices, one "boot" with files such as bootcode.bin, cmdline.txt, *.elf, etc., and the other "3 GB Volume" which should be expandable using the Pi.

The micro SD card was then inserted to the Pi. Even if it "clicked", I could still pull it out. It seems there is nothing really locking it into the slot. But it does make good contact.

Then I connected the Pi to USB mouse, USB keyboard, Edimax nano-size USB WiFi adapter, and a DVI monitor using a HDMI-DVI cable. It booted up!

The setting up of WiFi was super easy in the desktop. I tested IDLE, Pi Store, Mathematica, Wolfram Language, web browser, installing vim, etc. It was very smooth.

I enabled ssh during the booting up. Then I could try the "headless" way, removing the connections of keyboard, mouse, and the monitor!

3. Connect to laptop

After enabling ssh on the Pi, I wrote down the IP address of the Pi, something like 192.168.0.???. I bundled the MAC and IP in the router so that I will always use the same IP address to access the Pi.

I removed the keyboard, mouse, and monitor from the Pi. In my Ubuntu laptop, I opened Xterm and typed:
sudo ssh -X pi@192.168.0.15
Then entered the password, and the connection was made. In the above, the "-X" is for allowing x windows.

To start the desktop, type
lxsession &

The Pi's window would then merge into the Ubuntu's desktop. All the software worked fine on the merged desktop, except that I found I could not get Scratch to open in this headless way.

To terminate the lxsession, type the following in the terminal running ssh:
lxsession-logout