Friday, July 31, 2015

Installing Ubuntu on Raspberry Pi 2

During this blog I'll be attempting to explain very basically what is a Raspberry Pi 2 and how to install Ubuntu on the Raspberry Pi (RPI).

What is Raspberry Pi?

The most basic understanding I can give is that a RPI is a small low powered computer that can fit in the palm of our hand. It can do many of the same things a PC or Laptop can do. Just a little slow rate of speed. You'll need to be patient with it.

The purpose of RPI was to encourage and educate people with computer science.

I don't expect for everyone reading this to be a specifications person. Understanding or seeing the specifications of RPI harware, can give you an idea of performance. So here is the break down of specs I can find on the RPI 2.

Broadcom2836 chip is a System on Chip. It mean that it has all necessary electronics on a signal microchip for running a computer. It also has an ARM processor. It is one of a family of CPUs based on the RISC (reduced instruction set computer) architecture developed by Advanced RISC Machines (ARM). Basically a chip that requires less instructions to do similar to same things a regular computer does. putting that knowledge aside how about power and speed?

Power Supply 5V 2.5A

Bare-board draw 330mA <- this is with nothing drawing energy from the RPI board. Things like a video screen connected via the GPIO connectors will use more energy through the RPI.

Max USB Draw 1.2A <- The maximum amount of energy you are allowed to use from the USB ports on the PI. It will very on usage of ports.

The ARM Processor runs at 900MHz and can run as fast as 1 GHz. Just imagine your personal computer running at 1GHz and you will understand this.

its good to know things like this. It might help knowing this information with other projects you might want to use the RPI with.

Now on to putting Ubuntu 14.04 LTS on the Raspberry PI.

RPI come with a SD memory chip. The SD chip has an image of an Operating System call NOOBS. Its made for Noobs who are new to RPI. Put this SD memory chip aside. We're not going to use this one.

I would suggest purchasing another memory SD card. in case of the RPI 2 it would be a Micro SD. Get one that is at least 32GB to give yourself plenty of head room for the Operating System.

With that new Micro SD we're going to place an image of Ubuntu on it.

An  image copy is like a picture, or mirror image. It is an exact bit by bit copy. The result of an image copy is quite different from what you get when you do a file by file data backup or file by file drive copy. Unlike a simple data backup or copy, an image backup also copies any partitions and system information. In essence it is a clone of an original copy.

You can get a copy of the image file here:
https://wiki.ubuntu.com/ARM/RaspberryPi

You are welcome to follow the directions at the website. But for most people, I think you might find it more helpful following this blog.

Uncompress the .zip file and you will find a .bmap and .img file.

I'm going to assume your are running a Windows machine and now that you have downloaded a copy of the Ubuntu Trusty image file. you are still going to need to copy that img file to your Micro SD card.

You can get a helpful and free program here. http://sourceforge.net/projects/win32diskimager/
Install W32 Diskimager and copy the .img file to the Micro SD card.

Yay! you just complete that part that is not usually explained too well. I hoped that it helped. We're only about half done. Now that the image is on the Micro SD card. Plug the Mico SD into the RPI.

After inserting the Micro SD card and booting the RPI. You should see a text prompt asking for a password. The default username and password is ubuntu typed in all lower case.

Now we start building the Ubuntu system on the Micro SD card. You will need to resize the partition on the SD card. you can do so by typing in the following command.

sudo fdisk /dev/mmcblk0

type p to see current partition table.

type d then number 2 to deleted the second partition.

type n for new partition. type p for primary partition. type 2 for partition 2.

hit the enter key to select default for first sector, and enter for default for last sector.

type w to create the partition. type sudo reboot to reboot the RPI.

After reboot and login type sudo resize2fs /dev/mmcblk0p2

type df -h to verify available space on the SD card. Number may not be exact but should be close to 28G available.

Next we need to update the package manager by typing sudo apt-get update

Now we need additional software to setup a swap file. sudo apt-get install dphys-swapfile
 then enter to continue.

restart again sudo reboot

Now we got to install the GUI interface packages
sudo apt-get install xubuntu-desktop openssh-server xserver-xorg-video-fbturbo libraspberrypi-bin libraspberrypi-dev libraspberrypi-bin-nonfree

the above command is on one single command line. it may or may not wrap on your screen.

this will download and install a lot of packages. This took my RPI about an hour to complete. go watch a movie, get yourself something to eat or drink. Be sure to look at the screen once in a while to hit enter key for default response.

That was a long wait.. now type sudo apt-get install mg to install a text editor.

type sudo mg /etc/X11/xorg.conf  <- besure the X in X11 is caps.. :)

this launches a generic text edit screen. there will be a invisible cursor at top.
you will need too add the following text to file. simply start typing.

