Thursday, December 5, 2013

Grub Rescue Error

Run a live Ubuntu CD or USB, then open Terminal , you need to install boot-repair, it just simple tool to install GRUB boot , and scanning for other OS exiting on your HDD.
  1. Connect to Internet.
  2. Open Terminal
  3. then type sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
  4. then sudo apt-get install -y boot-repair && (boot-repair &)
  5. Launch Boot Repair from Terminal : boot-repair
  6. Press Recommended Repair.

Sunday, October 13, 2013

How to use webcam with BeagleBoard-xM

You should have installed Ubuntu 12.04 on your BeagleBoard-xM to use make these things work.

Install SSH (to allow remote access and a host of other useful linux networking featuressuch as scp)
● sudo apt-get install ssh
(this may take a while)
Install man and info so you can read man pages
● sudo apt-get install man info
Install camera utilities
● sudo apt-get install libwebcam0
(note, as time proceeds, the package name may change. make sure to take a look at
sudo apt-cache search libwebcam to make sure you're getting the latest version.
● sudo apt-get install uvcdynctrl
● sudo apt-get install streamer
Finally, plug in the web cam and query the system to check whether it is present and
detected
● ls /dev/ | grep video (you should see /dev/video0)

Configuring the operating system environment
It is convenient to set up a couple scripts for commonly used commands. This mainly applies to the minimal beagleboard-xM image that was used in this set of documents.

cd ~ (change to home directory)
mkdir scripts;cd script (create scripts directory and cd)

Use an editor (such as nano to create the text files. Use chmod goa+x filename)

Ethernet
Ethernet needs to be set up each time. This can be added to ~/.bash_profile instead to have it run every time.
sudo dhclient eth0

Ramdisk
Sets up a ramdisk of 64M and mounts it at /tmp/ramdisk
sudo mkdir /tmp/ramdisk
sudo chmod 777 /tmp/ramdisk
sudo mount -t tmpfs -o size=64M tmpfs /tmp/ramdisk

USB Camera Linux Command-line
Webcams are handled by a linux library/api called video4linux, v4l for short. Devices which conform to this standard are called “video4linux” devices. When plugged in, if video4linux detects a compatible device, it will mount the webcam under /dev/video0 if it is the first video device, /dev/video1 if it is the second video device, etc.

streamerstreamer records images and video from the webcam.
A sample command to grab one frame and save a jpeg:
streamer -c/dev/video1 -s 1920×1080 -j 100 -o /tmp/ramdisk/picture.jpeg
● -c[video4linux device]: a path to the device. video1 is the second webcam installed in
the system.
● -s [size]: resolution to capture
● -j [quality: 1-100]: specifies the quality of the jpeg. 100 is very little compression
● -o [filename.jpeg]: important to name the file with extension .jpeg, the streamer
program decides output format based on this.
 
uvcdynctrl
uvcdynctrl is a command-line interface to adjust the parameters of the webcam.
● uvcdynctrl -c lists available controls for a device. eg., uvcdynctrl /dev/video1 -c
● uvcdynctrl -g [control] gets the value of a control
● uvcdynctrl -s [control] [value] sets the value of a control eg., uvcdynctrl /dev/
video1 -s Contrast 64
Default values will be restored upon reboot.

You can install OpenCV to make applications related to image processing and video processing after this.

Thursday, October 3, 2013

Installing Ubuntu 12.04 on Beagleboard-xM

Installing Ubuntu 12.10 on the BeagleBoard-xM.
 1) To get the lastest version of the ubuntu version for beagleboard, visit this site

http://rcn-ee.net/deb/rootfs
Or if you want to install the quantal , then get the souce from this link

wget http://rcn-ee.net/deb/rootfs/quantal/ubuntu-12.10-console-armhf-2013-06-14.tar.xz

2)Unzip the files

tar xjf ubuntu-12.10-console-armhf-2013-06-14.tar.xz

3) Then change directory to ubuntu-12.10-console-armhf-2013-06-14 to make sure extraction is done and search for the setup_sdcard.sh script which will setup the SD card for you.

4) But prior to that we have to check the location of the SD card,
Use this command to do so

df -h or fdisk


Gernerally it will be available at /dev/sdb1, in this case please use the full drive name as /dev/sdb

5) Now run the setup_sdcard.sh script.

sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot beagle_xm

It takes around 10 mins to setup the sd card.

6)Now remember all the Gods you know and insert the SD card into the beagleboard-xM,
Connect serial port with pc using minicom and monitor display with board using HDMI cable.
Restart the board.

Note: Default login name : ubuntu
Default password : temppwd

7) Now update and upgrade the packages

sudo apt-get update
sudo apt-get upgrade


8) Now to install GUI for the Desktop

sudo apt-get install gdm xfce4 network-manager

Note: It will take around 2-4 hours, so have a power nap or go around with your someone special .....!!!!!!)

Now you have to run script present at
/boot/uboot/tools/ubuntu/ named as small_lxde_deskstop.sh
/bin/bash /boot/uboot/tools/ubuntu/small_lxde_desktop.sh

Note: It will take around 45 mins...!!!

10) Now GUI will be setup and login with the default password..

Have Fun !!!!!

NFS Booting for BeagleBoard-xM

1) Linux Kernel Compilation

Get the linux kernel from the tisdk folder :

/<FILE_PATH>/ti-sdk-beagleboard/board-support/linux-3.3.7-r115

a) Kernel Configuration

