Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Getting Started with Ubuntu* Core on an UP Squared* Board

$
0
0

Introduction

This article demonstrates to new users how to install Ubuntu* Core on an UP Squared* Grove* IoT Development Kit. The UP Squared board is a low-power and high performance platform ideal for Internet of Things (IoT) applications. The UP Squared board based on either the Intel® Celeron® processor (N3350) or Intel® Pentium® processor (N4200). For more information, visit http://www.up-board.org/upsquared. Ubuntu* Core is a lightweight, transactional version of Ubuntu* designed for IoT and cloud usage. Snaps are universal Linux packages that are available to install on Ubuntu* Core to work on IoT devices and more. For more information on the Ubuntu* Core, go to https://www.ubuntu.com/core.

Hardware Requirements

The hardware components used in this project are listed below:

  • UP Squared board
  • 2 USB 2.0 or 3.0 flash drives with at least 2GB free space available
  • A monitor with an HDMI interface
  • USB keyboard and mouse
  • A VGA or HDMI cable
  • A network connection with Internet access or Wi-Fi kit for UP Squared
  • An existing Linux* system is required to generate the RSA key (see Figure-1 below) and to login with SSH into the Ubuntu Core (Figure-14 below).

Software Requirements

The software requirements used in this project are listed below:

Steps

Download Images

  • Download Ubuntu Core Image 16.04.4

Setup  the Ubuntu SSO Account

  • Create an Ubuntu Account
  • Generate Keyss
  • Import Key

Write the USB Drives

  • Download Ubuntu Core Image 16.04.4

Installation

  • Install Live Flash
  • Install Ubuntu Core

Generate a Host SSH Key

The first step is to create an Ubuntu SSO account from https://login.ubuntu.com
The account is required to create the first user on an Ubuntu Core installation. Click on the Personal details to fill out your information. 
Next, use an existing Linux system to generate the RSA key by running ssh-keygen -t rsa on the Linux shell as follows:
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen –t rsa

Figure 1: Generate an SSH key on the Linux shell

Your public key is now available as .ssh/id_rsa.pub in your home folder /home/Ubuntu/.ssh/id_rsa.pub.

  • Click on the SSH keys and insert the contents of your public key /home/Ubuntu/.ssh/id_rsa.pub, then click on Import SSH key.

Figure 2: Submitted the SSH keys successfully

Create a Live USB Ubuntu* Flash Drive

Booting from the Live USB Flash Drive

  • Connect the USB hub, keyboard, mouse and the monitor to the Up Squared.

Figure 3: Up Squared board

  • Insert the Live USB Ubuntu Desktop flash drive you created earlier in to the Up Squared board.
  • Select "Try Ubuntu without installing”.

Figure 4: Try Ubuntu without installing

Install Ubuntu* Core Image on the Up Squared

  • Insert the second USB flash drive containing the Ubuntu Core image file into the Up Squared board.
  • Check for directories mounted on the internal eMMC storage. Umount any directory mounted on the internal eMMC storage. Open a terminal and type:
mount | grep mmcblk
umount /media/ubuntu/writable
  • Check for the name of the drives of the Up Squared:
sudo fdisk -l
  • Assume /dev/sda is the second USB flash drive containing the Ubuntu Core image, mount it to /media/usb1.
sudo mkdir /media/usb1
sudo mount /dev/sda /media/usb1
  • Decompress the Ubuntu Core image and flash it into the Up Squared internal memory:
xzcat /media/usb1/ubuntu-core-16-amd64.img.xz | sudo dd of=/dev/mmcblk0 bs=32M status=progress; sync

Figure 5: Flash Ubuntu Core

  • Remove the Live USB Ubuntu Desktop flash drive and reboot the Up Squared board. The Up Squared will reboot from the internal memory where the Ubuntu Core has been flashed.

Configure the UP Squared* Board

After the Up Squared has rebooted, you will see a prompt below.

Figure 6: Ubuntu Core Configuration
  • Select Start to configure your network.

Figure 7: Configure wlan0
  • Select wlan0, then select Configure WIFI settings.

Figure 8: Configure WIFI
  • Enter Network name and Password, then select Done.

Figure 9: Network configuration
  • Highlight Done and press Enter
  • Highlight Done and press Enter again.

Figure 10: Network connections configuration complete

  • Now, DHCPv4 is enabled for wlan0, select Done.
  • Enter the Ubuntu One email address that was set up earlier, select Done then Enter.

Figure 11: Profile setup

  • Once the configuration complete, the Ubuntu SSO username and Up Squared localhost IP address will be displayed on the screen. Use this Up Squared localhost IP address to login from a different Ubuntu machine later in Figure 14.
Figure 12: Configuration complete
  • Select Finish then Enter. Ubuntu Core login will be prompted as follow:
Figure 13: Ubuntu Core login from Up Squared board

First User login on a Different Ubuntu* Machine

  • First, add RSA identities to the authentication agent by running ssh-add on the shell.
  • Next, login with SSH into the Ubuntu Core from a different Ubuntu machine on the same network. The user name is your Ubuntu SSO username and the password is not required.
ssh <your Ubuntu SSO username>@<Ubuntu Core IP address>

Figure 14: ssh into Ubuntu Core from a different Ubuntu machine

  • Set a password in case you want to login from the local console on the Up Squared board. On the different Ubuntu machine console, type:
sudo passwd <your Ubuntu SSO username>

Figure 15: Set localhost password
Now, using your Ubuntu SSO username and password just set in Figure 15 to log in to the Up Squared board from the its local console:
Figure 16:localhost login

Run Hello World Snap on localhost

Now the Up Squared is ready for the snaps. Snaps are self-contained application bundles that contain most of the libraries and runtimes needed. It is a squashFS filesystem containing your app code and a snap.yaml file.
  • Sign in to a Snap store using an Ubuntu SSO account:
Figure 17: Sign in to a snap store from localhost
  • Install the Hello Snap package using the snap name:

Figure 18: Install hello snap

  • Run the Hello Snap:

Figure 19: Run hello snap
  • List all snaps:

Figure 20: List all snaps

Refresh the Hello snap:

Figure 21: Refresh hello snap
Refresh all snaps:

Figure 22: Refresh all snaps
Remove the Hello snap:

Figure 23: Remove Hello snap

Summary

We have described how to install Ubuntu* Core on the Up Squared board and run Hello snap on Ubuntu Core. Visit https://uappexplorer.com/snaps for the list of other available snaps.

Key References

About the Author

Nancy Le is a software engineer at Intel Corporation in the Core & Visual Computing Group working on Intel Atom® processor enabling for Intel® IoT projects.

 

 

Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>