Monday, August 31, 2015

Install Ubuntu in Beaglebone Black and setup network with Ethernet connection


Installation of Ubuntu in BBB

1. Download prebuilt image of Ubuntu (*.img.xz) from http://elinux.org/BeagleBoardUbuntu#eMMC:_BeagleBone_Black

2. Extract the image

3. Write image to a microSD card using Win32DiskImager (Used Windows 7 Professional).

4. Insert the SD card into poweredoff beaglebone. Keep pressed the boot button and Power on the board (used 5 V adapter to Power ON).

5. Keep the boot button pressed till the indicator leds start blinking. Wait for about 10 to 15 min till all the indicator leds stays ON.

6. Power off the board, take out the SD card and power it on again with USB connected to your computer (Can remove the 5 V adapter now).

7. ssh to ubuntu@192.168.7.2 using terminal in linux or putty in windows. Password is "temppwd".

8. You are logged in to the Ubuntu OS in Beaglebone black.

Setup Network with Ethernet connection

The set up explained here is specific for my network, where  a static ip is set to the beagle board.

1. Connect power, usb and ethernet cable to BBB.

2. ssh to the board with 192.168.7.2 (for usb connection)
      ssh ubuntu@192.168.7.2
      password: temppwd

3.  Set static IP to the primary n/w interface, which is eth0.
       a. nano /etc/network/interface
       b. Add below lines in primary n/w interface part
             # The primary network interface
             auto eth0
             iface eth0 inet static
                address 10.184.36.6  // Contact system admin for ip informations.
                netmask 255.255.255.0
                gateway 10.184.36.1

4. Now logout of the terminal and ssh to the board with 10.184.36.6 (assigned static IP)
      ssh ubuntu@10.184.36.6
      password: temppwd

5. Assign name server (This step is needed to be done each time the BBB is rebooted, Or else do something to make this change permanent).
      a. nano /etc/resolv.conf
      b. Commend all lines and add below line
            nameserver 10.184.0.11 // Contact system admin for ip informations.

6. Update by giving below command and enjoy.
      sudo apt-get update

Friday, August 21, 2015

Linux useful commands and informations

1. In debian based OS apt-get install command will download the .deb package in the below folder before installation.

    /var/cache/apt/archives/

2. To format disk in commandline

      sudo cfdisk /dev/sdb

   One another option is

     sudo mkfs.ext4 /dev/sdb1

3. Find User ID (uid) of the current user in Linux system.

      id -u [USER_NAME]

      eg:  id -u root  (which will be 0).

4. Change ownership of a folder for specific user.

      chown -R [UID_OF_USER] [PATH_TO _FOLDER]

      eg: chown -R 1000 /opt/tinyos-2.x/

5. Find a file or directory in specific place.

      find [PATH_TO_SEARCH] -name [FILE_NAME]

      eg: find /opt -name tinyos.sh

6. Install grub due to some error in grub.

      grub-install --root-directory=/dev/sda

7. Write OS image (*.img) into USB/ microSD in linux (Ubuntu).
     Create bootable USB/ microSD from image file (.img)

      sudo dd if=./BBB*.img of=/dev/sdX

      sdX, here X denote where the device is mounted.

8. SSh connection failure due to the error "Host key verification failed."

     ssh-keygen -R



9. Find baud rate of a serial device through commanline

    sudo stty -F /dev/ttyUSB0    //replace ttyUSB0