Section "Device"
 Identifier "Raspberry Pi FBDEV"
 Driver "fbturbo"
 Option "fbdev" "/dev/fb0"
 Option "SwapbuffersWait" "true"
EndSection

hit Control-X on keyboard the s to save the file. C to close the file.

type sudo reboot to reboot machine.

** IMPORTANT** If you do not see yellow screen here. go back and check the file you just edited. sudo mg /etc/X11/xorg.conf

you should see the gui interface and password is still the default password. ( ubuntu )

Congratulations! You have just installed a working copy of Ubuntu 14.04 LTS on a Raspberry PI 2.

Your system may want to complete some more updates. I would say run the system over night. After that you can continue on to other projects you were planning with your Linux Pi machine.

Most of you who visit the blog will know I'm a ham radio operator. I'm using my pi to run a program for Ham Radio contacts.



I'm still working on this project. This Raspberry Pi was a big part of it. It will allow for me to run digital communications, and keep a log, while out in the field. Not only was this a little bit of a challenge for me. It will also be much lighter and more efficient than using a laptop out in the field.

As I reach certain phases in my field project, I'll blog about them at KD6VZQ.com

Tuesday, July 28, 2015

My Ham Noob-ness

Hello Noobs!

 I was a noob once myself. Excited to get my ham license and have a radio to play with. I actually got my first radio before I got my license. I used the new radio as a bit of encouragement to pass my Technician test.

 This was back in the early 1990's shortly after they dropped the CW requirement to pass the test. I don't do well with things like CW, they take me more time to learn than most people. But there are a lot of other things I catch on pretty quick.

  We didn't have cheap radios like Wouxon or Boafang back in the day. Handy Talkies were a bit more pricey back then too. My first radio was a Yaesu FT-530. It was pretty tricked out and had a lot of functions. It gave me the opportunity to do hands on learning on the very things I just passed my Technicians test on. I was limited to 2M and 70cm with the radio, but that was plenty.

  I got started with 2M. I didn't know much about how to setup repeater setting in the radio. I managed to reach a local ham on an output of a repeater. He suggested a few things I look for on my radio. Allowing for me to use the repeater system properly. I finally got to learn hands on that a repeater receives on one frequency (input) and transmits on another (output). Determining where repeaters are within the 2M frequency range. It can be a plus (+) or minus (-) offset. 2M has a 6KHz offset. So you would transmit either up or down 6KHz from the output of the repeater.

  There are a lot of repeaters around my area. Sometimes they are on the same frequencies. Which can cause conflict between the repeaters and the people using them. Conflicts are control by using a sub-carrier in the radio signal to bring up the repeater. This is called PL-Tone. A repeater will not respond to you or another source of transmission without the proper PL Tone settings in your radio.

  With that knowledge. Most radios you start by selecting the output of the repeater, then setting an offset, then setting a PL-Tone. Only thing left it to try and see if your radio gets a response from a repeater. You can move forward with other stuff from there. Get yourself radio active on the repeater systems. Talk with local hams. You'd be surprise just how much help you get and how much you can learn by talking with other Hams. Some of them have even just got their license.

  As you saw, I had mentioned Wouxon and Boafeng above. I feel that this has started a trend of un-informed hams when it comes to repeater use. Here is why. These radios are CHEAP and a lot new hams are buying them. They are also difficult to program by hand, and are much easier to program with a computer. The hands on approach is being bypassed via lacking programmable ability of both. I see many new buying the Wouxons and Boafengs, having their techie friends program the radios for their local area. From year 2010 - 2015 most of the million new hams have done this. Not really learning much about Ham frequencies or repeaters. They are simply just un-informed and need more hands on.

Year Ending
Month
Extra Advanced General Tech Novice Total
2015 Jun 138,199 49,399 171,605 359,032 11,448 729,683
2014 Dec 136,405 51,069 169,524 357,236 12,041 726,275
2013 Dec 133,391 54,293 167,257 349,163 13,097 717,201
2012 Dec 130,736 56,314 163,370 345,369 13,786 709,575
2011 Dec 126,431 57,875 160,554 342,583 14,613 702,056
2010 Dec 122,951 59,387 155,781 342,191 15,731 696,041


  I might be batting flies here. I would like to suggest that my experienced ham friends help the noobs by not programming Wouxon type radios. Instead suggest to get a radio, though a bit more pricey, that allows for easy hands on programming of local repeater systems. Programming a radio without a computer interface.

  If they are not wanting to pay full price for a nicer radio. Suggest looking at Ham Radio Classifieds on the net. Hams in general take good care of their equipment. Also may people who think they are going to be active with have radio often buy the more pricey ones. Then they decide ham radio is not for them and sell their radios in the classifieds. I have found many great radios on craigslist.com and qrz.com classifieds for much cheaper than bought new. Almost all of them in like-new condition.