Cross compile the kernel with the default configuration or the customized configuration but be sure that the while customization kernel consist of all points mention in 1.b is selected.

make CROSS_COMPILE=arm-arago-linux-gnueabi-ARCH=arm
tisdk_beagleboard_defconfig


or

make CROSS_COMPILE=arm-arago-linux-gnueabi-ARCH=arm menuconfig

b) Make sure that the following point are selected ([*] in front of it):

Networking support

[*] TCP/IP networking
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support

Device Drivers

[*] Network device support

USB Network Adapters

[*] SMSC LAN95XX based USB 2.0 10/100 ethernet devices
[*] USB support
[*] EHCI HCD (USB 2.0) support

File systems

[*] Network File Systems

NFS client support

[*] NFS client support for NFS version 3
[*] Root file system on NFS

c) uImage Creation

make CROSS_COMPILE=arm-arago-linux-gnueabi- ARCH=arm -j4 all
make CROSS_COMPILE=arm-arago-linux-gnueabi- uImage


d) SD card preparation

i) Format the sd card and make two partition as boot and other as root
ii) Copy the newly generated uImage , MLO, u-boot.bin, u-boot.img to the boot
partition

note: MLO, u-boot.bin, u-boot.img are present at this path
/<FILE_PATH>/ti-sdk-beagleboard/board-support/u-boot-2012.04.01
and uImage is present at this path /<FILE_PATH>/ti-sdk-
beagleboard/board-support/linux-3.3.7-r115/arch/arm/boot


2) File System Generation

a) Get filesystem from /<file_path>/ti-sdk-beagleboard/filesystem/tisdk-rootfs-beagleboard.tar.gz

b) Create a folder, and extract the file system as root user (don't use sudo)

3) NFS Server Configuration

a) Setting the NFS Server

install the nfs server
sudo apt-get install nfs-common nfs-kernel-server

b) Setup the export file

edit exports file present at “/etc/exports”
note: open file as root user
write this line in the export file
/<file_system_path> *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
note: * indicates all ip address are allowed to connect, to allow a specific ip address replace * by the ip address

c) Restart the NFS server service

sudo /etc/init.d/nfs-kernel-server restart

note: after restart NFS kernel daemon should start sucessfully, which is observe by checking “OK” statement on the terminal, or else set the proper export path

4) UBoot

a) Connect the board with power supply, ethernet cable, and the serial port.

b) Configure the serial port using minicom

sudo minicom -s

c) Selecting the tty device and saving the configuration

d) Insert the sd card.

e) Power on the board.

f) Before auto boot sequence hit enter button and enter the boot arguments.

i) setenv bootargs 'console=ttyO2,115200n8 noinitrd ip=dhcp rw root=/dev/nfs
nfsroot=<HOST_IP_ADDRESS>:<EXTRACTED_FILE_SYSTEM_PATH>
nolock rsize=4096 wrsize=4096'

ii) fatload mmc 0:1 0x80200000 uImage
iii)bootm 0x80200000

g) Now board will start booting

Note:
i) If at DHCP request is taking long time, check the internet connection
ii) If certain case kernel panic error message is displayed after the “root=” then
check the permissions given to the file system folder or corrects the export path
in exports file.

Wednesday, October 2, 2013

How to add swap on Ubuntu 12.04

Linux RAM is composed of chunks of memory called pages. To free up pages of RAM, a “linux swap” can occur and a page of memory is copied from the RAM to preconfigured space on the hard disk. Linux swaps allow a system to harness more memory than was originally physically available.

However, swapping does have disadvantages. Because hard disks have a much slower memory than RAM, virtual private server performance may slow down considerably. Additionally, swap thrashing can begin to take place if the system gets swamped from too many files being swapped in and out.

Check for Swap Space


Before we proceed to set up a swap file, we need to check if any swap files have been enabled on the VPS by looking at the summary of swap usage.
sudo swapon -s

An empty list will confirm that you have no swap files enabled:
Filename    Type  Size Used Priority

Check the File System


After we know that we do not have a swap file enabled on the virtual server, we can check how much space we have on the server with the df command. The swap file will take 512MB— since we are only using up about 8% of the /dev/sda, we can proceed.
df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda        20907056 1437188  18421292   8% /
udev              121588       4    121584   1% /dev
tmpfs              49752     208     49544   1% /run
none                5120       0      5120   0% /run/lock
none              124372       0    124372   0% /run/shm

Create and Enable the Swap File


Now it’s time to create the swap file itself using the dd command :
sudo dd if=/dev/zero of=/swapfile bs=1024 count=512k

“of=/swapfile” designates the file’s name. In this case the name is swapfile.

Subsequently we are going to prepare the swap file by creating a linux swap area:
sudo mkswap /swapfile

The results display:
Setting up swapspace version 1, size = 262140 KiB
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb

Finish up by activating the swap file:
sudo swapon /swapfile

You will then be able to see the new swap file when you view the swap summary.
swapon -s
Filename    Type  Size Used Priority
/swapfile                               file  262140 0 -1

This file will last on the virtual private server until the machine reboots. You can ensure that the swap is permanent by adding it to the fstab file.

Open up the file:
sudo nano /etc/fstab

Paste in the following line:
 /swapfile       none    swap    sw      0       0 


To prevent the file from being world-readable, you should set up the correct permissions on the swap file:
sudo chown root:root /swapfile 
sudo chmod 0600 /swapfile

Friday, August 30, 2013

First Blog

This is my first blog..
Testing 1..2..3...