Orange Pi Zero User manual

Shenzhen Xunlong Software Co., Limited
I
Orange Pi Zero
Ubuntu Core User Manual

Shenzhen Xunlong Software Co., Limited
II
Contents
1. Ubuntu Core introduction.......................................................................................................................1
2. Before booting Ubuntu Core................................................................................................................. 1
3. Ubuntu Core start up configuration process.....................................................................................5
4. Using example of Ubuntu Core...........................................................................................................10
5. Test example for Ubuntu Core driver................................................................................................11
6. Orange Pi store........................................................................................................................................ 12

Shenzhen Xunlong Software Co., Limited
1
1.Ubuntu Core introduction
Ubuntu Core is a condensed version system based on Ubuntu , released by Canonical
on 2016. It not only provides safety update system at regular intervals, also provides
service for app store at intelligent Internet Devices. Ubuntu Core has been widely used
in industrial gateways, home gateways, wireless access networks, digital signage, robots,
vending machines, wireless communication base stations and unmanned aerial vehicles.
Ubuntu Core fully built with Snap, a safe, easy to update open source Linux packaging
format. Meanwhile, Ubuntu Core provides a secure support platform for the rapid
creation of IOT devices and embedded devices.
Main specification of Ubuntu Core:
Security: automatic, controllable updates, timely recovery to repair high-risk security
vulnerabilities.
Dependability: transactional (rollback) update mechanism.
Convenience: easier to deploy software stores and access huge amounts of
applications.
2.Before booting Ubuntu Core
Hardware specification of Orange Pi Zero :

Shenzhen Xunlong Software Co., Limited
2

Shenzhen Xunlong Software Co., Limited
3
Wire cable, power supply, TTL to USB cable and SD card preparing
For now, the first time to boot Ubuntu Core on Orange Pi Zero could only realize via
Ethernet port configuration.
Download Ubuntu Core image
Here is the website to download: http://www.orangepi.org/downloadresources/
Write the downloaded image into SD card
Unzip the image
Write Ubuntu Core image into SD card
Register an Ubuntu One account
Here is the website to register: https://login.ubuntu.com/+login。
Select the
I am a new Ubuntu One user
, register according to the prompts
1.
$ unrar -xOrangePi_zero_UbuntuCore_1604_V0_0_1.rar
1.
2.
$ umount /dev/sdx
$ sudo dd bs=4M if=orangepi-zero.img of=/dev/sdx (sdx according to the
actual situation)

Shenzhen Xunlong Software Co.,
Limited
4
After register, import the
ssh public ke
y on the system(PC)(the path on Linux is
~/.ssh/id_rsa.pub)of
SSH Keys
into Ubuntu One account like the following:
If there is no the above file generated, you could use the following command:
1.
$ ssh-keygen -t rsa -C“orangepi”

Shenzhen Xunlong Software Co., Limited
5
Ubuntu Core is defaulted no console to login, only devise with ssh key has the
right to ssh remote login Ubuntu Core system.
3.Ubuntu Core start up configuration process
After prepared the Step2 before booting, we could boot the system and configure
corresponding setting.
Insert SD card into Orange Pi Zero with written image, connect wire cable, TTL to
USB cable and power it on. There will print out the following information on the
terminal:
Press
Enter
into the configuration interface like the following:

Shenzhen Xunlong Software Co., Limited
6
Press
Enter
into the following network configure interface, if the network connect
normally then it would distribute IP address.

Shenzhen Xunlong Software Co., Limited
7
Use the arrow keys to position of
[Done]
the cursor on the above interface, press
Enter
key into the following
Profile Setup
configure interface.
Enter the email address when register Ubuntu One, press Enter key and your
system would configure ssh login, after it succeed, there would be prompt like the
following. You could login Ubuntu Core via ssh now.

Shenzhen Xunlong Software Co., Limited
8
Reopen a terminal with the ssh command prompts on the above: ssh
prompt like the following:

Shenzhen Xunlong Software Co., Limited
9
If there is prompt of error like the following, you could enter the following command
to delete the previous record and re-login.
1.
ssh-keygen -f"/home/xunlong/.ssh/known_hosts" -R192.168.1.174

Shenzhen Xunlong Software Co., Limited
10
Login console with system configure
The configure interface at the first time booting named
console-conf
, it would logout
after configured. It would run with
getty
and provide login interface. If you donot want
to use ssh, you could configure console to login the system.
You could set the password after login system with ssh.
Back the the terminal of serial port and press Enter to logout console-conf, and you will
enter into the following prompt of console. You could login with your account and
password into Ubuntu Core.
4.Using example of Ubuntu Core
You could run Ubuntu Core after finished the previous configuration.
1.
$ sudo passwd ${USER}

Shenzhen Xunlong Software Co., Limited
11
Install and run your first Snaps —— Hello, enter the following command:
You could refer to the official website about how to develop and use Ubuntu Core
Snaps and snapcraft file: https://snapcraft.io/docs/
Ubuntu Core file: https://docs.ubuntu.com/core/en/
5.Test example for Ubuntu Core driver
User Snappy wiringop-zero to test the function of GPIO
Install wiringop-zero(for now it is on edge channel) from Orange Pi store
Connect plug-in unit of wiringop-zero and core
1.
2.
$ snap connect wiringop-zero:physical-memory-control
core:physical-memory-control
$ snap connect wiringop-zero:physical-memory-observe
core:physical-memory-observe
Test the function of GPIO (same as other images)
Test the function of playback and recording
Install alsa-utils
Use the relevant commands
1.
2.
$ sudo snap install hello
$ hello
1.
$ sudo snap install wiringop-zero --edge
1.
2.
3.
4.
$ sudo wiringop-zero.gpio mode 2out
$ sudo wiringop-zero.gpio write 8 0
$ sudo wiringop-zero.gpio write 8 1
$ sudo wiringop-zero.gpio read 8
1.
$ sudo snap install alsa-utils
1.
2.
3.
$ sudo aplay -l
$ sudo alsamixer
$ sudo aplay test.wav

Shenzhen Xunlong Software Co., Limited
12
WIFI and AV video output
Since there is not enough relevant driver, we have set those two functions on edge
channel, you could run them with the following command:
Reflash orangepi-zero-kernel on edge channel, and reboot the system. You could
use WIFI and AV video output.
WIFI configuration just like the following shows, account and password both are
orangepi
Add WIFI configuration on /etc/netplan/00-snapd-config.yaml and reboot it.
6.Orange Pi store
Orange Pi has already has its exclusive store, you could use Web page or command to
upload your Snaps to Orange Pi store.
1.
2.
$ sudo snap refresh orangepi-zero-kernel --edge
$ reboot

Shenzhen Xunlong Software Co., Limited
14

Shenzhen Xunlong Software Co., Limited
15
After select Orange Pi store, there would be a name of Orange Pi on the top left
corner, you could upload Snaps into Orange Pi store with Submit to the store
.
You also need to snap app register a Snaps account on New snap page. Please note that the

Shenzhen Xunlong Software Co., Limited
16
name of Snaps is unique.

Shenzhen Xunlong Software Co., Limited
17
Enjoy it!
Table of contents
Popular Microcontroller manuals by other brands

Texas Instruments
Texas Instruments AM243x user guide

STMicroelectronics
STMicroelectronics STM32L151CB manual

Renesas
Renesas CK-RX65N quick start guide

Texas Instruments
Texas Instruments CC1110-CC1111DK user manual

Microchip Technology
Microchip Technology PIC16F18076 user guide

Philips
Philips LPC213 Series user manual