You are on page 1of 466

Table

of Contents
Cover

1.1

Summary

1.2

About This Training

1.3

Objectives

1.3.1

Skills

1.3.2

Prerequisites

1.3.3

Introduction

1.4

Build Systems

1.5

Yocto Board Support Package

1.5.1

Yocto

1.5.1.1

Compilation

1.5.1.2

Make

1.5.1.2.1

Bitbake

1.5.1.2.2

Script

1.5.1.2.3

Building Blocks

1.5.1.3

SDK

1.5.1.4

Extra Packages

1.5.1.5

Kernel

1.5.1.6

Patch

1.5.1.6.1

Building

1.5.1.6.2

Headers

1.5.1.6.3

Modules

1.5.1.7

Cross Compilation

1.5.1.7.1

Native

1.5.1.7.2

Filesystem

1.5.1.8

Flashing

1.5.1.9

Ubilinux

1.5.2

CentOS

1.5.3

Kali

1.5.4

Google Brillo

1.5.5

Ostro

1.5.6

Boot Loaders

1.6

U-Boot

1.6.1

Initialization

1.7

Upgrade

1.7.1

Boot Up

1.7.2

Dual Boot

1.7.3

Display Message

1.7.4

Modules

1.7.5

Filesystem

1.7.6

Memory

1.7.7

Backup

1.7.8

Recovery

1.7.9

Reboot

1.7.10

Processes

1.7.11

User Space

1.8

Virtual Network Computing

1.8.1

Text Editors

1.8.2

Services

1.8.3

Logs

1.8.4

Package Management Systems

1.8.5

Open Package Management

1.8.5.1

Python Package Index

1.8.5.2

Nicely Package Make

1.8.5.3

Advanced Packaging Tool

1.8.5.4

Manual

1.8.5.5

Conda

1.8.5.6

Libraries

1.8.6

Mraa

1.8.6.1

Upm

1.8.6.2

OpenCv

1.8.6.3

Temboo

1.8.6.4

Libiio

1.8.6.5

Frameworks

1.8.7

Cylon JS

1.8.7.1

Johnny Five

1.8.7.2

ROS

1.8.7.3

Gobot

1.8.7.4

Pixhawk

1.8.7.5

Artoo

1.8.7.6

Bower

1.8.7.7

Zetta

1.8.7.8

Miscellaneous

1.8.7.9

Subsystems

1.9

X File Systems

1.9.1

Pin Muxing

1.9.2

Memory

1.9.3

Input

1.9.4

General Purpose Input Output

1.9.5

Serial

1.9.6

Bluetooth

1.9.7

Hackathon

1.9.7.1

WiFi

1.9.8

Audio

1.9.9

Camera

1.9.10

Block

1.9.11

Virtual File System

1.9.12

Universal Serial Bus

1.9.13

Inter Integrated Circuit

1.9.14

Peripheral Component Interconnect

1.9.15

Clock

1.9.16

Modems

1.9.17

Networking

1.9.18

Power

1.9.19

Thermal

1.9.20

Graphics

1.9.21

LED

1.9.22

LIDAR

1.9.23

Debug

1.10

Application Development

1.11

C Compiler

1.11.1

Cross Compile

1.11.2

Python

1.11.3

NodeJS

1.11.4

Cloud9

1.11.5

Data

1.11.6

Drone Code

1.11.7

Speech

1.11.8

Radio Frequency

1.11.9

Bots

1.11.10

Artificial Intelligence

1.11.11

Games

1.11.12

Vision

1.11.13

Messaging

1.11.14

Entertainment

1.11.15

Home Assistants

1.11.16

Dashboards

1.11.17

IRC

1.11.18

Location

1.11.19

Facial Recognition

1.11.20

Software Defined Radio

1.11.21

REST

1.11.22

Wrap-Up

1.12

Online Training

1.12.1

Challenge

1.12.2

Tbd

1.12.3

SandBox

1.13

Once Upon A Time

1.14

Cover

Embedded Linux

by The IoT Learning Initiative

Experiment, Make, Innovate

Objectives

Objectives
Create Base Support Package and Software Development Kit for Embedded
Devices based on Yocto Project
Develop Linux Kernel modules
Integrate your Linux Kernel modules into your Board Support Package using
Linux Kernel Configuration and Build Process
Identify procedures to build different flavors of Linux distributions for
Embedded Devices
Understand about Bootloaders
Extend U-Boot Command Line Interface functionality
Interpret services available at boot time
Validate userspace development environment found in Linux Embedded
Devices
Explain the different Linux Kernel Subsystems
Examine debug resources in Linux Embedded Devices
Validate the Application Development possibilities available in Linux
Embedded Devices

Skills

Skills
Working in a Linux environment
Hardware Hacking (Arduino, Raspberry Pi, Intel Edison, Intel Galileo, etc)
DIY/Maker Attitude
Reading/Written English skills
Strong team player with self-motivation, self-starter and passionate about
Personal Development

Prerequisites

Prerequisites
Accounts
None

Equipment
Laptop (Linux or Windows)
Internet Connection
Micro USB Cable
Linux Based Board Development (Intel Edison, Intel Galileo)
Grove Indoor Environment Kit for Intel Edison
USB External Sound Card Audio Adapter
Logitech HD Webcam C525, Portable HD 720p Video Calling with Autofocus

Pre-Work
root@edison:~# git clone https://github.com/YourGithubUserNa
me/TheIoTLearningInitiative.git
Cloning into 'TheIoTLearningInitiative'...
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
Checking connectivity... done.
root@edison:~#

Prerequisites

root@edison:~# cd TheIoTLearningInitiative/
root@edison:~/TheIoTLearningInitiative# mkdir EmbeddedLinux
root@edison:~/TheIoTLearningInitiative# cp InternetOfThings101/m
ain.py EmbeddedLinux
root@edison:~/TheIoTLearningInitiative# cd
root@edison:~#

10

Introduction

Introduction
Operating systems based on the Linux kernel are used in embedded systems
such as consumer electronics (i.e. set-top boxes, smart TVs, in-vehicle
infotainment (IVI), networking equipment (such as wireless routers), machine
control, industrial automation, navigation equipment, spacecraft flight
software, and medical instruments in general). Wikipedia Linux on Embedded
Systems
The Embedded Debian Project is making Debian GNU/Linux a mainstream
choice for embedded projects. Emdebian Homepage
Thanks to their versatility, operating systems based on the Linux kernel can
be also found in mobile devices that are actually touchscreen-based
embedded devices, such as smartphones and tablets, together with personal
digital assistants (PDAs) and portable media players that also include a
touchscreen. Wikipedia
Linux now spans the spectrum of computing applications, including IBM's tiny
Linux wrist watch, hand-held devices (PDAs and cell phones), Internet
appliances, thin clients, firewalls, industrial robotics, telephony infrastructure
equipment, and even cluster-based supercomputers. IBM developerWorks
Embedded Linux applications: An overview
Texas Instruments Hands-On Training for TI Embedded Processors
Linux Insides
Introduction: a Typical Embedded System

Linux Kernel Size


One big problem area when using Linux in an embedded project is the size of
the Linux kernel. This document describes how to configure the Linux kernel
to use a small amount of memory and flash Kernel Size Tuning Guide
Linux Tiny PDF

11

Introduction

uClinux
The Embedded Linux/Microcontroller project is a port of Linux to systems
without a Memory Management Unit (MMU) Homepage
The original uClinux was a derivative of Linux 2.0 kernel intended for
microcontrollers without Memory Management Units (MMUs). However, the
Linux/Microcontroller Project has grown both in brand recognition and
coverage of processor architectures. Today's uClinux as an operating system
includes Linux kernel releases for 2.0 2.4 and 2.6 as well as a collection of
user applications, libraries and tool chains.

12

Build Systems

Build Systems
Embedded Linux Wiki Build Systems
Some examples:
Buildroot
OpenEmbedded
Linaro
Yocto

13

Yocto Board Support Package

Yocto Board Support Package


Board Support Package
In embedded systems, a board support package (BSP) is an implementation
of specific support code (software) for a given (device motherboard) board
that conforms to a given operating system. It is commonly built with a
bootloader that contains the minimal device support to load the operating
system and device drivers for all the devices on the board. Wikipedia

Intel Edison Board Firmware Software


Release
The Intel Edison Board Support Package offers these features:
Kernel image based on Linux kernel 3.10.17
U-boot second stage bootloader
Bluetooth and Wi-Fi connectivity
Intel cloud connectivity middleware
Many base Linux packages provided by the Yocto project
Search Downloads Intel Edison
Intel Edison Software and Documentation
Intel Edison Software Downloads
Intel Edison Software Release 2.1
Intel Edison Software Release 3.0

Intel Edison Board Support Package


Document

14

Yocto Board Support Package


This document is for software and system engineers who are building and
customizing images, kernels, and native SDKs for the Intel Edison
Development Platform. Precompiled versions of the BSP are available on the
Intel website. Users who dont want to modify the default images dont need to
read this document.
Board Support Package (BSP) User Guide for Boards and Kits
Intel Edison Board Support Package
Board Support Package (BSP) User Guide for Intel Edison Development
Platform

15

Yocto

Yocto
It's not an embedded Linux distribution it creates a custom one for you. The
Yocto Project is an open source collaboration project that provides templates,
tools and methods to help you create custom Linux-based systems for
embedded products regardless of the hardware architecture. It was founded
in 2010 as a collaboration among many hardware manufacturers, opensource operating systems vendors, and electronics companies to bring some
order to the chaos of embedded Linux development.
The Yocto Project is a Linux Foundation workgroup whose goal is to produce
tools and processes that will enable the creation of Linux distributions for
embedded software that are independent of the underlying architecture of the
embedded software itself.
Yocto Project Homepage
Yocto Project Quick Start Guide
Yocto Developer Manual
Yocto Project Reference Manual
Yocto Kernel Developer Manual
Yocto Project and Embedded OS Webinar
Yocto Manage a Private Opkg Repository
Code Project Adding 3rd Party Components to Yocto/OpenEmbedded Linux
Yocto Git Server
Elizabeth Flanagan The Yocto Project

16

Yocto

Building Yocto
Let's understand what it means to work with Yocto Project by building images for
QEMU and Minnowboard MAX and compare both processes
How to run Yocto Linux OS in a Virtual Machine

Qemu Image
user@host:~# apt-get install gawk wget git-core diffstat unz
ip texinfo build-essential chrpath
user@host:~# apt-get install qemu
user@host:~$ mkdir source
user@host:~$ cd source
user@host:~$ git clone git://git.yoctoproject.org/poky --bra
nch fido
user@host:~$ source poky/oe-init-build-env yocto-x86-minimal
user@host:~$ bitbake core-image-minimal
user@host:~$ runqemu qemux86
...
user@host:~$ bitbake core-image-full-cmdline-x86
user@host:~$ bitbake core-image-sato-sdk

17

Yocto

Minnowboard MAX Image


Yocto Project @ Minnowboard MAX
user@host:~# apt-get install gawk wget git-core diffstat unz
ip texinfo build-essential chrpath
user@host:~$ mkdir source
user@host:~$ cd source
user@host:~$ git clone -b fido git://git.yoctoproject.org/po
ky
user@host:~$ cd poky
user@host:~$ git clone -b fido git://git.yoctoproject.org/me
ta-intel
user@host:~$ source oe-init-build-env yocto-x86-minnowmax
user@host:~$ bitbake-layers add-layer "$HOME/source/poky/met
a-intel"
user@host:~$ echo 'MACHINE = "intel-corei7-64"' >> conf/loca
l.conf
user@host:~$ bitbake core-image-minimal
user@host:~$ ls
bitbake.lock cache conf downloads sstate-cache tmp
user@host:~$ ls tmp/deploy/images/intel-corei7-64/
...
core-image-minimal-intel-corei7-64.hddimg

Minnowboard MAX Kernel Compilation


user@host:~$ bitbake virtual/kernel -c menuconfig
user@host:~$ bitbake virtual/kernel -c configure -f -v

Minnowboard MAX Image Flashing


user@host:~$ sudo $HOME/source/poky/scripts/contrib/mkefidis
k.sh HOST_DEVICE \
tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-c
orei7-64.hddimg \
TARGET_DEVICE

18

Yocto

19

Compilation

Compilation
In computer programming, the translation of source code into object code by
a compiler. Wikipedia
Intel Edison Board Support Package
Yocto Linux Image build for Intel Edison Simple and Easy
Using Make for Easy Yocto Builds On Intel Edison
Manually Building Yocto Images for the Intel Edison Board from Source
Farit Building Yocto Linux for Intel Edison

Host Development Dependencies


user@host:~# apt-get install build-essential git diffstat ga
wk chrpath texinfo libtool gcc-multilib dfu-util screen u-boot-t
ools

Board Support Package


Download & Decompression
Go to Intel Edison Board Software Downloads and copy the link location for
"Sources - Linux Sources Files" then download them

20

Compilation

user@host:~$ wget http://downloadmirror.intel.com/25028/eng/


edison-src-ww25.5-15.tgz
--2016-02-28 14:58:27-- http://downloadmirror.intel.com/2502
8/eng/edison-src-ww25.5-15.tgz
Resolving downloadmirror.intel.com (downloadmirror.intel.com
)... 23.216.208.166
Connecting to downloadmirror.intel.com (downloadmirror.intel
.com)|23.216.208.166|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6195269 (5.9M) [application/x-compressed]
Saving to: edison-src-ww25.5-15.tgz.1
edison-src-ww25.5-1 100%[=====================>] 5.91M 9
87KB/s in 7.1s
2016-02-28 14:58:34 (857 KB/s) - edison-src-ww25.5-15.tgz.1
saved [6195269/6195269]

user@host:~$ tar zxvf edison-src-ww25.5-15.tgz


edison-src/
edison-src/Makefile
edison-src/meta-intel-edison/
edison-src/meta-intel-edison/README
edison-src/meta-intel-edison/MAINTAINERS
...
edison-src/meta-intel-edison/meta-intel-edison-bsp/recipes-k
ernel/linux/files/upstream_to_edison.patch
edison-src/meta-intel-edison/meta-intel-edison-bsp/recipes-k
ernel/linux/files/defconfig
edison-src/meta-intel-edison/meta-intel-edison-bsp/README.so
urces

user@host:~$ ls
Makefile meta-intel-edison

21

Compilation

user@host:~$ ls meta-intel-edison/
COPYING.MIT meta-intel-arduino meta-intel-edison-distro
setup.sh
MAINTAINERS meta-intel-edison-bsp README
utils

22

Compilation

Make
Make Setup
user@host:~$ make setup

Setup buildenv for SDK host linux64


./meta-intel-edison/setup.sh --dl_dir=/home/abraham/Project
s/RealTime/v25/edison-src/bbcache/downloads --sstate_dir=/home/a
braham/Projects/RealTime/v25/edison-src/bbcache/sstate-cache --b
uild_dir=/home/abraham/Projects/RealTime/v25/edison-src/out/linu
x64 --build_name=custom_build_aarcemor@20151220153244 --sdk_host
=linux64
We are building in external mode
Fetching origin
Fetching origin
Fetching origin
Fetching origin
Cloning Poky in the /home/abraham/Projects/RealTime/v25/edis
on-src/out/linux64/poky directory
Cloning into 'poky'...
done.
Note: checking out 'yocto-1.7.2'.
You are in 'detached HEAD' state. You can look around, make
experimental
changes and commit them, and you can discard any commits you
make in this
state without impacting any branches by performing another c
heckout.
If you want to create a new branch to retain commits you cre
ate, you may
do so (now or later) by using -b with the checkout command a
gain. Example:
git checkout -b new_branch_name

23

Compilation

HEAD is now at 29812e6... busybox: unbreak tar of uncompress


ed files
Cloning Mingw layer to /home/abraham/Projects/RealTime/v25/e
dison-src/out/linux64/poky/meta-mingw directory from local cache
Cloning into 'meta-mingw'...
done.
Cloning Darwin layer to /home/abraham/Projects/RealTime/v25/
edison-src/out/linux64/poky/meta-darwin directory from local cac
he
Cloning into 'meta-darwin'...
done.
Note: checking out '29b5ff31cee24e796f2eb2d2fd1269e3e92c831c
'.
You are in 'detached HEAD' state. You can look around, make
experimental
changes and commit them, and you can discard any commits you
make in this
state without impacting any branches by performing another c
heckout.
If you want to create a new branch to retain commits you cre
ate, you may
do so (now or later) by using -b with the checkout command a
gain. Example:
git checkout -b new_branch_name
HEAD is now at 29b5ff3... gcc-runtime: Don't pollute global
export namespace
Cloning meta-intel-iot-middleware layer to /home/abraham/edi
son-src/out/linux64/poky/meta-intel-iot-middleware directory fro
m local cache
Cloning into 'meta-intel-iot-middleware'...
done.
Note: checking out 'c6d681475e76107e6c04c5f7a06034dc9e772d1e
'.
You are in 'detached HEAD' state. You can look around, make

24

Compilation
experimental
changes and commit them, and you can discard any commits you
make in this
state without impacting any branches by performing another c
heckout.
If you want to create a new branch to retain commits you cre
ate, you may
do so (now or later) by using -b with the checkout command a
gain. Example:
git checkout -b new_branch_name
HEAD is now at c6d6814... upm: Update to 0.3.1
Cloning meta-arduino layer to /home/abraham/Projects/RealTim
e/v25/edison-src directory from GitHub.com/01org/meta-arduino
Cloning into 'meta-arduino'...
remote: Counting objects: 72, done.
remote: Total 72 (delta 0), reused 0 (delta 0), pack-reused
72
Unpacking objects: 100% (72/72), done.
Checking connectivity... done.
Already on '1.6.x'
Your branch is up-to-date with 'origin/1.6.x'.
Applying patch on poky
Initializing yocto build environment
Setting up yocto configuration file (in build/conf/local.con
f)
** Success **
SDK will be generated for linux64 host
Now run these two commands to setup and build the flashable
image:
cd /home/abraham/edison-src/out/linux64
source poky/oe-init-build-env
bitbake edison-image
*************

25

Compilation

user@host:~$ ls
bbcache Makefile meta-arduino meta-intel-edison out pub

Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget https://raw.githubusercontent.com/ikcaro/T
heIoTLearningInitiative/master/EmbeddedLinux/paho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

Make Image
user@host:~$ make image

/bin/bash -c "source out/current/poky/oe-init-build-env /hom


e/abraham/Projects/RealTime/v25/edison-src/out/current/build ; b
itbake -c cleansstate edison-image ; bitbake edison-image"
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
adt-installer
meta-ide-support
You can also run generated qemu images with a command like '
runqemu qemux86'
Parsing recipes: 100% |#####################################

26

Compilation
############################################################| Ti
me: 00:00:10
Parsing of 959 .bb files complete (0 cached, 959 parsed). 13
64 targets, 117 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "i586-poky-linux"
MACHINE = "edison"
DISTRO = "poky-edison"
DISTRO_VERSION = "1.7.2"
TUNE_FEATURES = "m32 core2"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "(detachedfromyocto-1.7.2):29812e61736a9
5f1de64b3e9ebbb9c646ebd28dd"
meta-intel-edison-bsp
meta-intel-edison-distro = "<unknown>:<unknown>"
meta-intel-iot-middleware = "(detachedfromc6d6814):c6d681475
e76107e6c04c5f7a06034dc9e772d1e"
meta-intel-arduino = "<unknown>:<unknown>"
meta-arduino = "1.6.x:541b127163acb243109f07141bf249da2
ecdcd9a"
NOTE: Preparing runqueue
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2 tasks of which 0 didn't nee
d to be rerun and all succeeded.
Loading cache: 100% |#######################################
############################################################| ET
A: 00:00:00
Loaded 1365 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"

27

Compilation
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "i586-poky-linux"
MACHINE = "edison"
DISTRO = "poky-edison"
DISTRO_VERSION = "1.7.2"
TUNE_FEATURES = "m32 core2"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "(detachedfromyocto-1.7.2):29812e61736a9
5f1de64b3e9ebbb9c646ebd28dd"
meta-intel-edison-bsp
meta-intel-edison-distro = "<unknown>:<unknown>"
meta-intel-iot-middleware = "(detachedfromc6d6814):c6d681475
e76107e6c04c5f7a06034dc9e772d1e"
meta-intel-arduino = "<unknown>:<unknown>"
meta-arduino = "1.6.x:541b127163acb243109f07141bf249da2
ecdcd9a"
NOTE: Preparing runqueue
WARNING: /home/abraham/Projects/RealTime/v25/edison-src/out/
linux64/poky/meta/recipes-kernel/linux/linux-yocto_3.10.bb.do_co
nfigure is tainted from a forced run
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
Currently 1 running tasks (3754 of 3757):
0: edison-image-1.0-r0 do_rootfs (pid 16950)
...
NOTE: Tasks Summary: Attempted 3757 tasks of which 3750 didn
't need to be rerun and all succeeded.
Summary: There was 1 WARNING message shown.
./meta-intel-edison/utils/flash/postBuild.sh /home/abraham/P
rojects/RealTime/v25/edison-src/out/current/build
EDISON_ROOTFS_MB = 1536, IMAGE_SIZE_MB = 548
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00332 s, 1.3 GB/s
1+0 records in

28

Compilation
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00321878 s, 1.3 GB/s
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00323493 s, 1.3 GB/s
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00343959 s, 1.2 GB/s
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00328377 s, 1.3 GB/s
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00338686 s, 1.2 GB/s
1+0 records in
1+0 records out
4194304 bytes (4.2 MB) copied, 0.00324502 s, 1.3 GB/s
Image Name: Edison Updater script
Created: Sun Dec 20 15:39:48 2015
Image Type: PowerPC Linux Script (uncompressed)
Data Size: 14683 Bytes = 14.34 kB = 0.01 MB
Load Address: 00010000
Entry Point: 00010000
Contents:
Image 0: 14675 Bytes = 14.33 kB = 0.01 MB
**** Done ***
Files ready to flash in /home/abraham/Projects/RealTime/v25/
edison-src/out/current/build/toFlash/
Run the flashall script there to start flashing.
*************

user@host:~$ ls
bbcache Makefile meta-arduino meta-intel-edison out pub

Make Building Workflow


meta-intel-edison/setup.sh
--dl_dir = bbcache/downloads

29

Compilation
--sstate_dir = bbcache/sstate-cache
--build_dir = out/linux64
--build_name = custom_build_xe1gyq@20151001233406
--sdk_host = linux64
Repositories Cloning
poky-mirror.git
meta-mingw-mirror.git
meta-darwin-mirror.git
meta-intel-iot-middleware-mirror.git
poky
Yocto Build Environment
build/conf/local.conf
source poky/oe-init-build-env
bitbake edison-image
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Debian-8.1"
TARGET_SYS = "i586-poky-linux"
MACHINE = "edison"
DISTRO = "poky-edison"
DISTRO_VERSION = "1.7.2"
TUNE_FEATURES = "m32 core2"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "(detachedfromyocto-1.7.2):29812e61736a9
5f1de64b3e9ebbb9c646ebd28dd"
meta-intel-edison-bsp
meta-intel-edison-distro = "<unknown>:<unknown>"
meta-intel-iot-middleware = "(detachedfromc6d6814):c6d681475
e76107e6c04c5f7a06034dc9e772d1e"
meta-intel-arduino = "<unknown>:<unknown>"
meta-arduino = "1.6.x:541b127163acb243109f07141bf249da2
ecdcd9a"

30

Compilation

Make Flash
user@host:~$ make flash
abraham@aarcemor-desk:~/Projects/RealTime/v25/edison-src$ ma
ke flash
./out/current/build/toFlash/flashall.sh
Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
##################################################] finished!
##################################################] finished!
Flashing U-Boot
##################################################] finished!
Flashing U-Boot Environment
##################################################] finished!
Flashing U-Boot Environment Backup
##################################################] finished!
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
Flashing boot partition (kernel)
##################################################] finished!
Flashing rootfs, (it can take up to 5 minutes... Please be p
atient)
##################################################] finished!
Rebooting
U-boot & Kernel System Flash Success...
Your board needs to reboot to complete the flashing procedur
e, please do not unplug it for 2 minutes.

31

Compilation

32

Compilation

Make + Bitbake
user@host:~$ tar xvf edison-src-ww25.5-15.tgz
user@host:~$ cd edison-src
user@host:~$ ls
Makefile meta-intel-edison
user@host:~$ make setup
user@host:~$ ls
bbcache Makefile meta-arduino meta-intel-edison out pub
user@host:~$ cd out/linux64 || cd out/current
user@host:~$ ls
build poky
user@host:~$ source poky/oe-init-build-env

Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget https://raw.githubusercontent.com/ikcaro/T
heIoTLearningInitiative/master/EmbeddedLinux/paho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

user@host:~$ bitbake edison-image


user@host:~$ ls tmp/deploy/images/edison
bzImage
bzImage--3.10.17+git0+6ad20f049a_c03195ed6e-r0-edison-201512
20135703.bin
bzImage--3.10.17+git0+6ad20f049a_c03195ed6e-r0-edison-201512
20220030.bin
bzImage-edison.bin
edison-image-edison-20151220045929.hddimg
edison-image-edison-20151220045929.rootfs.ext4
edison-image-edison-20151220045929.rootfs.manifest

33

Compilation
edison-image-edison-20151220122444.hddimg
edison-image-edison-20151220122444.rootfs.ext4
edison-image-edison-20151220122444.rootfs.manifest
edison-image-edison-20151220135703.hddimg
edison-image-edison-20151220135703.rootfs.ext4
edison-image-edison-20151220135703.rootfs.manifest
edison-image-edison-20151220213828.hddimg
edison-image-edison-20151220213828.rootfs.ext4
edison-image-edison-20151220213828.rootfs.manifest
edison-image-edison-20151220220030.hddimg
edison-image-edison-20151220220030.rootfs.ext4
edison-image-edison-20151220220030.rootfs.manifest
edison-image-edison-20151220221248.hddimg
edison-image-edison-20151220221248.rootfs.ext4
edison-image-edison-20151220221248.rootfs.manifest
edison-image-edison.ext4
edison-image-edison.hddimg
edison-image-edison.manifest
modules--3.10.17+git0+6ad20f049a_c03195ed6e-r0-edison-201512
20135703.tgz
modules--3.10.17+git0+6ad20f049a_c03195ed6e-r0-edison-201512
20220030.tgz
modules-edison.tgz
README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
u-boot.bin
u-boot-edison-2014.04-1-r0.bin
u-boot-edison-2014.04-1-r0.img
u-boot-edison.bin
u-boot-edison.img
u-boot-envs
u-boot.img
user@host:~$ ls
bitbake.lock cache conf symbols tmp toFlash
user@host:~$ ../../../meta-intel-edison/utils/flash/postBuil
d.sh .
EDISON_ROOTFS_MB = 1536, IMAGE_SIZE_MB = 548
1+0 records in
1+0 records out
...
Image Name: Edison Updater script

34

Compilation
Created: Sun Dec 20 16:22:46 2015
Image Type: PowerPC Linux Script (uncompressed)
Data Size: 14683 Bytes = 14.34 kB = 0.01 MB
Load Address: 00010000
Entry Point: 00010000
Contents:
Image 0: 14675 Bytes = 14.33 kB = 0.01 MB
**** Done ***
Files ready to flash in ./toFlash/
Run the flashall script there to start flashing.
*************
user@host:~$ ./toFlash/flashall.sh
Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board

35

Compilation

Script
user@host:~$ tar xvf edison-src-ww25.5-15.tgz
user@host:~$ cd edison-src
user@host:~$ pwd
/home/xe1gyq/Projects/edison-src
user@host:~$ ls
Makefile meta-intel-edison
user@host:~$ mkdir bitbake_download_dir
user@host:~$ mkdir bitbake_sstate_dir
user@host:~$ ./meta-intel-edison/setup.sh --dl_dir=bitbake_d
ownload_dir --sstate_dir=bitbake_sstate_dir
user@host:~$ source poky/oe-init-build-env

Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget http://git.yoctoproject.org/cgit/cgit.cgi/
meta-intel-iot-middleware/plain/recipes-connectivity/paho-mqtt/p
aho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

user@host:~$ bitbake edison-image


user@host:~$ ../meta-intel-edison/utils/flash/postBuild.sh .
user@host:~$ build/toFlash/flashall.sh
user@host:~$ build/toFlash/flashall.sh --keep-data
user@host:~$ build/toFlash/flashall.sh --recovery

36

Building Blocks

Building Blocks
In OpenEmbedded, a layer is just a collection of recipes and/or configuration
that can be used on top of OE-Core. Typically each layer is organised around
a specific theme, e.g. adding recipes for building web browser software.
Layer for the Intel Edison Development Platform
BBLAYERS ?= " \
/home/abraham/edison-src/out/linux64/poky/meta \
/home/abraham/edison-src/out/linux64/poky/meta-yocto \
/home/abraham/edison-src/out/linux64/poky/meta-yocto-bsp \
/home/abraham/edison-src/meta-intel-edison/meta-intel-edis
on-bsp \
/home/abraham/edison-src/meta-intel-edison/meta-intel-edis
on-distro \
/home/abraham/edison-src/out/linux64/poky/meta-intel-iot-m
iddleware \
/home/abraham/edison-src/meta-intel-edison/meta-intel-ardu
ino \
/home/abraham/edison-src/meta-arduino \
\
"
BBLAYERS_NON_REMOVABLE ?= " \
/home/abraham/edison-src/out/linux64/poky/meta \
/home/abraham/edison-src/out/linux64/poky/meta-yocto \
"

poky/meta
Yocto Metadata Layers
It includes:

37

Building Blocks

recipes-bsp - Anything with links to specific hardw


are or hardware configuration information
recipes-connectivity - Libraries and applications related to
communication with other devices
recipes-core - What's needed to build a basic workin
g Linux image including commonly used dependencies
recipes-devtools - Tools primarily used by the build sys
tem (but can also be used on targets)
recipes-extended - Applications which whilst not essenti
al add features compared to the alternatives in
core. May be needed for full tool fun
ctionality or LSB compliance.
recipes-gnome - All things related to the GTK+ applic
ation framework
recipes-graphics - X and other graphically related syste
m libraries
recipes-kernel - The kernel and generic applications/l
ibraries with strong kernel dependencies
recipes-lsb4 - Recipes added for the sole purpose of
supporting the Linux Standard Base (LSB) 4.x
recipes-multimedia - Codecs and support utilties for audio
, images and video
recipes-rt - Provides package and image recipes fo
r using and testing the PREEMPT_RT kernel
recipes-qt - All things related to the Qt applicat
ion framework
recipes-sato - The Sato demo/reference UI/UX, its as
sociated apps and configuration
recipes-support - Recipes used by other recipes but tha
t are not directly included in images

meta-yocto
Yocto Project integration layers (Poky distro configuration, reference
hardware BSPs) Poky reference distribution for the Yocto Project
It includes:
meta-yocto-bsp

38

Building Blocks
meta-yocto
scripts

Links
Yocto meta-yocto
OpenEmbedded meta-yocto

meta-yocto-bsp
BSP layer for Yocto Project reference hardware
OpenEmbedded meta-yocto-bsp

meta-intel-edison-bsp
BSP layer for the Intel Edison module.
It includes:
bcm43340-bt Broadcom Bluetooth fw files and patch utility
bcm43340-fw Firmware files for use with Linux kernel
bcm43340-mod Broadcom wifi driver for the 43340
linux-externalsrc Yocto Kernel
mcu-fw-bin This is edison mcu fw binary.
mcu-fw-load This is intel mcu app download daemon.
pwr-button-handler Daemon listening to Edison PWR long button press, and
starting OOBE service when it happens
sst-fw-bin This is edison sst fw binary.
u-boot Universal Boot Loader for embedded devices
u-boot-fw-utils U-boot bootloader fw_printenv/setenv utils
u-boot-tools U-boot bootloader mkimage tool

Links
OpenEmbedded meta-intel-edison-bsp

meta-intel-edison-distro
39

Building Blocks
This is the distro layer used to build official Intel Edison images.
OpenEmbedded meta-intel-edison-bsp

meta-intel-iot-middleware
Shared middleware recipes for Intel IoT platforms
recipes-connectivity
recipes-devtools
recipes-extended
Yocto meta-intel-iot-middleware

40

SDK

Native SDK
To cross-compile native applications for your image, you must generate an
SDK containing a cross-compiler toolchain and sysroot. You can generate a
full SDK for the Edison Development Board.

Building via Make


user@host:~$ make sdk
user@host:~$ ls out/current/build/tmp/deploy/sdk/
poky-edison-glibc-x86_64-edison-image-core2-32-toolchain-1.7
.2.manifest
poky-edison-glibc-x86_64-edison-image-core2-32-toolchain-1.7
.2.sh
user@host:~$ out/current/build/tmp/deploy/sdk/poky-edison-gl
ibc-x86_64-edison-image-core2-32-toolchain-1.7.2.sh

Building via BitBake


user@host:~$ bitbake edison-image-c populate_sdk
user@host:~$ ls tmp/deploy/sdk
user@host:~$ poky-edison-eglibc-x86_64-edison-image-core2-32
-toolchain-1.6.1.sh

41

Extra Packages

Extra Packages
Standard, Common
Review the content of "edison-image.bb" and add some extra packages
user@host:~$ nano edison-src/meta-intel-edison/meta-intel-ed
ison-distro/recipes-core/images/edison-image.bb
IMAGE_INSTALL += libpng
IMAGE_INSTALL += "opencv"
IMAGE_INSTALL += "python-opencv"
PACKAGE_EXCLUDE = "libpng"

Third Party, Not Common, AX25


user@host:~$ pwd
edison-src/out/linux64/build
user@host:~$ cd edison-src/out/current/poky
user@host:~$ git clone https://github.com/hambedded-linux/me
ta-hamradio.git
user@host:~$ nano edison-src/out/current/build/conf/bblayers
.conf
/home/xe1gyq/Projects/edison-src/out/linux64/poky/meta-hamra
dio
user@host:~$ rm -rf /home/xe1gyq/Projects/edison-src/out/lin
ux64/poky/meta-hamradio/recipes-kernel
user@host:~$ nano meta-intel-edison/meta-intel-edison-distro
/recipes-core/images/edison-image.bb
IMAGE_INSTALL += ax25-apps
IMAGE_INSTALL += ax25-tools
IMAGE_INSTALL += libax25
user@host:~$ make image
user@host:~$ make flash

42

Extra Packages

43

Kernel

Kernel
In computing, the kernel is a computer program that manages input/output
requests from software, and translates them into data processing instructions
for the central processing unit and other electronic components of a computer.
The kernel is a fundamental part of a modern computer's operating system.
Wikipedia

Intel Edison Default Version from Booted


Device
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 17
...
SUBLEVEL = 98
EXTRAVERSION =
NAME = TOSSUG Baby Fish

Intel Edison Default Version from Kernel


Source Code
ToDo Open Makefile

44

Kernel

Patch
01 Org Intel Edison Linux Kernel
edison-3.19.5
edison-3.10.98
edison-3.10.17

Patch Location
user@host:~$ ls edison-src/meta-intel-edison/meta-intel-edis
on-bsp/recipes-kernel/linux/files/
defconfig upstream_to_edison.patch

Patched Files
Documentation/kernel-parameters.txt
arch/x86/configs/i386_edison_defconfig
arch/x86/
arch/x86/platform/intel-mid/
arch/x86/platform/mrst/
drivers/acpi/
drivers/bluetooth/
drivers/cpufreq/
drivers/dma/
drivers/gpio/
drivers/hwmon/intel_mcu_common.c
drivers/hwmon/intel_mcu_common.h
drivers/hwmon/intel_mid_gpadc.c
drivers/i2c/busses/
drivers/idle/
drivers/iio/adc/
drivers/iio/adc/iio_basincove_gpadc.c
drivers/iio/adc/ti-ads7955.c
drivers/misc/bcm-lpm/bcm_bt_lpm.c

45

Kernel
drivers/misc/emmc_ipanic.c
drivers/misc/pti.c
drivers/misc/stm.c
drivers/misc/stm.h
drivers/mmc/card/block.c
drivers/mmc/core/
drivers/mmc/host/
drivers/net/wireless/
drivers/pci/pci-atom_soc.c
drivers/platform/x86/
drivers/pci/pci-atom_soc.c
drivers/pci/pci.c
drivers/pci/quirks.c
drivers/platform/x86/Kconfig
drivers/platform/x86/Makefile
drivers/platform/x86/intel_mid_powerbtn.c
drivers/platform/x86/intel_mid_thermal.c
drivers/platform/x86/intel_pmic_gpio.c
drivers/platform/x86/intel_psh_ipc.c
drivers/platform/x86/intel_scu_flis.c
drivers/platform/x86/intel_scu_fw_update.c
drivers/platform/x86/intel_scu_ipc.c
drivers/platform/x86/intel_scu_ipcutil.c
drivers/platform/x86/intel_scu_mip.c
drivers/platform/x86/intel_scu_pmic.c
drivers/power/
drivers/pwm/
drivers/regulator/
drivers/remoteproc/
drivers/rpmsg/
drivers/rtc/
drivers/spi/
drivers/thermal/
drivers/tty/serial/
drivers/usb/core/
drivers/usb/dwc3/
drivers/usb/gadget/
drivers/usb/host/
drivers/watchdog/
net/bluetooth/l2cap_core.c

46

Kernel
sound/core/
sound/soc/
sound/soc/codecs/sn95031.c
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm_hubs.c
sound/soc/intel/

Patch Review
x86 Intel MID Platform
bcm43340
Medfield MID Platform
Intel MID Platform
arch/x86/Kconfig
if X86_WANT_INTEL_MID
config X86_INTEL_MID
bool "Intel MID Platform"
depends on PCI
depends on PCI_GOANY
depends on X86_IO_APIC
select X86_INTEL_MID
select SFI
select INTEL_SCU_IPC
select X86_PLATFORM_DEVICES
select ARCH_HAVE_CUSTOM_GPIO_H
config X86_MDFLD
bool "Medfield MID platform"
depends on X86_INTEL_MID
select DW_APB_TIMER
select APB_TIMER
select I2C
select SPI
select INTEL_SCU_IPC
select X86_PLATFORM_DEVICES
select MFD_INTEL_MSIC

47

Kernel

config ATOM_SOC_POWER
bool "Select Atom SOC Power"
config INTEL_DEBUG_FEATURE
bool "Debug feature interface on Intel MID platform"
depends on X86_INTEL_MID
Provides an interface to list the debug features
that are enabled on an Intel MID platform. The
enabling of the debug features depends on the mode
the device is in (e.g. manufacturing, production,
end user, etc...).
config ARCH_NR_GPIO
depends on ARCH_HAVE_CUSTOM_GPIO_H
default 512 if X86_INTEL_MID
default 0
Maximum number of GPIOs in the system.
arch/x86/Kconfig.cpu
config MSLM
bool "Intel Silvermont (Atom)"
---help-- Select this for the Intel Silvermont (Atom) platfor
m. Intel Atom
CPUs have an in-order pipelining architecture and t
hus can benefit
from accordingly optimized code. Use a recent GCC w
ith specific
Atom support in order to fully benefit from selecti
ng this option.
X86_L1_CACHE_SHIFT
X86_USE_PPRO_CHECKSUM
X86_TSC
X86_CMPXCHG64
X86_CMOV

48

Kernel
arch/x86/Makefile_32.cpu
cflags-$(CONFIG_MSLM) += $(call cc-option,-march=slm
) \
$(call cc-option,-mtune=slm,$(call cc-option,-mt
une=generic))

Platform
Intel MID Specific Setup Code
arch/x86/include/asm/intel-mid.h
``
It includes code from:
- SFI
- PCI
- Platform Device
- GPIO
- OEMB Table
- IAFW
- Device Creation (Board Information)
- x86_init, x86_platform_init
```sh
#define INTEL_MID_OPS_INIT {\
DECLARE_INTEL_MID_OPS_INIT(penwell, INTEL_MID_CPU_CHI
P_PENWELL) \
DECLARE_INTEL_MID_OPS_INIT(cloverview, INTEL_MID_CPU_
CHIP_CLOVERVIEW) \
DECLARE_INTEL_MID_OPS_INIT(tangier, INTEL_MID_CPU_CHI
P_TANGIER) \

Related
arch/x86/include/asm/intel_mid_gpadc.h

49

Kernel
arch/x86/include/asm/intel_mid_hsu.h
arch/x86/include/asm/intel_mid_pcihelpers.h
arch/x86/include/asm/intel_mid_powerbtn.h
arch/x86/include/asm/intel_mid_pwm.h
arch/x86/include/asm/intel_mid_remoteproc.h INTEL MID Remote
Processor
arch/x86/include/asm/intel_mid_rpmsg.h
arch/x86/include/asm/intel_mid_thermal.h
SoC level power limits for thermal throttling
intel mid thermal driver
arch/x86/include/asm/module.h
elif (defined CONFIG_MATOM) || (defined CONFIG_MSLM)
arch/x86/include/asm/required-features.h
if defined(CONFIG_MATOM) || defined(CONFIG_MSLM)
arch/x86/include/asm/setup.h
extern void x86_intel_mid_early_setup(void);
static inline void x86_intel_mid_early_setup(void) { }
arch/x86/include/uapi/asm/bootparam.h
arch/x86/include/uapi/asm/msr-index.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/intel.c
case 0x4A: /* Merrifield */
arch/x86/kernel/cpu/mcheck/therm_throt.c
arch/x86/kernel/early_printk.c
arch/x86/kernel/head32.c
case X86_SUBARCH_INTEL_MID:
arch/x86/kernel/irq.c
arch/x86/kernel/rtc.c
arch/x86/kernel/smpboot.c
arch/x86/pci/mrst.c
arch/x86/platform/Makefile
obj-y += intel-mid/
arch/x86/platform/intel-mid/Makefile
Very Important!
arch/x86/platform/intel-mid/board.c | Intel Medfield based b
oard (Blackbay)
Very Important!
arch/x86/platform/intel-mid/device_libs/Makefile
arch/x86/platform/intel-mid/device_libs/pci/platform_sdhci_p
ci.c | mmc sdhci pci platform data initilization file

50

Kernel
arch/x86/platform/intel-mid/device_libs/pci/platform_sdhci_p
ci.h
arch/x86/platform/intel-mid/device_libs/pci/platform_usb_otg
.c | USB OTG platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_ads7955.c |
ads7955 platform data initialization file
arch/x86/platform/intel-mid/device_libs/platform_ads7955.h
arch/x86/platform/intel-mid/device_libs/platform_bq24261.c |
Platform data for bq24261 charger driver
arch/x86/platform/intel-mid/device_libs/platform_bq24261.h
arch/x86/platform/intel-mid/device_libs/platform_emc1403.c |
emc1403 platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_emc1403.h
arch/x86/platform/intel-mid/device_libs/platform_lis331.c |
lis331 platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_lis331.h
arch/x86/platform/intel-mid/device_libs/platform_max3111.c |
max3111 platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_max3111.h
arch/x86/platform/intel-mid/device_libs/platform_max7315.c |
max7315 platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_max7315.h
arch/x86/platform/intel-mid/device_libs/platform_mid_pwm.c |
mid_pwm platform data initilization file
PWM_LED
PWM_VIBRATOR
PWM_LCD_BACKLIGHT
arch/x86/platform/intel-mid/device_libs/platform_mid_pwm.h
arch/x86/platform/intel-mid/device_libs/platform_mpu3050.c |
mpu3050 platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_mpu3050.h
arch/x86/platform/intel-mid/device_libs/platform_mrfl_ocd.c
| Platform data for Merrifield Platform OCD Driver
+#include <asm/intel-mid.h>
+#include <asm/intel_mid_remoteproc.h>
+#include <asm/intel_scu_ipc.h>
+#include <asm/intel_basincove_ocd.h>
arch/x86/platform/intel-mid/device_libs/platform_mrfl_ocd.h
arch/x86/platform/intel-mid/device_libs/platform_mrfl_therma
l.c | Intel Merrifield Platform thermal driver

51

Kernel
arch/x86/platform/intel-mid/device_libs/platform_mrfl_therma
l.h
arch/x86/platform/intel-mid/device_libs/platform_msic.c | MS
IC platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic.h
arch/x86/platform/intel-mid/device_libs/platform_msic_adc.c
| MSIC ADC platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_adc.h
arch/x86/platform/intel-mid/device_libs/platform_msic_audio.
c | MSIC audio platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_audio.
h
arch/x86/platform/intel-mid/device_libs/platform_msic_batter
y.c | MSIC battery platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_batter
y.h
arch/x86/platform/intel-mid/device_libs/platform_msic_gpio.c
| MSIC GPIO platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_gpio.h
arch/x86/platform/intel-mid/device_libs/platform_msic_ocd.c
| MSIC OCD platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_ocd.h
arch/x86/platform/intel-mid/device_libs/platform_msic_power_
btn.c | MSIC power btn platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_power_
btn.h
arch/x86/platform/intel-mid/device_libs/platform_msic_therma
l.c | msic_thermal platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_msic_therma
l.h
arch/x86/platform/intel-mid/device_libs/platform_pcal9555a.c
| pcal9555a platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_pcal9555a.h
arch/x86/platform/intel-mid/device_libs/platform_pmic_gpio.c
| PMIC GPIO platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_pmic_gpio.h
arch/x86/platform/intel-mid/device_libs/platform_scu_flis.c
| scu_flis platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_scu_flis.h
arch/x86/platform/intel-mid/device_libs/platform_sdio_regula

52

Kernel
tor.c | sdio regulator platform device initilization file
arch/x86/platform/intel-mid/device_libs/platform_soc_thermal
.c | Platform data for SoC DTS driver
arch/x86/platform/intel-mid/device_libs/platform_soc_thermal
.h
arch/x86/platform/intel-mid/device_libs/platform_spidev.c |
spidev platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_spidev.h
arch/x86/platform/intel-mid/device_libs/platform_tc35876x.c
| tc35876x platform data initilization file
arch/x86/platform/intel-mid/device_libs/platform_tc35876x.h
arch/x86/platform/intel-mid/device_libs/platform_tca6416.c |
tca6416 platform data initilization file

APIC
In computing, Intel's Advanced Programmable Interrupt Controller (APIC) is a
family of interrupt controllers. As its name suggests, the APIC is more
advanced than Intel's 8259 Programmable Interrupt Controller (PIC),
particularly enabling the construction of multiprocessor systems. It is one of
several architectural designs intended to solve interrupt routing efficiency
issues in multiprocessor computer systems. Wikipedia
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/io_apic.c

APB Timer

53

Kernel
Langwell is the south complex of Intel Moorestown MID platform. There are
eight external timers in total that can be used by the operating system. The
timer information, such as frequency and addresses, is provided to the OS via
SFI tables.
Timer interrupts are routed via FW/HW emulated IOAPIC independently via
individual redirection table entries (RTE). Unlike HPET, there is no master
counter, therefore one of the timers are used as clocksource. The overall
allocation looks like:
timer 0 - NR_CPUs for per cpu timer
one timer for clocksource
one timer for watchdog driver.
It is also worth notice that APB timer does not support true one-shot mode,
free-running mode will be used here to emulate one-shot mode. APB timer
can also be used as broadcast timer along with per cpu local APIC timer, but
by default APB timer has higher rating than local APIC timers.
arch/x86/kernel/apb_timer.c | Driver for Langwell APB timers

Power

54

Kernel

arch/x86/include/asm/mwait.h
+#ifdef CONFIG_ATOM_SOC_POWER
+#define MWAIT_MAX_NUM_CSTATES 10
+#else
+#define MWAIT_MAX_NUM_CSTATES 8
+#endif
arch/x86/include/asm/pmic_pdata.h
pmic_platform_data
#ifdef CONFIG_PMIC_CCSM
arch/x86/platform/intel-mid/device_libs/platform_mrfl_pmic.c
| latform data for Merrifield PMIC driver
#include <linux/sfi.h>
#include <linux/power/bq24261_charger.h>
arch/x86/platform/intel-mid/device_libs/platform_mrfl_pmic.h
| platform data for pmic driver
arch/x86/platform/intel-mid/device_libs/platform_mrfl_pmic_i
2c.c | Platform data for Merrifield PMIC I2C
arch/x86/platform/intel-mid/device_libs/platform_mrfl_pmic_i
2c.h
arch/x86/platform/intel-mid/device_libs/platform_mrfl_regula
tor.c

Debug
arch/x86/include/asm/intel_soc_debug.h

MIP
arch/x86/include/asm/intel_mip.h

SCU IPC

55

Kernel
The IPC is used to bridge the communications between kernel and SCU on
some embedded Intel x86 platforms.
Driver for the Intel SCU IPC mechanism
SCU runing in ARC processor communicates with other entity running in IA
core through IPC mechanism which in turn messaging between IA core ad
SCU. SCU has two IPC mechanism IPC-1 and IPC-2. IPC-1 is used between
IA32 and SCU where IPC-2 is used between P-Unit and SCU. This driver
delas with IPC-1 Driver provides an API for power control unit registers (e.g.
MSIC) along with other APIs.
obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o
arch/x86/Kconfig | Not Edison Patch
arch/x86/include/asm/intel_scu_ipc.h | Not Edison Patch
arch/x86/kernel/Makefile | Not Edison Patch
arch/x86/kernel/intel_scu_ipc.c | Not Edison Patch
arch/x86/include/asm/intel_scu_flis.h | SCU FLIS Interfaces
arch/x86/include/asm/intel_scu_ipc.h
arch/x86/include/asm/intel_scu_ipcutil.h
arch/x86/include/asm/intel_scu_pmic.h
arch/x86/include/asm/scu_ipc_rpmsg.h
arch/x86/platform/intel-mid/device_libs/platform_ipc.c | IPC
platform library file
arch/x86/platform/intel-mid/device_libs/platform_ipc.h
OSHOB-OS Handoff Buffer
OSNIB interface
scu_ipc_pmdb_buffer

Virtual Real Time Clock (VRTC)

56

Kernel
VRTC is emulated by system controller firmware, the real HW RTC is located
in the PMIC device. SCU FW shadows PMIC RTC in a memory mapped IO
space that is visible to the host IA processor. This driver is based on RTC
CMOS driver.
Moorestown platform doesn't have a m146818 RTC device like traditional x86
PC, but a firmware emulated virtual RTC device(vrtc), which provides some
basic RTC functions like get/set time. vrtc serves as the only wall clock device
on Moorestown platform.
Currently, vrtc init func will be called as arch_initcall() before xtime's init. Also
move the sfi vrtc table parsing from mrst.c to vrtc.c
There will be another general vrtc driver for rtc subsystem
arch/x86/include/asm/intel_mid_vrtc.h
obj-$(CONFIG_X86_MRST) += mrst.o vrtc.o
arch/x86/include/asm/fixmap.h
arch/x86/include/asm/vrtc.h
arch/x86/kernel/mrst.c
arch/x86/kernel/vrtc.c
arch/x86/platform/mrst/vrtc.c | Driver for virtual RTC devic
e on Intel MID platform

HSU
Intel Medfield platform has a high speed UART device, which could act as a
early console. To enable early printk of HSU console, simply add
"earlyprintk=hsu" in kernel command line. Currently we put the code in the
early_printk_mrst.c as it is also for Intel MID platforms like the mrst early
console

Upstream patch
arch/x86/include/asm/intel_mid_hsu.h
arch/x86/include/asm/mrst.h
arch/x86/kernel/early_printk.c

57

Kernel
arch/x86/kernel/early_printk_mrst.c
include/linux/platform_data/dma-hsu.h | Changes for High Speed UART DMA
drivers/dma/hsu/hsu.c
drivers/dma/hsu/pci.c
drivers/external_drivers/drivers/hsu/mfd_pci.c
It includes enums from:
hsu_port0
hsu_port1
hsu_port2
bt_port
modem_port
gps_port
debug_port
hsu_intel
hsu_dw
arch/x86/platform/intel-mid/device_libs/platform_hsu.c
arch/x86/platform/intel-mid/device_libs/platform_hsu.h
https://communities.intel.com/thread/75472
https://lkml.org/lkml/2010/9/13/33

Basin Cove GPADC


GPADC(General Purpose Analog Digital Converter)
config BASINCOVE_GPADC
depends on INTEL_SCU_IPC

Platform data for Merrifield Basincove GPADC driver


Intel Merrifield Basin Cove GPADC Driver
BASINCOVE GPADC driver for Intel Merrifield platform

58

Kernel

arch/x86/include/asm/intel_basincove_gpadc.h
arch/x86/platform/intel-mid/device_libs/platform_bcove_adc.c
arch/x86/platform/intel-mid/device_libs/platform_bcove_adc.h
drivers/iio/adc/iio_basincove_gpadc.c

Related
ACPI / PMIC: support PMIC operation region for CrystalCove
#define DRIVER_NAME "bcove_bcu"
#define DEVICE_NAME "mrfl_pmic_bcu"

arch/x86/include/asm/intel_basincove_gpadc.h
arch/x86/include/asm/intel_basincove_ocd.h

BlueTooth
Broadcom Bluetooth Low Power Mode
bcm_bt_lpm

arch/x86/include/asm/bcm_bt_lpm.h
drivers/misc/bcm-bt-lpm.c
arch/x86/platform/intel-mid/device_libs/platform_btlpm.c | b
tlpm platform data initialization file
Bluetooth is using UART port number 0
.name = "bcm_bt_lpm",
device_initcall(bluetooth_init);

GPIO
arch/x86/include/asm/gpio.h

GPIO Keys
59

Kernel
We will search these buttons in SFI GPIO table (by name) and register them
dynamically. Please add all possible buttons here, we will shrink them if no
GPIO found.
arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c
late_initcall(pb_keys_init);
arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.h

I2C
arch/x86/platform/intel-mid/device_libs/platform_dw_i2c.c |
I2C platform data initilization file

SFI
config CONFIG_SFI

Multi-Function Device (MFD) for Low Power


Subsystem
System Management Bus (SMBus)

60

Kernel

Building
Yocto Project Linux Kernel Development Manual
Creating a Custom Linux Kernel for the Edison
How to compile Intel Edison Linux Kernel
01 Org Intel Edison Linux Kernel
edison-3.19.5
edison-3.10.98
edison-3.10.17
meta-intel-edison-bsp/recipes-kernel/linux/linux-externalsrc.bb log
meta-intel-edison-bsp/recipes-kernel/linux/linux-externalsrc.bb log

Building via Make Detailed


user@host:~$ ls
bbcache flash.log Makefile meta-arduino meta-intel-ediso
n out pub

user@host:~$ cd out/current
user@host:~$ ls
build poky

61

Kernel

user@host:~$ source poky/oe-init-build-env


### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
core-image-minimal
core-image-sato
meta-toolchain
adt-installer
meta-ide-support
You can also run generated qemu images with a command like '
runqemu qemux86'

Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget https://raw.githubusercontent.com/ikcaro/T
heIoTLearningInitiative/master/EmbeddedLinux/paho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

user@host:~$ bitbake virtual/kernel -c menuconfig


user@host:~$ bitbake virtual/kernel -c configure -f -v
user@host:~$ bitbake edison-image

Building via Make

62

Kernel

user@host:~$ pwd
/home/xe1gyq/.../edison-src
user@host:~$ cd out/current
user@host:~$ source poky/oe-init-build-env
user@host:~$ bitbake virtual/kernel -c menuconfig
...
edison-src/out/linux64/build/tmp/work/edison-poky-linux/linu
x-yocto/3.10.17-r0/linux-edison-standard-build/Makefile
...
user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/defconfig
user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/linux/arch/x86/configs/i386_edison_d
efconfig
user@host:~$ bitbake virtual/kernel -c configure -f -v
user@host:~$ cd ../../..

Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget http://git.yoctoproject.org/cgit/cgit.cgi/
meta-intel-iot-middleware/plain/recipes-connectivity/paho-mqtt/p
aho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

user@host:~$ make image


user@host:~$ make flash
edison-src/out/linux64/build/tmp/work/edison-poky-linux/linu
x-yocto/3.10.17-r0/linux-edison-standard-build/Makefile

63

Kernel

Building via BitBake


user@host:~$ pwd
/home/xe1gyq/.../edison-src
user@host:~$ cd out/current
user@host:~$ source poky/oe-init-build-env
user@host:~$ bitbake virtual/kernel -c menuconfig
...
edison-src/out/linux64/build/tmp/work/edison-poky-linux/linu
x-yocto/3.10.17-r0/linux-edison-standard-build/Makefile
...
user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/defconfig
user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/linux/arch/x86/configs/i386_edison_d
efconfig
user@host:~$ bitbake virtual/kernel -c configure -f -v
user@host:~$ bitbake edison-image

64

Kernel

Headers
The linux kernel's exported header files describe the API for user space
programs attempting to use kernel services. These kernel header files are
used by the system's C library (such as glibc or uClibc) to define available
system calls, as well as constants and structures to be used with these
system calls.
Exporting kernel headers for use by userspace
Kernel Headers Package in Yocto Environment

Headers Creation
ToDo Create instructions

65

Modules

Modules
A loadable kernel module (LKM) is a mechanism for adding code to, or
removing code from, the Linux kernel at run time. They are ideal for device
drivers, enabling the kernel to communicate with the hardware without it
having to know how the hardware. DerekMolloy
In computing, a loadable kernel module (or LKM) is an object file that contains
code to extend the running kernel, or so-called base kernel, of an operating
system. LKMs are typically used to add support for new hardware (as device
drivers) and/or filesystems, or for adding system calls. When the functionality
provided by a LKM is no longer required, it can be unloaded in order to free
memory and other resources. Wikipedia
Compiling drivers for Poky 3.10.17-poky-edison+ directly on EDISON (in 10
steps :))
*Note: the link to the headers at the post above is no longer active, but
you can find the headers here:
https://github.com/SourceCodeCat/IoTDownloads
Getting Started with the Edi-Expand

66

Modules

Cross Compilation
Fix Paho-Mqtt
Problems compiling edison-src-ww25.5-15 using bitbake
Thanks for the fix Angel Prez @ Github ikcaro
user@host:~$ wget https://raw.githubusercontent.com/ikcaro/T
heIoTLearningInitiative/master/EmbeddedLinux/paho-mqtt_3.1.bb
user@host:~$ mv paho-mqtt_3.1.bb file/to/paho-mqtt_3.1.bb

Hello World Kernel Module Cross


Compilation
user@host:~$ pwd
/home/xe1gyq/.../edison-src
user@host:~$ cd out/current
user@host:~$ source poky/oe-init-build-env
user@host:~$ pwd
/home/xe1gyq/Projects/edison-src/out/linux64/build
user@host:~$ cd tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux/
user@host:~$ mkdir drivers/helloworld
user@host:~$ nano drivers/helloworld/helloworld.c

67

Modules

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
static int module_init_function(void)
{
printk(KERN_INFO "Module? Hello!\n");
return 0;
}
static void module_exit_function(void)
{
printk(KERN_INFO "Module? Bye!\n");
}
MODULE_LICENSE("GPL");
MODULE_AUTHOR("xe1gyq");
MODULE_DESCRIPTION("My First Linux Kernel Module");
module_init(module_init_function);
module_exit(module_exit_function);

user@host:~$ nano drivers/helloworld/Kconfig

menu "Hello Module Kernel Support"


config HELLO_WORLD
tristate "Hello Module Driver"
depends on X86
help
Select this option to run a Hello World Module!
endmenu

user@host:~$ nano drivers/helloworld/Makefile

obj-$(CONFIG_HELLO_WORLD) += helloworld.o

68

Modules

user@host:~$ nano drivers/Kconfig

menu "Device Drivers"


source "drivers/helloworld/Kconfig"
source "drivers/base/Kconfig"
...

user@host:~$ nano drivers/Makefile

...
# Rewritten to use lists instead of if-statements.
#
obj-$(CONFIG_HELLO_WORLD) += helloworld/
obj-y += irqchip/
...

user@host:~$ cd user@host:~$ bitbake virtual/kernel -c menuconfig


...
edison-src/out/linux64/build/tmp/work/edison-poky-linux/linu
x-yocto/3.10.17-r0/linux-edison-standard-build/Makefile
...

CONFIG_LOCALVERSION
Symbol: LOCALVERSION [=-yocto-xe1gyq]
Type : string
Prompt: Local version - append to kernel release
Location:
-> General setup
Defined at init/Kconfig:56

69

Modules

CONFIG_HELLO_WORLD:
Select this option to run a Hello World Module!
Symbol: HELLO_WORLD [=y]
Type : tristate
Prompt: Hello Module Driver
Location:
-> Device Drivers
-> Hello Module Kernel Support
Defined at drivers/helloworld/Kconfig:3
Depends on: X86 [=y]

user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/defconfig
user@host:~$ cp tmp/work/edison-poky-linux/linux-yocto/3.10.
17-r0/linux-edison-standard-build/.config tmp/work/edison-poky-l
inux/linux-yocto/3.10.17-r0/linux/arch/x86/configs/i386_edison_d
efconfig
user@host:~$ bitbake virtual/kernel -c configure -f -v
user@host:~$ cd ../../..
user@host:~$ make image
user@host:~$ make flash

70

Modules

Native
Project: Hello World Kernel Module Native
Compilation
Kernel Headers Setup
root@edison:~# cd
root@edison:~# wget https://github.com/SourceCodeCat/IoTDownload
s/raw/master/linux-headers-3.10.17-poky-edison_3.10.17-poky-edis
on-1_i386.deb
root@edison:~# ar x linux-headers-3.10.17-poky-edison_3.10.17-po
ky-edison-1_i386.deb

root@edison:~# ls data.tar.gz
data.tar.gz

root@edison:~# tar -xvf data.tar.gz


...
./usr/src/linux-headers-3.10.17-poky-edison/drivers/iio/freq
uency/Makefile
./usr/src/linux-headers-3.10.17-poky-edison/drivers/iio/freq
uency/Kconfig
./lib/
./lib/modules/
./lib/modules/3.10.17-poky-edison/
./lib/modules/3.10.17-poky-edison/build

71

Modules

root@edison:~# uname -a
Linux edison 3.10.98-poky-edison+ #1 SMP PREEMPT Mon Jun 6 14:32
:08 PDT 2016 i6x
root@edison:~#

Version 3.10.98-poky-edison+
root@edison:~# cd ~/usr/src/
root@edison:~# ln -s linux-headers-3.10.17-poky-edison linux-hea
ders-3.10.98-poky-edison
root@edison:~/usr/src# ls ~/usr/src/

linux-headers-3.10.17-poky-edison linux-headers-3.10.98-poky-ed
ison

root@edison:~# nano ~/usr/src/linux-headers-3.10.98-poky-edi


son/include/generated/utsrelease.h
#define UTS_RELEASE "3.10.98-poky-edison+"
<Save Changes>

root@edison:~# cd /lib/modules/3.10.98-poky-edison+

root@edison:/lib/modules/3.10.98-poky-edison+# ls
extra modules.builtin.bin modules.softdep
kernel modules.dep modules.symbols
modules.alias modules.dep.bin modules.symbols.bi
n
modules.alias.bin modules.devname
modules.builtin modules.order

root@edison:/lib/modules/3.10.98-poky-edison+# ln -s /home/r
oot/usr/src/linux-headers-3.10.98-poky-edison build

72

Modules

root@edison:/lib/modules/3.10.98-poky-edison+# cd
root@edison:~#

Version 3.10.17-poky-edison+
root@edison:~# nano ~/usr/src/linux-headers-3.10.17-poky-edi
son/include/generated/utsrelease.h
#define UTS_RELEASE "3.10.17-poky-edison+"
<Save Changes>

root@edison:~# cd /lib/modules/3.10.17-poky-edison+

root@edison:/lib/modules/3.10.17-poky-edison+# ls
extra modules.builtin.bin modules.softdep
kernel modules.dep modules.symbols
modules.alias modules.dep.bin modules.symbols.bi
n
modules.alias.bin modules.devname
modules.builtin modules.order

root@edison:/lib/modules/3.10.17-poky-edison+# ln -s /home/r
oot/usr/src/linux-headers-3.10.17-poky-edison build

root@edison:/lib/modules/3.10.17-poky-edison+# cd
root@edison:~#

Kernel Module Compilation


root@edison:~# mkdir kernelmodule
root@edison:~# cd kernelmodule/
root@edison:~/kernelmodule# nano helloworld.c

73

Modules

#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
static int module_init_function(void)
{
printk(KERN_INFO "Module? Hello!\n");
return 0;
}
static void module_exit_function(void)
{
printk(KERN_INFO "Module? Bye!\n");
}
MODULE_LICENSE("GPL");
MODULE_AUTHOR("xe1gyq");
MODULE_DESCRIPTION("My First Linux Kernel Module");
module_init(module_init_function);
module_exit(module_exit_function);

root@edison:~/kernelmodule# nano Makefile

obj-m += helloworld.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

74

Modules

root@edison:~/kernelmodule# make
make -C /lib/modules/3.10.17-poky-edison+/build M=/home/root
/kernelmodule modules
make[1]: Entering directory '/home/root/usr/src/linux-header
s-3.10.17-poky-edison'
CC [M] /home/root/kernelmodule/helloworld.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/root/kernelmodule/helloworld.mod.o
LD [M] /home/root/kernelmodule/helloworld.ko
make[1]: Leaving directory '/home/root/usr/src/linux-headers
-3.10.17-poky-edison'

root@edison:~/kernelmodule# dmesg
...
[ 20.395746] ip (334) used greatest stack depth: 5208 byte
s left
root@edison:~/kernelmodule# insmod helloworld.ko
root@edison:~/kernelmodule# dmesg
...
[ 20.395746] ip (334) used greatest stack depth: 5208 byte
s left
[26227.828425] Module? Hello!

root@edison:~/kernelmodule# rmmod helloworld.ko


root@edison:~/kernelmodule# dmesg
...
[ 21.122640] snd_intel_sst: runtime_suspend called
[96175.271153] Module? He
llo!
[96185.098677] Module? Bye!

Project: Hello World Kernel Module Native


Compilation Automatic Startup
ToDo
75

Modules

76

Filesystem

Filesystem
Changing partition setup on Edison
Increasing the Root Partition Size

File System Disk Space Customization


Under the host
user@host:~$ nano edison-src/device-software/meta-edison-dis
tro/recipes-bsp/u-boot/files/edison.env
user@host:~$ nano edison-src/device-software/meta-edison/rec
ipes-bsp/u-boot/files/edison.env
user@host:~$ nano edison-src/meta-intel-edison/meta-intel-ed
ison-bsp/recipes-bsp/u-boot/files/edison.env
Rootfs size from 512MB to 1312MB
user@host:~$ nano edison-src/meta-intel-edison/meta-intel-ed
ison-distro/recipes-core/images/edison-image.bb
rootfs 1312MB
user@host:~$ /device-software/utils/flash/postBuild.sh
user@host:~# apt-get install dfu-util
user@host:~$ /build/toFlash/flashall.sh --recovery
user@host:~$ /build/toFlash/flashall.sh
user@host:~# screen /dev/ttyUSBX 115200

77

Flashing

Flashing
Intel Edison Board Software Downloads
Flashing the firmware on a system with Windows (manual process)

Board Support Package Update in a


Nutshell
Intel Edison
Download drivers, installers, new firmware images, IDEs and components like
cloud analytics and gateway software.
Intel Edison Board Software Downloads
Latest Release 3.0 Yocto Complete Image iot-devkit-prof-dev-image-edison20160315.zip
Intel Edison Board Software Release 3.0 Release Notes
xe1gyq@jessie:~/Downloads/edison/20160606$ unzip iot-devkit-prof
-dev-image-edison-20160606.zip
Archive: iot-devkit-prof-dev-image-edison-20160606.zip
inflating: edison_dnx_fwr.bin
inflating: edison_dnx_osr.bin
inflating: edison_ifwi-dbg-00.bin
inflating: edison_ifwi-dbg-00-dfu.bin
inflating: edison_ifwi-dbg-01.bin
inflating: edison_ifwi-dbg-01-dfu.bin
inflating: edison_ifwi-dbg-02.bin
inflating: edison_ifwi-dbg-02-dfu.bin
inflating: edison_ifwi-dbg-03.bin
inflating: edison_ifwi-dbg-03-dfu.bin
inflating: edison_ifwi-dbg-04.bin
inflating: edison_ifwi-dbg-04-dfu.bin
inflating: edison_ifwi-dbg-05.bin
inflating: edison_ifwi-dbg-05-dfu.bin

78

Flashing
inflating: edison_ifwi-dbg-06.bin
inflating: edison_ifwi-dbg-06-dfu.bin
inflating: edison-image-edison.ext4
inflating: edison-image-edison.hddimg
inflating: filter-dfu-out.js
inflating: flashall.bat
inflating: flashall.sh
inflating: FlashEdison.json
creating: helper/
inflating: helper/helper.html
creating: helper/images/
inflating: helper/images/Edison-arduino-blink-led.png
inflating: helper/images/Edison-arduino.png
inflating: helper/images/Edison-breakout-board.png
inflating: ota_update.scr
inflating: package-list.txt
inflating: u-boot-edison.bin
inflating: u-boot-edison.img
creating: u-boot-envs/
inflating: u-boot-envs/edison-prod.bin
inflating: u-boot-envs/edison-blankrndis.bin
inflating: u-boot-envs/edison-blankcdc.bin
inflating: u-boot-envs/edison-ifwi.bin
xe1gyq@jessie:~/Downloads/edison/20160606$

xe1gyq@jessie:~/Downloads/latestedison$ unzip iot-devkit-prof-de


v-image-edison-20160315.zip
Archive: iot-devkit-prof-dev-image-edison-20160315.zip
inflating: edison_dnx_fwr.bin
inflating: edison_dnx_osr.bin
inflating: edison_ifwi-dbg-00.bin
inflating: edison_ifwi-dbg-00-dfu.bin
inflating: edison_ifwi-dbg-01.bin
inflating: edison_ifwi-dbg-01-dfu.bin
inflating: edison_ifwi-dbg-02.bin
inflating: edison_ifwi-dbg-02-dfu.bin
inflating: edison_ifwi-dbg-03.bin
inflating: edison_ifwi-dbg-03-dfu.bin
inflating: edison_ifwi-dbg-04.bin

79

Flashing
inflating: edison_ifwi-dbg-04-dfu.bin
inflating: edison_ifwi-dbg-05.bin
inflating: edison_ifwi-dbg-05-dfu.bin
inflating: edison_ifwi-dbg-06.bin
inflating: edison_ifwi-dbg-06-dfu.bin
inflating: edison-image-edison.ext4
inflating: edison-image-edison.hddimg
inflating: edison-image-edison.manifest
inflating: filter-dfu-out.js
inflating: flashall.bat
inflating: flashall.sh
inflating: FlashEdison.json
creating: helper/
inflating: helper/helper.html
creating: helper/images/
inflating: helper/images/Edison-arduino.png
inflating: helper/images/Edison-arduino-blink-led.png
inflating: helper/images/Edison-breakout-board.png
inflating: ota_update.scr
inflating: package-list.txt
inflating: u-boot-edison.bin
inflating: u-boot-edison.img
creating: u-boot-envs/
inflating: u-boot-envs/edison-ifwi.bin
inflating: u-boot-envs/edison-blankcdc.bin
inflating: u-boot-envs/edison-prod.bin
inflating: u-boot-envs/edison-blankrndis.bin

The flashing process is in your Host Computer:


Download the Latest Release Yocto Complete Image
Unzip its content
Within the terminal, go to the directory where the content has been unzipped
And flash the image with flashall.[sh/bat] script

Windows based Development Workstation

80

Flashing

C:\Users\aarcemor\Downloads\edison-image-ww25.5-15>flashall.
bat

Linux based Development Workstation


user@host:~$ flashall.sh

It the Edison, connect both USB cables and wait for flashall.[sh/bat] script to start
the flashing process
xe1gyq@jessie:~/Downloads/latestedison$ ./flashall.sh
Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
Download [=========================] 100% 4194304 bytes
Download [=========================] 100% 4194304 bytes
Flashing U-Boot
Download [=========================] 100% 237568 bytes
Flashing U-Boot Environment
Download [=========================] 100% 65536 bytes
Flashing U-Boot Environment Backup
Download [=========================] 100% 65536 bytes
Rebooting to apply partition changes
Now waiting for dfu device 8087:0a99
Flashing boot partition (kernel)
Download [=========================] 100% 6127616 bytes
Flashing rootfs, (it can take up to 5 minutes... Please be patie
nt)
Download [=========================] 100% 1302792192 bytes
Rebooting
U-boot & Kernel System Flash Success...
Your board needs to reboot to complete the flashing procedure, p
lease do not unplug it for 2 minutes.

81

Flashing
Finally, connect Intel Edison to your Development Workstation using the
registered COM / TTY device

82

Ubilinux

Ubilinux, Debian Based Distribution


ubilinux is an embedded Linux distribution from Emutex and is based on
Debian "Wheezy". It is targeted at embedded devices that have limited
memory and storage capabilities.
Emutexlabs ubilinux
New ubilinux for Intel Edison released
ubilinux (Debian) Kernel Update R2 BETA
Installing ROS on Galileo: The Debian way
Setup new Intel Edison gateway

Installation
Emutexlabs ubilinux installation instructions for Intel Edison
Cast #21: Installing Ubilinux on the Edison (Windows)
Sparkfun Loading Debian (Ubilinux) on the Edison

Compilation
Mr. Smirnov Intel Edison - Building Debian image
Hackgnar Building Debian Linux for Intel Edison

Programs
Prepare the Edison for OpenAPS
root@ubilinux:~# apt-get install systemd

83

CentOS

CentOS
A Flashable CentOS Image for the Intel Edison

84

Kali

Kali
Building Kali Linux for Intel Edison

85

Google Brillo

Brillo
Google Brillo for Intel Edison

86

Ostro

Ostro
Welcome to the Ostro Project! It is an open source developed, Linux*based operating system tailored for IoT smart devices and built with security
in mind. With Ostro OS you won't need to force-fit a general Linux OS to suit
your IoT device or write your own OS. Homepage

87

U-Boot

U-Boot
Das U-Boot (Universal Bootloader) is an open source, primary boot loader
used in embedded devices to package the instructions to boot the device's
operating system kernel. It is available for a number of computer
architectures, including 68k, ARM, AVR32, Blackfin, MicroBlaze, MIPS, Nios,
SuperH, PPC and x86.- Wikipedia

Host Computer / Board Connection


Connect Intel Edison to your Host Computer using the registered COM / TTY
device and launch your serial interface, e.g. Linux
In Linux
$ dmesg
[11940.538090] ftdi_sio 6-1:1.0: FTDI USB Serial Device conv
erter detected
[11940.538137] usb 6-1: Detected FT232RL
[11940.538139] usb 6-1: Number of endpoints 2
[11940.538142] usb 6-1: Endpoint 1 MaxPacketSize 64
[11940.538144] usb 6-1: Endpoint 2 MaxPacketSize 64
[11940.538147] usb 6-1: Setting MaxPacketSize 64
[11940.540185] usb 6-1: FTDI USB Serial Device converter now
attached to ttyUSB0
$ sudo minicom -D /dev/ttyUSB0 115200

Bootup Cancel
******************************

PSH KERNEL VERSION: b0182b2b

WR: 20104000

88

U-Boot

******************************

SCU IPC: 0x800000d0 0xfffce92c

PSH miaHOB version: TNG.B0.VVBD.0000000c

microkernel built 11:24:08 Feb 5 2015

******* PSH loader *******

PCM page cache size = 192 KB

Cache Constraint = 0 Pages

Arming IPC driver ..

Adding page store pool ..

PagestoreAddr(IMR Start Address) = 0x04899000

pageStoreSize(IMR Size) = 0x00080000

*** Ready to receive application ***

U-Boot 2014.04 (Jun 06 2016 - 14:40:07)



Watchdog enabled

DRAM: 980.6 MiB

MMC: tangier_sdhci: 0

89

U-Boot

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 1
boot >

U-Boot Commands from U-Boot


help
boot > help
? - alias for 'help'
askenv - get environment variables from stdin
base - print or set address offset
bdinfo - print Board Info structure
...
true - do nothing, successfully
version - print monitor, compiler and linker version
zboot - Boot bzImage
boot >

printenv
boot > printenv
audio_codec_name=audio_codec="dummy"
boot_target_cmd=run do_flash_os;run do_probe_dfu;run do_compute_
target;run mmc-bootargs;run load_kernel;zboot ${loadaddr}
bootargs_console=console=ttyMFD2 earlyprintk=ttyMFD2,keep
bootargs_debug=loglevel=4
bootargs_ethconfig=cdc
bootargs_target=multi-user

90

U-Boot
bootcmd=echo "Target:${target_name}"; run do_partition; run do_h
andle_bootargs_mode;
bootdelay=1
dfu_alt_info_ram=kernel ram ${loadaddr} 0x800000
dfu_alt_info_reset=reset ram 0x0 0x0
dfu_to_sec=3
do_audio_support=setenv audio_support platform_mrfld_audio.${aud
io_codec_name}
do_boot=run boot_target_cmd;
do_bootargs_rootfs=setenv bootargs_rootfs rootwait root=PARTUUID=
${uuid_rootfs} rootfstype=ext4
do_compute_target=if itest.b ${first_install_retry} -gt ${first_
install_max_retries} || itest.b ${ota_update_retry} -gt $i
do_dfu_alt_info_ifwi=setenv dfu_alt_info "ifwi${hardware_id} mmc
0 8192 mmcpart 1;ifwib${hardware_id} mmc 0 8192 mmcpart "
do_dfu_alt_info_mmc=setenv dfu_alt_info "ifwi${hardware_id} mmc
0 8192 mmcpart 1;ifwib${hardware_id} mmc 0 8192 mmcpart 2"
do_dnx=setenv dfu_alt_info ${dfu_alt_info_ram};dfu 0 ram 0 ram;r
un bootcmd
do_fallback=echo "Unknown boot mode: $bootargs_mode"; env delete
-f bootargs_mode; saveenv; echo "Resetting to default bo;
do_flash=run do_force_flash_os;
do_flash_ifwi=run do_dfu_alt_info_ifwi ; dfu 0 mmc 0
do_flash_os=if itest.b ${do_flash_os_done} -eq 1 ; then echo "Fl
ashing already done..." ; else run do_force_flash_os; fi
do_flash_os_done=1
do_flashall=run do_partition;run do_flash_ifwi;run do_flash_os
do_force_flash_os=run do_dfu_alt_info_mmc ; sleep 1 ; setenv do_
flash_os_done 1 ; saveenv ; dfu 0 mmc 0
do_force_partition=echo "Partitioning using GPT"; gpt write mmc
0 ${partitions} ; mmc rescan; setenv do_partition_done 1 v
do_handle_bootargs_mode=run do_preprocess_bootargs_mode; if ites
t.s $bootargs_mode == "ota" ; then run do_ota; fi; if ite;
do_load_ota_scr=if fatload mmc 0:9 $ota_script_addr ota_update.s
cr ; then setenv ota_status 0 ; else setenv ota_status 1 i
do_ota=run do_ota_init ; run do_load_ota_scr ; run do_source_ota
_scr ; run do_ota_clean
do_ota_clean=saveenv ; reset
do_ota_init=setenv ota_status 1 ; env delete -f bootargs_mode
do_partition=if itest.b ${do_partition_done} -eq 1; then echo "P

91

U-Boot
artitioning already done..."; else run do_force_partitioni
do_partition_done=1
do_preprocess_bootargs_mode=if env exists bootargs_mode ; then ;
else setenv bootargs_mode "boot" ;fi;
do_probe_dfu=run do_dfu_alt_info_mmc ; dfu 0 mmc 0 $dfu_to_sec
do_source_ota_scr=if test $ota_status -eq 0 ; then if source $ot
a_script_addr ; then setenv ota_status 0 ; else setenv oti
first_install_max_retries=3
first_install_retry=0
hardware_id=00
init_dfu=run do_dfu_alt_info_mmc ; saveenv
load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz
loadaddr=0x100000
mmc-bootargs=run do_bootargs_rootfs; run do_audio_support; seten
v bootargs ${bootargs_rootfs} ${bootargs_console} ${boota}
ota_done=0
ota_script_addr=0x100000
ota_update_max_retries=3
ota_update_retry=0
partitions=uuid_disk=${uuid_disk};name=u-boot0,start=1MiB,size=2
MiB,uuid=${uuid_uboot0};name=u-boot-env0,size=1MiB,uuid=$;
serial#=4d143757d2d7fce20e89640fee58c2af
stderr=serial
stdin=serial
stdout=serial
target_name=blank
usb0addr=02:00:86:58:c2:af
uuid_boot=db88503d-34a5-3e41-836d-c757cb682814
uuid_disk=21200400-0804-0146-9dcc-a8c51255994f
uuid_factory=333a128e-d3e3-b94d-92f4-d3ebd9b3224f
uuid_home=f13a0978-b1b5-1a4e-8821-39438e24b627
uuid_panic=f20aa902-1c5d-294a-9177-97a513e3cae4
uuid_rootfs=012b3303-34ac-284d-99b4-34e03a2335f4
uuid_uboot0=d117f98e-6f2c-d04b-a5b2-331a19f91cb2
uuid_uboot1=8a4bb8b4-e304-ae48-8536-aff5c9c495b1
uuid_uboot_env0=25718777-d0ad-7443-9e60-02cb591c9737
uuid_uboot_env1=08992135-13c6-084b-9322-3391ff571e19
uuid_update=faec2ecf-8544-e241-b19d-757e796da607
Environment size: 4962/65531 bytes

92

U-Boot
boot >

Bootup Kernel
U-Boot 2014.04 (Jun 06 2016 - 14:40:07)

Watchdog enabled

DRAM: 980.6 MiB

MMC: tangier_sdhci: 0

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0

Target:blank

Partitioning already done...

Flashing already done...

GADGET DRIVER: usb_dnl_dfu

reading vmlinuz

5461344 bytes read in 134 ms (38.9 MiB/s)

Valid Boot Flag

Setup Size = 0x00003c00

93

U-Boot
Magic signature found

Using boot protocol version 2.0c

Linux kernel version 3.10.98-poky-edison+ (neck@flax) #1 SMP PRE
EMPT Mon Jun 6 6
Building boot_params at 0x00090000

Loading bzImage at address 00100000 (5445984 bytes)

Magic signature found

Kernel command line: "rootwait root=PARTUUID=012b3303-34ac-284d99b4-34e03a2335"
Starting kernel ...

[ 1.603619] snd_soc_sst_platform: Enter:sst_soc_probe

[ 2.087155] pmic_ccsm pmic_ccsm: Error reading battery profil
e from battid fk
[ 2.096126] pmic_ccsm pmic_ccsm: Battery Over heat exception

[ 2.096208] pmic_ccsm pmic_ccsm: Battery0 temperature inside
boundary
Welcome to Linux!

[ 2.771628] systemd[1]: [/lib/systemd/system/wyliodrin-server
.service:3] Fait
Expecting device dev-ttyMFD2.device.../wyliodrin-hyperv
isor.service:3]t
[ OK ] Reached target Remote File Systems.

Expecting device dev-disk-by\x2dpartlabel-factory.devic
e...
Expecting device sys-subsystem-net-devices-usb0.device.
..

94

U-Boot
[ OK ] Reached target Paths.

[ OK ] Reached target Swap.

[ OK ] Set up automount boot.automount.

[ OK ] Created slice Root Slice.

[ OK ] Created slice User and Session Slice.

[ OK ] Listening on Delayed Shutdown Socket.

[ OK ] Listening on /dev/initctl Compatibility Named Pipe.

[ OK ] Listening on udev Control Socket.

[ OK ] Listening on udev Kernel Socket.

[ OK ] Listening on Journal Socket.

[ OK ] Created slice System Slice.

Mounting Temporary Directory...

[ OK ] Created slice system-serial\x2dgetty.slice.

[ OK ] Created slice system-getty.slice.

Starting Create list of required static device nodes...
rrent kernel...
Starting udev Coldplug all Devices...

Starting Load Kernel Modules...

Mounting Debug File System...

Mounting POSIX Message Queue File System...

Starting Apply Kernel Variables...

95

U-Boot
Starting Journal Service...

[ OK ] Started Journal Service.

[ OK ] Reached target Slices.

Starting Remount Root and Kernel File Systems...

[ OK ] Set up automount home.automount.

[ OK ] Mounted POSIX Message Queue File System.

[ OK ] Mounted Debug File System.

[ OK ] Mounted Temporary Directory.

[ OK ] Started Create list of required static device nodes ...
current kernel.
[ OK ] Started Apply Kernel Variables.

[ OK ] Started Remount Root and Kernel File Systems.

[ OK ] Started udev Coldplug all Devices.

[ OK ] Started Load Kernel Modules.

Mounting Configuration File System...

Mounting FUSE Control File System...

Starting Load/Save Random Seed...

Starting Create Static Device Nodes in /dev...

[ OK ] Mounted FUSE Control File System.

[ OK ] Mounted Configuration File System.

[ OK ] Started Load/Save Random Seed.

96

U-Boot
[ OK ] Started Create Static Device Nodes in /dev.

Starting udev Kernel Device Manager...

[ OK ] Reached target Local File Systems (Pre).

Mounting /var/volatile...

[ OK ] Started udev Kernel Device Manager.

[ OK ] Mounted /var/volatile.

[ OK ] Reached target Local File Systems.

Starting Trigger Flushing of Journal to Persistent Stor
age...
Starting Create Volatile Files and Directories...

[ OK ] Started Create Volatile Files and Directories.

[ OK ] Started Trigger Flushing of Journal to Persistent Stora
ge.
Starting Network Time Synchronization...

Starting Update UTMP about System Boot/Shutdown...

[ OK ] Found device /dev/ttyMFD2.

[ OK ] Started Network Time Synchronization.

[ OK ] Found device /dev/disk/by-partlabel/factory.

[ OK ] Started Update UTMP about System Boot/Shutdown.

[ OK ] Created slice system-systemd\x2drfkill.slice.

Starting Load/Save RF Kill Switch Status of rfkill0...

Starting Load/Save RF Kill Switch Status of rfkill1...

97

U-Boot
Mounting Mount for factory...

[ OK ] Started Load/Save RF Kill Switch Status of rfkill0.

[ OK ] Started Load/Save RF Kill Switch Status of rfkill1.

[ OK ] Mounted Mount for factory.

[ OK ] Reached target Sound Card.

[ OK ] Reached target System Initialization.

[ OK ] Listening on RPCbind Server Activation Socket.

[ OK ] Listening on D-Bus System Message Bus Socket.

[ OK ] Reached target Timers.

Starting Restore Sound Card State...

Starting Console System Startup Logging...

[ OK ] Started Console System Startup Logging.

[ OK ] Found device /sys/subsystem/net/devices/usb0.

[ OK ] Created slice system-systemd\x2dfsck.slice.

Starting File System Check on /dev/disk/by-partlabel/ho
me...
Starting Load/Save RF Kill Switch Status of rfkill2...

[ OK ] Listening on sshd.socket.

[ OK ] Started Load/Save RF Kill Switch Status of rfkill2.

[ 7.892042] systemd-fsck[182]: /dev/mmcblk0p10: clean, 15/871
20 files, 14184s
[ OK ] Reached target Sockets.

98

U-Boot
[ OK ] Reached target Basic System.

Starting Edison PWR button handler...

[ OK ] Started Edison PWR button handler.

Starting Edison sketch check service...

[ OK ] Started Edison sketch check service.

Starting Daemon to load edison mcu app binary...

[ OK ] Started Daemon to load edison mcu app binary.

Starting Telephony service...

Application available at (physical) address 0x04819000

VRL mapped to 0xff217000

App size = 11508 bytes

App Authentication feature is disabled!

Resetting IPC

*** Ready to receive application ***

Starting OpenSSH Key Generation...

Starting Start or stop WiFI AP Mode in Edison...

[ OK ] Started Start or stop WiFI AP Mode in Edison.

Starting Wyliodrin hypervisor...

Starting Bluetooth rf kill event daemon...

99

U-Boot
[ OK ] Started Bluetooth rf kill event daemon.

Starting Daemon to handle arduino sketches...

[ OK ] Started Daemon to handle arduino sketches.

Starting Daemon to reset sketches...

[ OK ] Started Daemon to reset sketches.

Starting Wyliodrin server...

Starting Login Service...

Starting D-Bus System Message Bus...

[ OK ] Started D-Bus System Message Bus.

[ OK ] Started Telephony service.

Starting Network Service...

Starting Watchdog sample daemon...

[ OK ] Started Watchdog sample daemon.

Starting Crashlog service...

[ OK ] Started Crashlog service.

Starting Cleanjournal service...

[ OK ] Started Cleanjournal service.

Starting Permit User Sessions...

[ OK ] Started Network Service.

[ OK ] Started File System Check on /dev/disk/by-partlabel/hom
e.

100

U-Boot
[ OK ] Started OpenSSH Key Generation.

[ OK ] Started Permit User Sessions.

[ OK ] Started Login Service.

Starting Bluetooth service...

Starting Serial Getty on ttyMFD2...

[ OK ] Started Serial Getty on ttyMFD2.

Starting Getty on tty1...

[ OK ] Started Getty on tty1.

[ OK ] Reached target Login Prompts.

Mounting /home...

[ OK ] Reached target Network.

Starting Mosquitto - lightweight server implementati...
SN protocols...
Starting Zero-configuration networking...

Starting Network Name Resolution...

[ OK ] Mounted /home.

[ OK ] Started Mosquitto - lightweight server implementatio...
T-SN protocols.
[ OK ] Started Network Name Resolution.

[ OK ] Started Zero-configuration networking.

[ OK ] Started Bluetooth service.

[ OK ] Started Restore Sound Card State.

101

U-Boot
Starting PulseAudio Sound System...

Starting Hostname Service...

Starting The Edison status and configuration service...

[ OK ] Started The Edison status and configuration service.

Starting Intel_XDK_Daemon...

[ OK ] Started Intel_XDK_Daemon.

[ OK ] Started Hostname Service.

[ OK ] Created slice user-0.slice.

Starting User Manager for UID 0...

[ OK ] Started User Manager for UID 0.

[ OK ] Started Wyliodrin hypervisor.

[ OK ] Started PulseAudio Sound System.

[ OK ] Started Wyliodrin server.

[ OK ] Reached target Multi-User System.

Starting Redis Server...

[ OK ] Started Redis Server.

Poky (Yocto Project Reference Distro) 1.7.3 edison ttyMFD2

edison login:

102

U-Boot

U-Boot Commands from Linux


root@edison:~# fw_
fw_printenv fw_setenv
root@edison:~#

root@edison:~# fw_printenv
...
uuid_update=faec2ecf-8544-e241-b19d-757e796da607
first_install_retry=0
bootargs_target=multi-user

103

Initialization

Initialization
Gitbook Linux Initialization by 0xAX

Bootup Linux Kernel


Starting kernel ...
[ 0.766587] pca953x 1-0020: failed reading register
[ 0.771661] pca953x 1-0021: failed reading register
[-0022: failed reading register
[ 0.781845] pca953x 1-0023: failed reading register
[ 1.621706] snd_soc_sst_platform: Enter:sst_soc_probe
[ 2.026053] pmic_ccsm pmic_ccsm: Error reading battery pr
ofile from battid frmwrk
[ 2.044225] pmic_ccsm pmic_ccsm: Battery Over heat except
ion
Welcome to Linux!
Expecting device dev-ttyMFD2.device...
[ OK ] Mounted Debug File System.
[ OK ] Found device /dev/ttyMFD2.
[ OK ] Started Network Time Synchronization.
Bluetooth service...
Starting File System Check on /dev/disk/by-partlabel/bo
ot...
Starting Serial Getty on ttyMFD2...
[ OK ] Started Serial Getty on ttyMFD2.
Starting Getty on tty1...
[ OK ] Started Getty on tty1.
[ OK ] Reached target Login Prompts.
Mounting /home...
Starting Network Name Resolution...
[ OK ] Reached target Network.
Starting Zero-configuration networking...
Starting Mosquitto - lightweight server implementati...

104

Initialization
SN protocols...
[ OK ] Mounted /home.
[ OK ] Started Mosquitto - lightweight server implementati
o...T-SN protocols.
[ OK ] Started Zero-configuration networking.
[ OK ] Started Bluetooth service.
[ OK ] Started Restore Sound Card State.
Starting PulseAudio Sound System...
Starting Horting The Edison status and configuration se
rvice...
[ OK ] Started The Edison onfiguration service.
Starting Intel_XDK_Daemon...
[ OK ] Started Intel_XDK_Daemon.
Mounting /boot...
[ OK ] Started Hostname Service.
[ OK ] Mounted /boot.
[ OK ] Started PulseAudio Sound System.
[[0m] Reached target Multi-User System.
Poky (Yocto Project Reference Distro) 1.7.3 edison ttyMFD2
edison login:

105

Upgrade

Upgrade
DFU-Util
dfu-util is a host side implementation of the DFU 1.0 and DFU 1.1
specifications of the USB forum. DFU is intended to download and upload
firmware to/from devices connected over USB. It ranges from small devices
like micro-controller boards to mobile phones. Using dfu-util you can
download firmware to your DFU-enabled device or upload firmware from it.
Homepage
SeeedStudio DFU-Util
Flasheable Image

106

Upgrade

xe1gyq@jessie:~$ sudo dfu-util -l -d 8087:0a99


dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko In
c.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=1
1, name="initrd", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=1
0, name="vmlinuz", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=9
, name="home", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=8
, name="update", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=7
, name="rootfs", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=6
, name="boot", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=5
, name="u-boot-env1", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=4
, name="u-boot1", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=3
, name="u-boot-env0", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=2
, name="u-boot0", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=1
, name="ifwib00", serial="UNKNOWN"
Found DFU: [8087:0a99] ver=9999, devnum=14, cfg=1, intf=0, alt=0
, name="ifwi00", serial="UNKNOWN"

107

Upgrade

xe1gyq@jessie:~/Downloads/latestedison$ dfu-util -d 8087:0a99 -a


rootfs -D edison-image-edison.ext4
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko In
c.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-ut
il release!!!
dfu-util: No DFU capable USB device available

108

Boot Up

Boot Up
Bootup Linux Login
Poky (Yocto Project Reference Distro) 1.7.2 edison ttyMFD2
edison login: root
root@edison:~#

Bootup Initial Configuration, Wifi


Check your kernel version
root@edison:~# uname -a
Linux edison 3.10.17-poky-edison+ #2 SMP PREEMPT Mon Mar 14
15:26:16 PDT 2016 i686 GNU/Linux

Configure your WiFi

109

Boot Up

root@edison:~# configure_edison --wifi


Configure Edison: WiFi Connection
Scanning: 1 seconds left
0 : Rescan for networks
1 : Exit WiFi Setup
2 : Manually input a hidden SSID
3 : INFINITUM914E

Enter 0 to rescan for networks.


Enter 1 to exit.
Enter 2 to input a hidden network SSID.
Enter 3 to choose INFINITUM9###: 3
Is INFINITUM9### correct? [Y or N]: Y
Password must be between 8 and 63 characters.
What is the network password?:
What is the network password?: **********
Initiating connection to INFINITUM9###. Please wait...
Attempting to enable network access, please check 'wpa_cli s
tatus' after a minute to confirm.
Done. Please connect your laptop or PC to the same network a
s this device and go to http://192.168.1.72 or http://edison.loc
al in your browser.
Warning: SSH is not yet enabled on the wireless interface. T
o enable SSH access to this device via wireless run configure_ed
ison --password first.
root@edison:~#

Configure also password to enable SSH on the wireless interface

110

Boot Up

root@edison:~# configure_edison --password


Configure Edison: Device Password
Enter a new password (leave empty to abort)
This will be used to connect to the access point and login t
o the device.
Password: ********
Please enter the password again: ********
First-time root password setup complete. Enabling SSH on WiF
i interface.
The device password has been changed.

Check IP address assigned


root@edison:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
usb0 Link encap:Ethernet HWaddr 02:00:86:58:c2:af
inet addr:192.168.2.15 Bcast:192.168.2.255 Mask:
255.255.255.0
wlan Link encap:Ethernet HWaddr 00:1C:C0:AE:B5:E6
inet addr:192.168.1.74 Bcast:192.168.0.255 Mask:
255.255.255.0

Shutdown USB0 interface


root@edison:~# ifconfig usb0 down
root@edison:~#

Error? Password Lenght


... I am asked for a 5 or 13 character network password, but my network's
password is 10 characters long ... Edison WiFi setup - password must be
either 5 or 13 characters

111

Boot Up

root@edison:~# whereis configure_edison


configure_edison: /usr/bin/configure_edison

--- configure_edison.orig
+++ configure_edison
@@ -60,6 +60,15 @@
wep_key0="%s"
}
'''
+ WEP_26HEX = '''
+network={
+ ssid="%s"
+ %s
+ key_mgmt=NONE
+ group=WEP104 WEP40
+ wep_key0=%s
+}
+'''
WPAPSK = '''
network={
ssid="%s"
@@ -359,10 +368,13 @@
return wpa_templates.OPEN % (ssid, "scan_ssid=1")
elif security == 1:
password = ''
- while len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ while len(password) != 5 and len(password) != 13 and len(
password) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
password = getNetworkPassword()
- return wpa_templates.WEP % (ssid, "scan_ssid=1", password
)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "scan_ssid=1"
, password)
+ else:

112

Boot Up
+ return wpa_templates.WEP % (ssid, "scan_ssid=1", pass
word)
elif security == 2:
password = ''
while len(password) < 8 or len(password) > 63:
@@ -384,10 +396,13 @@
return wpa_templates.OPEN % (ssid, "")
elif network_map[ssid] == "WEP":
password = ''
- while len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ while len(password) != 5 and len(password) != 13 and len(pa
ssword) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
password = getNetworkPassword()
- return wpa_templates.WEP % (ssid, "", password)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "", password)
+ else:
+ return wpa_templates.WEP % (ssid, "", password)
elif network_map[ssid] == "WPA-PSK":
password = ''
while len(password) < 8 or len(password) > 63:
@@ -409,10 +424,13 @@
return wpa_templates.OPEN % (ssid, "scan_ssid=1")
elif protocol == "WEP":
password = changewifi[2]
- if len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ if len(password) != 5 and len(password) != 13 and len(passw
ord) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
return None
- return wpa_templates.WEP % (ssid, "scan_ssid=1", password)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "scan_ssid=1", pa
ssword)
+ else:

113

Boot Up
+ return wpa_templates.WEP % (ssid, "scan_ssid=1", password
)
elif protocol == "WPA-PSK":
password = changewifi[2]
if len(password) < 8 or len(password) > 63:

114

Dual Boot

Dual Boot
Through Micro SD Card
How to boot Edison from an SD card (Linux)

How to boot Edison from an SD card (Linux)


by Carlos Rodriguez from Here
This tutorial describes a way to boot an Edison board with the Root Filesystem on
an external storage (SD card). The kernel and bootloader remain on the local
eMMC. For now, we are not able to boot a kernel from an external storage.

SD Card Format
1. You need to have a SD card formatted with ext4 file system to store your root
file system (do not use FAT/FAT32 for that). You can use gparted or Intel
Edison as follows:
root@edison:~# dmesg
[420794.481542] mmc1: new high speed SDHC card at address 1234
[420794.482480] mmcblk1: mmc1:1234 SA16G 14.4 GiB
[420794.484152] mmcblk1: p1

root@edison:~# umount /dev/mmcblk1p1


root@edison:~# fdisk /dev/mmcblk1
Welcome to fdisk (util-linux 2.24.2).
Changes will remain in memory only, until you decide to write th
em.
Be careful before using the write command.

115

Dual Boot
Command (m for help): p
Disk /dev/mmcblk1: 14.5 GiB, 15548284928 bytes, 30367744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/mmcblk1p1 8192 30367743 15179776 c W95 FAT32 (LBA)
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
Command (m for help): n

Partition type:

p primary (0 primary, 0 extended, 4 free)

e extended

Select (default p): p

Partition number (1-4, default 1): 1

First sector (2048-30367743, default 2048):

Last sector, +sectors or +size{K,M,G,T,P} (2048-30367743, defaul
t 30367743):
Created a new partition 1 of type 'Linux' and of size 14.5 GiB.

Command (m for help): w

The partition table has been altered.

116

Dual Boot

Calling ioctl() to re-read partition table.

Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used
at the next reb.
root@edison:~#

root@edison:~# mkfs.ext4 /dev/mmcblk1p1



mke2fs 1.42.9 (28-Dec-2013)

Discarding device blocks: done

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

950272 inodes, 3794944 blocks

189747 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=3888119808

116 block groups

32768 blocks per group, 32768 fragments per group

117

Dual Boot
8192 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 16
05632, 2654208
Allocating group tables: done

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

root@edison:~#

Edison Ext 4 Image Writing


1. Download and unpack the Edison OS image from the Software Downloads
section of the community.

118

Dual Boot

user@linux:~/Downloads/unpacked-image$ ls
dnx_fwr_saltbay_pr2.bin edison_ifwi-dbg-02-dfu.bin edison-i
mage-edison.ext4 package-list.txt
dnx_osr_saltbay_pr2.bin edison_ifwi-dbg-03.bin edison-i
mage-edison.hddimg pft-config-edison.xml
edison_dnx_fwr.bin edison_ifwi-dbg-03-dfu.bin filter-d
fu-out.js pft-config-mcg_sku.xml
edison_dnx_osr.bin edison_ifwi-dbg-04.bin flashall
.bat u-boot-edison.bin
edison_ifwi-dbg-00.bin edison_ifwi-dbg-04-dfu.bin flashall
.sh u-boot-edison.img
edison_ifwi-dbg-00-dfu.bin edison_ifwi-dbg-05.bin flash.lo
g u-boot-envs
edison_ifwi-dbg-01.bin edison_ifwi-dbg-05-dfu.bin ifwi_sal
tbay_pr2.bin
edison_ifwi-dbg-01-dfu.bin edison_ifwi-dbg-06.bin ifwi_sal
tbay_pr2-dfu.bin
edison_ifwi-dbg-02.bin edison_ifwi-dbg-06-dfu.bin ota_upda
te.scr

user@linux:~/Downloads/unpacked-image$ mkdir Rootfs

user@linux:~/Downloads/unpacked-image$ sudo mount ./edison-image


-edison.ext4 Rootfs
[sudo] password for user:

user@linux:~/Downloads/unpacked-image$ sudo cp -a Rootfs/* /medi


a/8f88dd49-95ac-4d0c-8c3a-abd445f87fa1/ (or whatever folder name
your pc gave to your SD card)

user@linux:~/Downloads/unpacked-image$ sync

1. Your SD card is now ready to boot. Find out the SD card device name

119

Dual Boot
On a running Edison board, plug your formatted SD card and get the device
name:
root@edison:~# dmesg |tail -n 10
[ 6.387683] g_multi gadget: high-speed config #2: Multifuncti
on with CDC ECM
[ 6.522733] EXT4-fs (mmcblk0p5): mounted filesystem without j
ournal. Opts: discard,barrier=1,data=ordered,noauto_da_ac
[ 7.375959] systemd-fstab-generator[174]: Checking was reques
ted for "rootfs", but it is not a device.
[ 10.001889] systemd[1]: Reloading.
[ 10.098201] systemd-fstab-generator[223]: Checking was reques
ted for "rootfs", but it is not a device.
[ 20.372477] EXT4-fs (mmcblk0p10): mounted filesystem with ord
ered data mode. Opts: discard,barrier=1,data=ordered,noac
[ 767.952993] mmc1: new high speed SDHC card at address 0007
[ 767.953999] mmcblk1: mmc1:0007 SD16G 14.4 GiB
[ 767.956822] mmcblk1: p1
[ 768.275336] EXT4-fs (mmcblk1p1): mounted filesystem with orde
red data mode. Opts: (null)

Here, the SD card device is /dev/mmcblk1 and the partition weve created is
"/dev/mmcblk1p1". To boot using the external device, you need to modify the UBoot environment variable named "mmc-bootargs" with kernel boot arguments. In
the simplest case you can just change the "root=..." part, but heres a more
elaborated approach, which will help you to switch between booting from eMMC
and the SD card more easily. In the Edison Linux console set the U-Boot
environment variables like the below:
# the below is a single line, make sure you write down the boota
rgs somewhere else to later being able to boot from our flash de
vice
root@edison:~# fw_printenv |grep mmc-bootargs=
mmc-bootargs=setenv bootargs root=PARTUUID=${uuid_rootfs} rootfs
type=ext4 ${bootargs_console} ${bootargs_debug} systemd.unit=${b
ootargs_target}.target hardware_id=${hardware_id} g_multi.iSeria
lNumber=${serial#} g_multi.dev_addr=${usb0addr}

120

Dual Boot

# the below is a single command line


root@edison:~# fw_setenv mmc-bootargs 'setenv bootargs root=${my
rootfs} rootdelay=3 rootfstype=ext4 ${bootargs_console} ${bootar
gs_debug} systemd.unit=${bootargs_target}.target hardware_id=${h
ardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${
usb0addr}'

root@edison:~# fw_setenv myrootfs_sdcard '/dev/mmcblk1p1'

# get the UUID for the eMMC rootfs partition


root@edison:~# fw_printenv uuid_rootfs

# use the UUID obtained above


root@edison:~# fw_setenv myrootfs_emmc 'PARTUUID=012b3303-34ac-2
84d-99b4-34e03a2335f4'

# this will set the default, use the value weve used for myroot
fs_emmc
# if you want to boot from eMMC by default
root@edison:~# fw_setenv myrootfs '/dev/mmcblk1p1'

root@edison:~# fw_setenv do_boot_emmc 'setenv myrootfs ${myrootf


s_emmc}; run do_boot'

root@edison:~# fw_setenv do_boot_sdcard 'setenv myrootfs ${myroo


tfs_sdcard}; run do_boot'

Reboot Edison

121

Dual Boot
After boot, verify that you are using rootfs stored on your external device: The root
file system is now 14.1 GB (this will depend on your SD card size). The SD card
will still be automounted to /media/sdcard by Edisons automount daemon. Since it
is the rootfs anyway, this m006F untpoint becomes useless, so disable the
systemd service: Now, you have plenty of room to work on Edison and no
unnecessary mounts:
root@edison:/etc/systemd# df -h
Filesystem Size Used Available Use% Mounted
on
/dev/root 14.1G 343.5M 13.1G 3% /
devtmpfs 480.2M 0 480.2M 0% /dev
tmpfs 480.5M 0 480.5M 0% /dev/shm
tmpfs 480.5M 492.0K 480.0M 0% /run
tmpfs 480.5M 0 480.5M 0% /sys/fs/
cgroup
tmpfs 480.5M 492.0K 480.0M 0% /etc/mac
hine-id
systemd-1 5.5M 5.1M 464.0K 92% /boot
tmpfs 480.5M 4.0K 480.5M 0% /tmp
tmpfs 480.5M 0 480.5M 0% /var/vol
atile
/dev/mmcblk0p5 1003.0K 19.0K 913.0K 2% /factory
/dev/mmcblk0p7 5.5M 5.1M 464.0K 92% /boot

122

Display Message

Display Message
Bootup Kernel Display Message
dmesg (display message or driver message) is a command on most Unix-like
operating systems that prints the message buffer of the kernel. Linux Kernel
Dmesg
root@edison:~# dmesg
...
root@edison:~# dmesg > dmesg.file
root@edison:~# vi dmesg.file
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
...
[ 17.842227] snd_intel_sst: runtime_idle called

[ 19.841555] snd_intel_sst: runtime_suspend called

root@edison:~# tail -f /var/log/messages


tail: can't open '/var/log/messages': No such file or directory
tail: no files
root@edison:~# dmesg

[ 0.000000] Initializing cgroup subsys cpuset

[ 0.000000] Initializing cgroup subsys cpu

[ 0.000000] Initializing cgroup subsys cpuacct

[ 0.000000] Linux version 3.10.98-poky-edison+ (neck@flax) (g
cc version 4.9.6
[ 0.000000] e820: BIOS-provided physical RAM map:

123

Display Message
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009
7fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000003ff
ffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000004000000-0x0000000005ff
ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000006000000-0x000000003f4f
ffff] usable
[ 0.000000] BIOS-e820: [mem 0x000000003f500000-0x000000003fff
ffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec0
0fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fec04000-0x00000000fec0
7fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee0
0fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ff000000-0x00000000ffff
ffff] reserved
[ 0.000000] NX (Execute Disable) protection: active

[ 0.000000] SMBIOS 2.6 present.

[ 0.000000] DMI: Intel Corporation Merrifield/BODEGA BAY, BIO
S 542 2015.01.28
[ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable =
=> reserved
[ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable

[ 0.000000] e820: last_pfn = 0x3f500 max_arch_pfn = 0x1000000

[ 0.000000] MTRR default type: uncachable

[ 0.000000] MTRR fixed ranges enabled:

[ 0.000000] 00000-9FFFF write-back

[ 0.000000] A0000-BFFFF uncachable

[ 0.000000] C0000-FFFFF write-back

124

Display Message
[ 0.000000] MTRR variable ranges enabled:

[ 0.000000] 0 base 000000000 mask FC0000000 write-back

[ 0.000000] 1 base 03F600000 mask FFFE00000 uncachable

[ 0.000000] 2 base 03F800000 mask FFF800000 uncachable

[ 0.000000] 3 base 004000000 mask FFE000000 uncachable

[ 0.000000] 4 disabled

[ 0.000000] 5 disabled

[ 0.000000] 6 disabled

[ 0.000000] 7 disabled

[ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new
0x7010600070106
[ 0.000000] original variable MTRRs

[ 0.000000] reg 0, base: 0GB, range: 1GB, type WB

[ 0.000000] reg 1, base: 1014MB, range: 2MB, type UC

[ 0.000000] reg 2, base: 1016MB, range: 8MB, type UC

[ 0.000000] reg 3, base: 64MB, range: 32MB, type UC

[ 0.000000] total RAM covered: 982M

[ 0.000000] Found optimal setting for mtrr clean up

[ 0.000000] gran_size: 64K chunk_size: 512M num_reg:
5 lose coG
[ 0.000000] New variable MTRRs

[ 0.000000] reg 0, base: 0GB, range: 512MB, type WB

125

Display Message
[ 0.000000] reg 1, base: 64MB, range: 32MB, type UC

[ 0.000000] reg 2, base: 512MB, range: 512MB, type WB

[ 0.000000] reg 3, base: 1014MB, range: 2MB, type UC

[ 0.000000] reg 4, base: 1016MB, range: 8MB, type UC

[ 0.000000] e820: update [mem 0x04000000-0x05ffffff] usable =
=> reserved
[ 0.000000] initial memory mapped: [mem 0x00000000-0x023fffff
]
[ 0.000000] Base memory trampoline at [c0094000] 94000 size 1
6384
[ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]

[ 0.000000] [mem 0x00000000-0x000fffff] page 4k

[ 0.000000] init_memory_mapping: [mem 0x37400000-0x375fffff]

[ 0.000000] [mem 0x37400000-0x375fffff] page 2M

[ 0.000000] init_memory_mapping: [mem 0x34000000-0x373fffff]

[ 0.000000] [mem 0x34000000-0x373fffff] page 2M

[ 0.000000] init_memory_mapping: [mem 0x00100000-0x03ffffff]

[ 0.000000] [mem 0x00100000-0x001fffff] page 4k

[ 0.000000] [mem 0x00200000-0x03ffffff] page 2M

[ 0.000000] init_memory_mapping: [mem 0x06000000-0x33ffffff]

[ 0.000000] [mem 0x06000000-0x33ffffff] page 2M

[ 0.000000] init_memory_mapping: [mem 0x37600000-0x377fdfff]

[ 0.000000] [mem 0x37600000-0x377fdfff] page 4k

126

Display Message
[ 0.000000] BRK [0x01e31000, 0x01e31fff] PGTABLE

[ 0.000000] BRK [0x01e32000, 0x01e32fff] PGTABLE

[ 0.000000] 125MB HIGHMEM available.

[ 0.000000] 887MB LOWMEM available.

[ 0.000000] mapped low ram: 0 - 377fe000

[ 0.000000] low ram: 0 - 377fe000

[ 0.000000] BRK [0x01e33000, 0x01e33fff] PGTABLE

[ 0.000000] Zone ranges:

[ 0.000000] DMA [mem 0x00001000-0x00ffffff]

[ 0.000000] Normal [mem 0x01000000-0x377fdfff]

[ 0.000000] HighMem [mem 0x377fe000-0x3f4fffff]

[ 0.000000] Movable zone start for each node

[ 0.000000] Early memory node ranges

[ 0.000000] node 0: [mem 0x00001000-0x00097fff]

[ 0.000000] node 0: [mem 0x00100000-0x03ffffff]

[ 0.000000] node 0: [mem 0x06000000-0x3f4fffff]

[ 0.000000] On node 0 totalpages: 251031

[ 0.000000] free_area_init_node: node 0, pgdat c1c666c0, node
_mem_map f700e00
[ 0.000000] DMA zone: 32 pages used for memmap

[ 0.000000] DMA zone: 0 pages reserved

127

Display Message
[ 0.000000] DMA zone: 3991 pages, LIFO batch:0

[ 0.000000] Normal zone: 1744 pages used for memmap

[ 0.000000] Normal zone: 215038 pages, LIFO batch:31

[ 0.000000] HighMem zone: 251 pages used for memmap

[ 0.000000] HighMem zone: 32002 pages, LIFO batch:7

[ 0.000000] Using APIC driver default

[ 0.000000] SFI: Simple Firmware Interface v0.81 http://simpl
efirmware.org
[ 0.000000] SFI: SYST E31F0, 0060 (v1 INTEL INTELFDK)

[ 0.000000] SFI: CPUS E3296, 0020 (v1 INTEL INTELFDK)

[ 0.000000] SFI: FREQ E32C2, 0030 (v1 INTEL INTELFDK)

[ 0.000000] SFI: MMAP E32FE, 01A4 (v1 INTEL INTELFDK)

[ 0.000000] SFI: XSDT E34B0, 002C (v1 INTEL INTELFDK)

[ 0.000000] SFI: APIC E353E, 0020 (v1 INTEL INTELFDK)

[ 0.000000] SFI: WAKE E356A, 0020 (v2 INTEL INTELFDK)

[ 0.000000] SFI: DEVS E359E, 047D (v1 INTEL INTELFDK)

[ 0.000000] SFI: GPIO E3A27, 0964 (v1 INTEL INTELFDK)

[ 0.000000] SFI: OEMB E4397, 0060 (v5 UMGFDK CFGINFO!)

[ 0.000000] SFI: registering lapic[0]

[ 0.000000] SFI: registering lapic[2]

[ 0.000000] IOAPIC[0]: apic_id 0, version 32, address 0xfec00
000, GSI 0-54

128

Display Message
[ 0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs

[ 0.000000] nr_irqs_gsi: 71

[ 0.000000] e820: [mem 0x40000000-0xfebfffff] available for P
CI devices
[ 0.000000] setup_percpu: NR_CPUS:2 nr_cpumask_bits:2 nr_cpu_
ids:2 nr_node_i1
[ 0.000000] PERCPU: Embedded 14 pages/cpu @f6fe8000 s33152 r0
d24192 u57344
[ 0.000000] pcpu-alloc: s33152 r0 d24192 u57344 alloc=14*4096

[ 0.000000] pcpu-alloc: [0] 0 [0] 1

[ 0.000000] Built 1 zonelists in Zone order, mobility groupin
g on. Total pa5
[ 0.000000] Kernel command line: rootwait root=PARTUUID=012b3
303-34ac-284d-9y
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 byt
es)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7
, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6,
262144 bytes)
[ 0.000000] Initializing CPU#0

[ 0.000000] Initializing HighMem for node 0 (000377fe:0003f50
0)
[ 0.000000] Memory: 982480k/1037312k available (7105k kernel
code, 21644k re)
[ 0.000000] virtual kernel memory layout:

fixmap : 0xfff8b000 - 0xfffff000 ( 464 kB)

pkmap : 0xff800000 - 0xffa00000 (2048 kB)

vmalloc : 0xf7ffe000 - 0xff7fe000 ( 120 MB)

lowmem : 0xc0000000 - 0xf77fe000 ( 887 MB)

129

Display Message
.init : 0xc1c8b000 - 0xc1d17000 ( 560 kB)

.data : 0xc18f066e - 0xc1c8a9c0 (3688 kB)

.text : 0xc1200000 - 0xc18f066e (7105 kB)

[ 0.000000] Checking if this processor honours the WP bit eve
n in supervisor.
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2
, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.

[ 0.000000] Additional per-CPU info printed with stalls.

[ 0.000000] NR_IRQS:2304 nr_irqs:512 16

[ 0.000000] CPU 0 irqstacks, hard=f6808000 soft=f680a000

[ 0.000000] Console: colour dummy device 80x25

[ 0.000000] kmemleak: Kernel memory leak detector disabled

[ 0.000000] tsc: Detected 499.200 MHz processor

[ 0.000009] Calibrating delay loop (skipped), value calculate
d using timer f)
[ 0.000033] pid_max: default: 32768 minimum: 301

[ 0.000259] Security Framework initialized

[ 0.000287] SELinux: Initializing.

[ 0.000350] SELinux: Starting in permissive mode

[ 0.000428] Mount-cache hash table entries: 512

[ 0.001564] Initializing cgroup subsys devices

[ 0.001589] Initializing cgroup subsys freezer

130

Display Message
[ 0.001608] Initializing cgroup subsys blkio

[ 0.001624] Initializing cgroup subsys perf_event

[ 0.001764] CPU: Physical Processor ID: 0

[ 0.001780] CPU: Processor Core ID: 0

[ 0.001799] ENERGY_PERF_BIAS: Set to 'normal', was 'performan
ce'
ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)

[ 0.001820] mce: CPU supports 6 MCE banks

[ 0.001851] CPU0: Thermal monitoring enabled (TM1)

[ 0.001896] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0

Last level dTLB entries: 4KB 128, 2MB 0, 4MB 0

tlb_flushall_shift: 6

[ 0.002339] Freeing SMP alternatives: 28k freed

[ 0.002394] SFI: MCFG E34F6, 003C (v1 INTEL INTELFDK)

[ 0.002414] ftrace: allocating 28147 entries in 55 pages

[ 0.070009] Enabling APIC mode: Flat. Using 1 I/O APICs

[ 0.070090] smpboot: CPU0: Genuine Intel(R) CPU 4000 @ 50
0MHz (fam: 06, )
[ 0.070138] TSC deadline timer enabled

[ 0.070200] Performance Events: no PEBS fmt2+, generic archit
ected perfmon, .
[ 0.070245] ... version: 3

[ 0.070259] ... bit width: 40

131

Display Message
[ 0.070272] ... generic registers: 2

[ 0.070285] ... value mask: 000000ffffffffff

[ 0.070298] ... max period: 000000007fffffff

[ 0.070310] ... fixed-purpose events: 3

[ 0.070322] ... event mask: 0000000700000003

[ 0.110679] ftrace: Allocated trace_printk buffers

[ 0.161723] CPU 1 irqstacks, hard=f6b8c000 soft=f6b8e000

[ 0.161744] smpboot: Booting Node 0, Processors #1 OK

[ 0.171955] Initializing CPU#1

[ 0.172914] Skipped synchronization checks as TSC is reliable
.
[ 0.173366] NMI watchdog: enabled on all CPUs, permanently co
nsumes one hw-P.
[ 0.173449] Brought up 2 CPUs

[ 0.173470] smpboot: Total of 2 processors activated (1996.80
BogoMIPS)
[ 0.175407] devtmpfs: initialized

[ 0.186483] SFI: SFI sysfs interfaces init success

[ 0.187048] regulator-dummy: no parameters

[ 0.187532] NET: Registered protocol family 16

[ 0.189621] SFI OEMB Layout

[ 0.189658] OEMB signature : OEMB

OEMB length : 96

132

Display Message
OEMB revision : 5

OEMB checksum : 0x8D

OEMB oem_id : UMGFDK

OEMB oem_table_id : CFGINFO!

OEMB board_id : 0x02

OEMB iafw version : 002.012

OEMB val_hooks version : 002.004

OEMB ia suppfw version : 000.000

OEMB scu runtime version : 176.073

OEMB ifwi version : 237.015

[ 0.189762] intel_soc_thermal: IPC bus = 0, name = so
c_thrm, irq = 01
[ 0.189978] IPC bus, name = bcove_adc, irq = 0x32

[ 0.190175] IPC bus, name = bcove_thrm, irq = 0x34

[ 0.190381] IPC bus, name = bcove_power_btn, irq = 0x1e

[ 0.190551] IPC bus, name = pmic_ccsm, irq = 0x1b

[ 0.190792] SDIO bus = 1, name = bcm43xx_clk_vmmc, ref_clock
= 26000000, add1
[ 0.190808] Using generic wifi platform data

[ 0.190824] wifi_platform_data: GPIO == 64

[ 0.190968] IPC bus, name = msic_gpio, irq = 0x31

[ 0.191146] I2C bus = 1, name = pcal9555a-1, irq = 0x 0,
addr = 0x20

133

Display Message
[ 0.191181] I2C bus = 1, name = pcal9555a-2, irq = 0x 0,
addr = 0x21
[ 0.191213] I2C bus = 1, name = pcal9555a-3, irq = 0x 0,
addr = 0x22
[ 0.191244] I2C bus = 1, name = pcal9555a-4, irq = 0x 0,
addr = 0x23
[ 0.191277] SPI bus=5, name= ads7955, irq=0x 0, max_f
req=20000000, c0
[ 0.191299] SPI bus=5, name= spidev, irq=0x 0, max_f
req=25000000, c1
[ 0.191320] IPC bus, name = mrfld_sst, irq = 0xff

[ 0.191597] pgrr = 000003d5

[ 0.192065] PCI: MMCONFIG for domain 0000 [bus 00-00] at [mem
0x3f500000-0x3)
[ 0.192089] PCI: MMCONFIG at [mem 0x3f500000-0x3f5fffff] rese
rved in E820
[ 0.192102] PCI: Using MMCONFIG for extended config space

[ 0.192115] PCI: Using configuration type 1 for base access

[ 0.205192] bio: create slab <bio-0> at 0

[ 0.206698] vgaarb: loaded

[ 0.207392] SCSI subsystem initialized

[ 0.207761] usbcore: registered new interface driver usbfs

[ 0.207861] usbcore: registered new interface driver hub

[ 0.208070] usbcore: registered new device driver usb

[ 0.208363] media: Linux media interface: v0.10

[ 0.208443] Linux video capture interface: v2.00

[ 0.208514] pps_core: LinuxPPS API ver. 1 registered

134

Display Message
[ 0.208529] pps_core: Software ver. 5.3.6 - Copyright 2005-20
07 Rodolfo Giom>
[ 0.208568] PTP clock support registered

[ 0.209067] remoteproc0: intel_rproc_scu is available

[ 0.209088] remoteproc0: Note: remoteproc is still under dev
elopment and co.
[ 0.209104] remoteproc0: THE BINARY FORMAT IS NOT YET FINALI
ZED, and backwa.
[ 0.209524] remoteproc0: registered virtio0 (type 7)

[ 0.209775] remoteproc0: powering up intel_rproc_scu

[ 0.209803] remoteproc0: Booting fw image intel_mid/intel_mi
d_remoteproc.fw6
[ 0.209843] Started intel scu remote processor

[ 0.209861] remoteproc0: remote processor intel_rproc_scu is
now up
[ 0.210211] virtio_rpmsg_bus virtio0: creating channel rpmsg_
bcove_adc addr 4
[ 0.210403] virtio_rpmsg_bus virtio0: creating channel rpmsg_
mrfl_thermal ad5
[ 0.210575] virtio_rpmsg_bus virtio0: creating channel rpmsg_
mid_powerbtn ad0
[ 0.210742] virtio_rpmsg_bus virtio0: creating channel rpmsg_
pmic_ccsm addr 9
[ 0.210921] virtio_rpmsg_bus virtio0: creating channel rpmsg_
msic_gpio addr 5
[ 0.211090] virtio_rpmsg_bus virtio0: creating channel rpmsg_
ipc_command add0
[ 0.211258] virtio_rpmsg_bus virtio0: creating channel rpmsg_
ipc_simple_comm1
[ 0.211427] virtio_rpmsg_bus virtio0: creating channel rpmsg_
ipc_raw_command2
[ 0.211607] virtio_rpmsg_bus virtio0: creating channel rpmsg_
pmic addr 0xff
[ 0.211776] virtio_rpmsg_bus virtio0: creating channel rpmsg_
mip addr 0xec

135

Display Message
[ 0.211945] virtio_rpmsg_bus virtio0: creating channel rpmsg_
fw_update addr 3
[ 0.212135] virtio_rpmsg_bus virtio0: creating channel rpmsg_
ipc_util addr 02
[ 0.212307] virtio_rpmsg_bus virtio0: creating channel rpmsg_
flis addr 0xf5
[ 0.212478] virtio_rpmsg_bus virtio0: creating channel rpmsg_
watchdog addr 08
[ 0.212663] virtio_rpmsg_bus virtio0: creating channel rpmsg_
umip addr 0x14
[ 0.212837] virtio_rpmsg_bus virtio0: creating channel rpmsg_
osip addr 0x15
[ 0.213055] virtio_rpmsg_bus virtio0: creating channel rpmsg_
vrtc addr 0xfa
[ 0.213235] virtio_rpmsg_bus virtio0: creating channel rpmsg_
fw_logging addr7
[ 0.213423] virtio_rpmsg_bus virtio0: creating channel rpmsg_
kpd_led addr 0x3
[ 0.213599] virtio_rpmsg_bus virtio0: creating channel rpmsg_
modem_nvram add2
[ 0.213776] virtio_rpmsg_bus virtio0: creating channel rpmsg_
mid_pwm addr 0x2
[ 0.213962] virtio_rpmsg_bus virtio0: rpmsg host is online

[ 0.214076] intel_mid_rpmsg rpmsg5: Probed rpmsg_ipc device r
pmsg_ipc_command
[ 0.214098] intel_mid_rpmsg rpmsg5: Allocating rpmsg_instance

[ 0.214153] intel_mid_rpmsg rpmsg6: Probed rpmsg_ipc device r
pmsg_ipc_simpled
[ 0.214174] intel_mid_rpmsg rpmsg6: Allocating rpmsg_instance

[ 0.214225] intel_mid_rpmsg rpmsg7: Probed rpmsg_ipc device r
pmsg_ipc_raw_cod
[ 0.214245] intel_mid_rpmsg rpmsg7: Allocating rpmsg_instance

[ 0.214756] Advanced Linux Sound Architecture Driver Initiali
zed.
[ 0.214774] Intel MID platform detected, using MID PCI ops

136

Display Message
[ 0.214788] PCI: Probing PCI hardware

[ 0.214803] PCI: root bus 00: using default resources

[ 0.214819] PCI: Probing PCI hardware (bus 00)

[ 0.215083] PCI host bridge to bus 0000:00

[ 0.215112] pci_bus 0000:00: root bus resource [io 0x0000-0x
ffff]
[ 0.215136] pci_bus 0000:00: root bus resource [mem 0x0000000
0-0xfffffffff]
[ 0.215155] pci_bus 0000:00: No busn resource found for root
bus, will use []
[ 0.215216] pci 0000:00:00.0: [8086:1170] type 00 class 0x060
000
[ 0.215614] pci 0000:00:01.0: [8086:1190] type 00 class 0x080
501
[ 0.215685] pci 0000:00:01.0: reg 10: [mem 0xff3fc000-0xff3fc
0ff]
[ 0.215901] pci 0000:00:01.0: PME# supported from D0 D3hot

[ 0.216251] pci 0000:00:01.2: [8086:1190] type 00 class 0x080
501
[ 0.216318] pci 0000:00:01.2: reg 10: [mem 0xff3fa000-0xff3fa
0ff]
[ 0.216533] pci 0000:00:01.2: PME# supported from D0 D3hot

[ 0.216865] pci 0000:00:01.3: [8086:1190] type 00 class 0x080
501
[ 0.216931] pci 0000:00:01.3: reg 10: [mem 0xff3fb000-0xff3fb
0ff]
[ 0.217145] pci 0000:00:01.3: PME# supported from D0 D3hot

[ 0.217514] pci 0000:00:02.0: [8086:1182] type 00 class 0x038
000
[ 0.217583] pci 0000:00:02.0: reg 10: [mem 0xc0000000-0xc1fff
fff]
[ 0.217646] pci 0000:00:02.0: reg 18: [mem 0x80000000-0x8ffff
fff]

137

Display Message
[ 0.217707] pci 0000:00:02.0: reg 20: [io 0x7ff8-0x7fff]

[ 0.218125] pci 0000:00:04.0: [8086:1191] type 00 class 0x070
002
[ 0.218191] pci 0000:00:04.0: reg 10: [mem 0xff010000-0xff010
07f]
[ 0.218404] pci 0000:00:04.0: PME# supported from D0 D3hot

[ 0.218751] pci 0000:00:04.1: [8086:1191] type 00 class 0x070
002
[ 0.218818] pci 0000:00:04.1: reg 10: [mem 0xff010080-0xff010
0ff]
[ 0.219031] pci 0000:00:04.1: PME# supported from D0 D3hot

[ 0.219378] pci 0000:00:04.2: [8086:1191] type 00 class 0x070
002
[ 0.219445] pci 0000:00:04.2: reg 10: [mem 0xff010100-0xff010
17f]
[ 0.219659] pci 0000:00:04.2: PME# supported from D0 D3hot

[ 0.219991] pci 0000:00:04.3: [8086:1191] type 00 class 0x070
002
[ 0.220057] pci 0000:00:04.3: reg 10: [mem 0xff010180-0xff010
1ff]
[ 0.220271] pci 0000:00:04.3: PME# supported from D0 D3hot

[ 0.220630] pci 0000:00:05.0: [8086:1192] type 00 class 0x070
002
[ 0.220697] pci 0000:00:05.0: reg 10: [mem 0xff010400-0xff010
7ff]
[ 0.220911] pci 0000:00:05.0: PME# supported from D0 D3hot

[ 0.221259] pci 0000:00:06.0: [8086:1193] type 00 class 0x088
000
[ 0.221327] pci 0000:00:06.0: reg 10: [mem 0xff2a0000-0xff2a0
fff]
[ 0.221541] pci 0000:00:06.0: PME# supported from D0 D3hot

[ 0.221918] pci 0000:00:06.1: [8086:1193] type 00 class 0x088
000

138

Display Message
[ 0.221985] pci 0000:00:06.1: reg 10: [mem 0xff2a1000-0xff2a1
fff]
[ 0.222199] pci 0000:00:06.1: PME# supported from D0 D3hot

[ 0.222556] pci 0000:00:07.0: [8086:1194] type 00 class 0x088
000
[ 0.222623] pci 0000:00:07.0: reg 10: [mem 0xff188000-0xff188
fff]
[ 0.222837] pci 0000:00:07.0: PME# supported from D0 D3hot

[ 0.223222] pci 0000:00:07.1: [8086:1194] type 00 class 0x088
000
[ 0.223290] pci 0000:00:07.1: reg 10: [mem 0xff189000-0xff189
fff]
[ 0.223504] pci 0000:00:07.1: PME# supported from D0 D3hot

[ 0.223846] pci 0000:00:07.2: [8086:1194] type 00 class 0x088
000
[ 0.223915] pci 0000:00:07.2: reg 10: [mem 0xff18a000-0xff18a
fff]
[ 0.224129] pci 0000:00:07.2: PME# supported from D0 D3hot

[ 0.224489] pci 0000:00:08.0: [8086:1195] type 00 class 0x078
000
[ 0.224556] pci 0000:00:08.0: reg 10: [mem 0xff18b000-0xff18b
fff]
[ 0.224771] pci 0000:00:08.0: PME# supported from D0 D3hot

[ 0.225101] pci 0000:00:08.1: [8086:1195] type 00 class 0x078
000
[ 0.225168] pci 0000:00:08.1: reg 10: [mem 0xff18c000-0xff18c
fff]
[ 0.225381] pci 0000:00:08.1: PME# supported from D0 D3hot

[ 0.225723] pci 0000:00:08.2: [8086:1195] type 00 class 0x078
000
[ 0.225790] pci 0000:00:08.2: reg 10: [mem 0xff18d000-0xff18d
fff]
[ 0.226004] pci 0000:00:08.2: PME# supported from D0 D3hot

139

Display Message
[ 0.226347] pci 0000:00:08.3: [8086:1195] type 00 class 0x078
000
[ 0.226415] pci 0000:00:08.3: reg 10: [mem 0xff18e000-0xff18e
fff]
[ 0.226629] pci 0000:00:08.3: PME# supported from D0 D3hot

[ 0.226973] pci 0000:00:09.0: [8086:1196] type 00 class 0x078
000
[ 0.227040] pci 0000:00:09.0: reg 10: [mem 0xff18f000-0xff18f
fff]
[ 0.227253] pci 0000:00:09.0: PME# supported from D0 D3hot

[ 0.227597] pci 0000:00:09.1: [8086:1196] type 00 class 0x078
000
[ 0.227664] pci 0000:00:09.1: reg 10: [mem 0xff190000-0xff190
fff]
[ 0.227879] pci 0000:00:09.1: PME# supported from D0 D3hot

[ 0.228211] pci 0000:00:09.2: [8086:1196] type 00 class 0x078
000
[ 0.228278] pci 0000:00:09.2: reg 10: [mem 0xff191000-0xff191
fff]
[ 0.228492] pci 0000:00:09.2: PME# supported from D0 D3hot

[ 0.228853] pci 0000:00:0a.0: [8086:1197] type 00 class 0x078
000
[ 0.228920] pci 0000:00:0a.0: reg 10: [mem 0xff3f8000-0xff3f8
fff]
[ 0.229135] pci 0000:00:0a.0: PME# supported from D0 D3hot

[ 0.229480] pci 0000:00:0b.0: [8086:1198] type 00 class 0x108
000
[ 0.229547] pci 0000:00:0b.0: reg 10: [mem 0xf9038000-0xf903f
fff]
[ 0.229761] pci 0000:00:0b.0: PME# supported from D0 D3hot

[ 0.230095] pci 0000:00:0c.0: [8086:1199] type 00 class 0x088
000
[ 0.230162] pci 0000:00:0c.0: reg 10: [mem 0xff008000-0xff008
fff]

140

Display Message
[ 0.230204] pci 0000:00:0c.0: reg 14: [mem 0x000ddcc0-0x000dd
ccf]
[ 0.230399] pci 0000:00:0c.0: PME# supported from D0 D3hot

[ 0.230745] pci 0000:00:0d.0: [8086:119a] type 00 class 0x040
100
[ 0.230813] pci 0000:00:0d.0: reg 10: [mem 0x05e00000-0x05fff
fff]
[ 0.230857] pci 0000:00:0d.0: reg 14: [mem 0xff340000-0xff343
fff]
[ 0.230898] pci 0000:00:0d.0: reg 18: [mem 0xff344000-0xff344
fff]
[ 0.230939] pci 0000:00:0d.0: reg 1c: [mem 0xff2c0000-0xff2df
fff]
[ 0.230980] pci 0000:00:0d.0: reg 20: [mem 0xff300000-0xff33f
fff]
[ 0.231120] pci 0000:00:0d.0: PME# supported from D0 D3hot

[ 0.231467] pci 0000:00:0e.0: [8086:119b] type 00 class 0x088
000
[ 0.231534] pci 0000:00:0e.0: reg 10: [mem 0xff298000-0xff29b
fff]
[ 0.231577] pci 0000:00:0e.0: reg 14: [mem 0xff2a2000-0xff2a2
fff]
[ 0.231771] pci 0000:00:0e.0: PME# supported from D0 D3hot

[ 0.232115] pci 0000:00:11.0: [8086:119e] type 00 class 0x0c0
320
[ 0.232226] pci 0000:00:11.0: reg 10: [mem 0xf9100000-0xf911f
fff]
[ 0.232442] pci 0000:00:11.0: PME# supported from D0 D3hot

[ 0.232792] pci 0000:00:12.0: [8086:119f] type 00 class 0x118
000
[ 0.232859] pci 0000:00:12.0: reg 10: [mem 0xf9009000-0xf9009
fff]
[ 0.232902] pci 0000:00:12.0: reg 14: [mem 0xf90a0000-0xf90af
fff]
[ 0.232943] pci 0000:00:12.0: reg 18: [mem 0xfa000000-0xfafff
fff]

141

Display Message
[ 0.233157] pci 0000:00:12.0: PME# supported from D0 D3hot

[ 0.233521] pci 0000:00:13.0: [8086:11a0] type 00 class 0x0b4
000
[ 0.233588] pci 0000:00:13.0: reg 10: [mem 0xff009000-0xff009
fff]
[ 0.233803] pci 0000:00:13.0: PME# supported from D0 D3hot

[ 0.234141] pci 0000:00:14.0: [8086:11a1] type 00 class 0x0b4
000
[ 0.234208] pci 0000:00:14.0: reg 10: [mem 0xff00b000-0xff00b
fff]
[ 0.234422] pci 0000:00:14.0: PME# supported from D0 D3hot

[ 0.234772] pci 0000:00:15.0: [8086:11a2] type 00 class 0x088
000
[ 0.234840] pci 0000:00:15.0: reg 10: [mem 0xff192000-0xff192
fff]
[ 0.235055] pci 0000:00:15.0: PME# supported from D0 D3hot

[ 0.235394] pci 0000:00:16.0: [8086:11a3] type 00 class 0x0b4
000
[ 0.235460] pci 0000:00:16.0: reg 10: [mem 0xff0d9000-0xff0d9
0ff]
[ 0.235674] pci 0000:00:16.0: PME# supported from D0 D3hot

[ 0.236024] pci 0000:00:16.1: [8086:11a4] type 00 class 0x0b4
000
[ 0.236091] pci 0000:00:16.1: reg 10: [mem 0x04819000-0x04898
fff]
[ 0.236134] pci 0000:00:16.1: reg 14: [mem 0x04919000-0x04920
fff]
[ 0.236327] pci 0000:00:16.1: PME# supported from D0 D3hot

[ 0.236701] pci 0000:00:17.0: [8086:11a5] type 00 class 0x088
000
[ 0.236767] pci 0000:00:17.0: reg 10: [mem 0xff013000-0xff013
fff]
[ 0.236980] pci 0000:00:17.0: PME# supported from D0 D3hot

142

Display Message
[ 0.237320] pci 0000:00:18.0: [8086:11a6] type 00 class 0x038
000
[ 0.237572] pci 0000:00:18.0: PME# supported from D0 D3hot

[ 0.237948] pci_bus 0000:00: busn_res: [bus 00-ff] end is upd
ated to 00
[ 0.238113] PCI: pci_cache_line_size set to 64 bytes

[ 0.238389] e820: reserve RAM buffer [mem 0x00098000-0x0009ff
ff]
[ 0.238410] e820: reserve RAM buffer [mem 0x3f500000-0x3fffff
ff]
[ 0.239144] Bluetooth: Core ver 2.16

[ 0.239226] NET: Registered protocol family 31

[ 0.239242] Bluetooth: HCI device and connection manager init
ialized
[ 0.239271] Bluetooth: HCI socket layer initialized

[ 0.239298] Bluetooth: L2CAP socket layer initialized

[ 0.239393] Bluetooth: SCO socket layer initialized

[ 0.240073] cfg80211: Calling CRDA to update world regulatory
domain
[ 0.241331] intel_scu_flis platform device created

[ 0.241408] hsu core clock 38 M

[ 0.241591] intel_pmu_driver 0000:00:14.0: PMU DRIVER Probe c
alled
[ 0.242875] intel_pmu_driver 0000:00:14.0: after pmu initiali
zation
[ 0.243008] Switching to clocksource refined-jiffies

[ 0.484336] intel_scu_flis rpmsg12: Probed flis rpmsg device

[ 0.484365] intel_scu_flis rpmsg12: Allocating rpmsg_instance

143

Display Message
[ 0.484526] intel_scu_flis intel_scu_flis: scu flis probed

[ 0.501485] pci_bus 0000:00: resource 4 [io 0x0000-0xffff]

[ 0.501513] pci_bus 0000:00: resource 5 [mem 0x00000000-0xfff
ffffff]
[ 0.501718] NET: Registered protocol family 2

[ 0.503090] TCP established hash table entries: 8192 (order:
4, 65536 bytes)
[ 0.503298] TCP bind hash table entries: 8192 (order: 5, 1638
40 bytes)
[ 0.503592] TCP: Hash tables configured (established 8192 bin
d 8192)
[ 0.503690] TCP: reno registered

[ 0.503720] UDP hash table entries: 512 (order: 2, 24576 byte
s)
[ 0.503787] UDP-Lite hash table entries: 512 (order: 2, 24576
bytes)
[ 0.504181] NET: Registered protocol family 1

[ 0.504690] RPC: Registered named UNIX socket transport modul
e.
[ 0.504710] RPC: Registered udp transport module.

[ 0.504724] RPC: Registered tcp transport module.

[ 0.504736] RPC: Registered tcp NFSv4.1 backchannel transport
module.
[ 0.507196] PCI: CLS 0 bytes, default 64

[ 0.507285] intel_scu_pmic rpmsg8: Probed pmic rpmsg device

[ 0.507306] intel_scu_pmic rpmsg8: Allocating rpmsg_instance

[ 0.507948] intel_scu_watchdog_evo rpmsg13: Probed watchdog r
pmsg device
[ 0.507972] intel_scu_watchdog_evo rpmsg13: Allocating rpmsg_
instance

144

Display Message
[ 0.508635] intel_scu_ipcutil rpmsg11: Probed ipcutil rpmsg d
evice
[ 0.508659] intel_scu_ipcutil rpmsg11: Allocating rpmsg_insta
nce
[ 0.508801] (oshob) base addr = 0xfffff000

[ 0.508817] (oshob) identified platform = INTEL_MID_CPU_CHIP_
TANGIER
[ 0.508834] (oshob) oshob version = 1.4

[ 0.508884] (latest extend oshob) osnib ptr = 0xfffff800

[ 0.508899] Using latest extended oshob structure size = 1024
bytes
[ 0.508912] OSNIB Intel size = 32 bytes OEMNIB size = 96 byte
s
[ 0.508926] (extend oshob) SCU buffer size is 16 bytes

[ 0.508991] [BOOT] RESETSRC0=0x00 RESETSRC1=0x00 (PMIT interr
upt tree)
[ 0.509064] [BOOT] SCU_TR[0]=0x00020011

[ 0.509079] [BOOT] SCU_TR[1]=0x00000220

[ 0.509092] [BOOT] SCU_TR[2]=0x00000000

[ 0.509104] [BOOT] SCU_TR[3]=0x00000000

[ 0.509116] [BOOT] IA_TR=0x00000000 (oshob)

[ 0.509448] [BOOT] RR=[fastboot] WD=0x00 ALARM=0x00 (osnib)

[ 0.509463] [BOOT] WAKESRC=[real reset] (osnib)

[ 0.509478] [BOOT] RESETSRC0=0x00 RESETSRC1=0x02 (osnib)

[ 0.509543] OEMNIB interface registered to debugfs

[ 0.509932] iio_basincove_gpadc rpmsg0: Probed bcove_gpadc rp
msg device

145

Display Message
[ 0.510620] bcove_adc bcove_adc: bcove adc probed

[ 0.511666] platform rtc_cmos: registered platform RTC device
(no PNP device)
[ 0.513696] cryptomgr_test (32) used greatest stack depth: 75
32 bytes left
[ 0.514079] cryptomgr_test (34) used greatest stack depth: 73
68 bytes left
[ 0.516146] vprog1: 1500 <--> 2800 mV at 2800 mV normal

[ 0.516880] vprog2: 1500 <--> 2850 mV at 2850 mV normal

[ 0.517574] vprog3: 1050 <--> 2800 mV at 1050 mV normal

[ 0.518873] audit: initializing netlink socket (disabled)

[ 0.518939] type=2000 audit(946684808.440:1): initialized

[ 0.667289] bounce pool size: 64 pages

[ 0.684289] NFS: Registering the id_resolver key type

[ 0.684356] Key type id_resolver registered

[ 0.684374] Key type id_legacy registered

[ 0.684405] Installing knfsd (copyright (C) 1996 okir@monad.s
wb.de).
[ 0.684890] fuse init (API version 7.22)

[ 0.685665] msgmni has been set to 1668

[ 0.686178] SELinux: Registering netfilter hooks

[ 0.689037] Key type asymmetric registered

[ 0.689059] Asymmetric key parser 'x509' registered

[ 0.689172] Block layer SCSI generic (bsg) driver version 0.4
loaded (major )

146

Display Message
[ 0.689396] io scheduler noop registered

[ 0.689660] io scheduler cfq registered (default)

[ 0.689676] list_sort_test: start testing list_sort()

[ 0.692804] intel_idle: MWAIT substates: 0x33000020

[ 0.692824] intel_idle: v0.4 model 0x4A

[ 0.692839] intel_idle: lapic_timer_reliable_states 0xfffffff
f
[ 0.693119] intel_mid_dma 0000:00:0e.0: setting latency timer
to 64
[ 0.693739] intel_mid_dma 0000:00:15.0: setting latency timer
to 64
[ 0.695441] HSU DMA 0000:00:05.0: FUNC: 0 driver: 5 addr:ff01
0400 len:400
[ 0.695709] HSU serial 0000:00:04.0: FUNC: 0 driver: 0 addr:f
f010000 len:80
[ 0.695766] HSU serial 0000:00:04.1: FUNC: 1 driver: 0 addr:f
f010080 len:80
[ 0.695847] Found a Intel HSU

[ 0.696669] 0000:00:04.1: ttyMFD0 at MMIO 0xff010080 (irq = 2
8) is a hsu_bt_p
[ 0.697211] HSU serial 0000:00:04.2: FUNC: 2 driver: 0 addr:f
f010100 len:80
[ 0.697298] Found a Intel HSU

[ 0.698098] 0000:00:04.2: ttyMFD1 at MMIO 0xff010100 (irq = 2
9) is a hsu_uarp
[ 0.698626] HSU serial 0000:00:04.3: FUNC: 3 driver: 0 addr:f
f010180 len:80
[ 0.698712] Found a Intel HSU

[ 0.699381] 0000:00:04.3: ttyMFD2 at MMIO 0xff010180 (irq = 5
4) is a hsu_uarp
[ 0.704499] console [ttyMFD2] enabled

147

Display Message
[ 0.705628] Non-volatile memory driver v1.3

[ 0.706300] Linux agpgart interface v0.103

[ 0.706799] [drm] Initialized drm 1.1.0 20060810

[ 0.720555] brd: module loaded

[ 0.727864] loop: module loaded

[ 0.729064] emmc_ipanic: init success

[ 0.729762] tun: Universal TUN/TAP device driver, 1.6

[ 0.729780] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm
.com>
[ 0.730193] usbcore: registered new interface driver asix

[ 0.730274] usbcore: registered new interface driver cdc_subs
et
[ 0.730406] usbcore: registered new interface driver cdc_ncm

[ 0.730667] dwc3_otg 0000:00:11.0: setting latency timer to 6
4
[ 0.732841] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHC
I) Driver
[ 0.733186] usbcore: registered new interface driver cdc_acm

[ 0.733203] cdc_acm: USB Abstract Control Model driver for US
B modems and ISs
[ 0.733305] usbcore: registered new interface driver usb-stor
age
[ 0.733483] usbcore: registered new interface driver usbseria
l
[ 0.733554] usbcore: registered new interface driver pl2303

[ 0.733623] usbserial: USB Serial support registered for pl23
03
[ 0.734536] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos
as rtc0

148

Display Message
[ 0.734690] rtc_cmos rtc_cmos: alarms up to one day, 114 byte
s nvram
[ 0.734753] i2c /dev entries driver

[ 0.874861] coretemp: Enabled Aux0/Aux1 interrupts for corete
mp
[ 0.874968] coretemp: Enabled Aux0/Aux1 interrupts for corete
mp
[ 0.974426] MCU detected and ready to used!

[ 0.974548] bcove_thrm rpmsg1: Probed mrfl_thermal rpmsg devi
ce
[ 0.978737] thermal thermal_zone0: failed to read out thermal
zone 0
[ 0.979307] thermal thermal_zone1: failed to read out thermal
zone 1
[ 0.979896] thermal thermal_zone2: failed to read out thermal
zone 2
[ 0.982658] Bluetooth: HCI UART driver ver 2.2

[ 0.982680] Bluetooth: HCI H4 protocol initialized

[ 0.983145] cpuidle: using governor ladder

[ 0.983750] cpuidle: using governor menu

[ 0.983819] sdhci: Secure Digital Host Controller Interface d
river
[ 0.983833] sdhci: Copyright(c) Pierre Ossman

[ 0.983909] sdhci-pci 0000:00:01.0: SDHCI controller found [8
086:1190] (rev )
[ 0.983993] flis_addr mapped addr: f8096900

[ 0.984114] sdhci-pci 0000:00:01.0: rte_addr mapped addr: f80
9a000
[ 0.984176] sdhci-pci 0000:00:01.0: setting latency timer to
64
[ 0.984205] mmc0: no vqmmc regulator found

149

Display Message
[ 1.076952] mmc0: BKOPS_EN bit is not set

[ 1.385771] mmc0: new HS200 MMC card at address 0001

[ 1.386619] mmcblk0: mmc0:0001 H4G1d 3.64 GiB

[ 1.387065] mmcblk0boot0: mmc0:0001 H4G1d partition 1 4.00 Mi
B
[ 1.387459] mmcblk0boot1: mmc0:0001 H4G1d partition 2 4.00 Mi
B
[ 1.387862] mmcblk0rpmb: mmc0:0001 H4G1d partition 3 4.00 MiB

[ 1.393538] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10

[ 1.401550] mmcblk0boot1: unknown partition table

[ 1.405108] mmcblk0boot0: unknown partition table

[ 1.405514] mmc0: SDHCI controller on PCI [0000:00:01.0] usin
g ADMA
[ 1.425026] emmc_ipanic: panic partition found, label:panic,
device:mmcblk0p6
[ 1.515147] Switching to clocksource tsc

[ 1.556071] emmc_ipanic: emmc_panic_notify_add: Data availabl
e in panic partn
[ 1.556120] emmc_ipanic: emmc_panic_notify_add: proc entry cr
eated: emmc_ipar
[ 1.556228] emmc_ipanic: emmc_panic_notify_add: log file 0(10
24, 40493)
[ 1.556262] emmc_ipanic: emmc_panic_notify_add: proc entry cr
eated: emmc_ipae
[ 1.556280] emmc_ipanic: emmc_panic_notify_add: log file 1(42
86578688, 0)
[ 1.556294] emmc_ipanic: emmc_panic_notify_add: empty log fil
e 1
[ 1.556309] emmc_ipanic: emmc_panic_notify_add: log file 2(42
86578688, 0)
[ 1.556323] emmc_ipanic: emmc_panic_notify_add: empty log fil
e 2

150

Display Message
[ 1.556416] sdhci-pci 0000:00:01.2: SDHCI controller found [8
086:1190] (rev )
[ 1.585478] sdhci-pci 0000:00:01.2: setting latency timer to
64
[ 1.585519] mmc1: no vqmmc regulator found

[ 1.585921] mmc1: SDHCI controller on PCI [0000:00:01.2] usin
g ADMA
[ 1.586104] sdhci-pci 0000:00:01.3: SDHCI controller found [8
086:1190] (rev )
[ 1.586225] vwlan gpio 96

[ 1.586596] vwlan: 1800 mV

[ 1.586852] sdhci-pci 0000:00:01.3: setting latency timer to
64
[ 1.586882] mmc2: no vqmmc regulator found

[ 1.587328] mmc2: SDHCI controller on PCI [0000:00:01.3] usin
g ADMA
[ 1.596235] hidraw: raw HID events driver (C) Jiri Kosina

[ 1.597073] usbcore: registered new interface driver usbhid

[ 1.597092] usbhid: USB HID core driver

[ 1.597174] intel_scu_fw_update rpmsg10: Probed fw_update rpm
sg device
[ 1.597195] intel_scu_fw_update rpmsg10: Allocating rpmsg_ins
tance
[ 1.602534] usbcore: registered new interface driver snd-usbaudio
[ 1.603619] snd_soc_sst_platform: Enter:sst_soc_probe

[ 1.899010] snd-soc-dummy snd-soc-dummy: ASoC: Failed to crea
te platform deby
[ 1.899235] merr_dpcm_dummy merr_dpcm_dummy.0: snd-soc-dummy
-dai <-> Headsek
[ 1.899372] merr_dpcm_dummy merr_dpcm_dummy.0: snd-soc-dummy
-dai <-> ssp2-ck

151

Display Message
[ 1.899498] merr_dpcm_dummy merr_dpcm_dummy.0: snd-soc-dummy
-dai <-> snd-sok
[ 1.901386] snd_merr_dpcm_probe successful

[ 1.901471] snd_intel_sst: INFO: ******** SST DRIVER loading.
. Ver: 3.0.8
[ 1.902016] snd_intel_sst: Got drv data max stream 25

[ 1.905999] snd_intel_sst: intel_sst_probe successfully done!

[ 1.906237] oprofile: using NMI interrupt.

[ 1.906381] Netfilter messages via NETLINK v0.30.

[ 1.906473] nf_conntrack version 0.5.0 (15351 buckets, 61404
max)
[ 1.907337] NF_TPROXY: Transparent proxy support initialized,
version 4.1.0
[ 1.907356] NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd
.
[ 1.907944] ip_tables: (C) 2000-2006 Netfilter Core Team

[ 1.908250] TCP: cubic registered

[ 1.908266] Initializing XFRM netlink socket

[ 1.909395] NET: Registered protocol family 10

[ 1.910728] ip6_tables: (C) 2000-2006 Netfilter Core Team

[ 1.911052] sit: IPv6 over IPv4 tunneling driver

[ 1.911981] NET: Registered protocol family 17

[ 1.912051] NET: Registered protocol family 15

[ 1.912197] Bridge firewalling registered

[ 1.912470] Bluetooth: RFCOMM TTY layer initialized

152

Display Message
[ 1.912530] Bluetooth: RFCOMM socket layer initialized

[ 1.912547] Bluetooth: RFCOMM ver 1.11

[ 1.912563] Bluetooth: BNEP (Ethernet Emulation) ver 1.3

[ 1.912576] Bluetooth: BNEP filters: protocol multicast

[ 1.912606] Bluetooth: BNEP socket layer initialized

[ 1.912620] Bluetooth: HIDP (Human Interface Emulation) ver 1
.2
[ 1.912647] Bluetooth: HIDP socket layer initialized

[ 1.912799] l2tp_core: L2TP core driver, V2.0

[ 1.912861] Key type dns_resolver registered

[ 1.914375] Using IPI No-Shortcut mode

[ 1.914419] info[ 0]: name = power_btn, gpio = -1

[ 1.914436] info[ 1]: name = SW1UI4, gpio = 61

[ 1.915620] registered taskstats version 1

[ 1.917348] snd_intel_sst: runtime_idle called

[ 1.917370] snd_intel_sst: runtime_suspend called

[ 2.062043] regulator-dummy: incomplete constraints, leaving
on
[ 2.062480] intel_mid_ssp_spi_unified 0000:00:07.0: found PCI
SSP controller)
[ 2.063430] intel_mid_ssp_spi_unified 0000:00:07.0: register
with SPI framew)
[ 2.063608] intel_mid_ssp_spi_unified 0000:00:07.0: master is
unqueued, thisd
[ 2.063639] intel_mid_ssp_spi_unified 0000:00:07.0: Unbalance
d pm_runtime_en!

153

Display Message
[ 2.065368] intel_mid_ssp_spi_unified 0000:00:07.1: found PCI
SSP controller)
[ 2.066305] intel_mid_ssp_spi_unified 0000:00:07.1: register
with SPI framew)
[ 2.066470] intel_mid_ssp_spi_unified 0000:00:07.1: master is
unqueued, thisd
[ 2.069231] intel_mid_ssp_spi_unified 0000:00:07.1: Unbalance
d pm_runtime_en!
[ 2.075879] intel_mid_ssp_spi_unified 0000:00:07.2: found PCI
SSP controller)
[ 2.076881] intel_mid_ssp_spi_unified 0000:00:07.2: register
with SPI framew)
[ 2.077059] intel_mid_ssp_spi_unified 0000:00:07.2: master is
unqueued, thisd
[ 2.077089] intel_mid_ssp_spi_unified 0000:00:07.2: Unbalance
d pm_runtime_en!
[ 2.085579] console [netcon0] enabled

[ 2.085599] netconsole: network logging started

[ 2.086234] input: gpio-keys as /devices/platform/gpio-keys/i
nput/input0
[ 2.086853] rtc_cmos rtc_cmos: setting system clock to 2000-0
1-01 00:00:10 U)
[ 2.086931] pmic_ccsm rpmsg3: Probed pmic_ccsm rpmsg device

[ 2.087133] pmic_ccsm pmic_ccsm: PMIC-ID: c9

[ 2.087155] pmic_ccsm pmic_ccsm: Error reading battery profil
e from battid fk
[ 2.096126] pmic_ccsm pmic_ccsm: Battery Over heat exception

[ 2.096208] pmic_ccsm pmic_ccsm: Battery0 temperature inside
boundary
[ 2.096275] pmic_ccsm pmic_ccsm: USB VBUS Detected. Notifying
OTG driver
[ 2.096442] pmic_ccsm pmic_ccsm: Battery Zone changed. Curren
t zone is 5
[ 2.111022] APIC ID: 0

154

Display Message
[ 2.111040] APIC ID: 2

[ 2.111104] Num p-states 2

[ 2.111122] State [0]: core_frequency[500] transition_latency
[100] control[0]
[ 2.111138] State [1]: core_frequency[500] transition_latency
[100] control[0]
[ 2.111344] Num p-states 2

[ 2.111364] State [0]: core_frequency[500] transition_latency
[100] control[0]
[ 2.111379] State [1]: core_frequency[500] transition_latency
[100] control[0]
[ 2.111880] msic_power_btn rpmsg2: Probed mid_pb rpmsg device

[ 2.112007] msic_power_btn mid_powerbtn: Probed mid powerbutt
on devivce
[ 2.112437] input: mid_powerbtn as /devices/platform/mid_powe
rbtn/input/inpu1
[ 2.114079] ALSA device list:

[ 2.114099] #0: Loopback 1

[ 2.114113] #1: dummy-audio

[ 2.130409] mmc2: queuing unknown CIS tuple 0x91 (3 bytes)

[ 2.130449] mmc2: new ultra high speed DDR50 SDIO card at add
ress 0001
[ 2.175236] EXT4-fs (mmcblk0p8): INFO: recovery required on r
eadonly filesysm
[ 2.175262] EXT4-fs (mmcblk0p8): write access will be enabled
during recovery
[ 2.202748] EXT4-fs (mmcblk0p8): recovery complete

[ 2.204675] EXT4-fs (mmcblk0p8): mounted filesystem with orde
red data mode. )
[ 2.204770] VFS: Mounted root (ext4 filesystem) readonly on d
evice 179:8.

155

Display Message
[ 2.207393] devtmpfs: mounted

[ 2.207758] Freeing unused kernel memory: 560k freed

[ 2.208484] Write protecting the kernel text: 7108k

[ 2.209110] Write protecting the kernel read-only data: 2956k

[ 2.209124] NX-protecting the kernel data: 5180k

[ 2.432593] systemd[1]: systemd 213 running in system mode. (
+PAM -AUDIT -SE)
[ 2.434069] systemd[1]: Detected architecture 'x86'.

[ 2.547614] systemd[1]: Set hostname to <edison>.

[ 2.555008] systemd[1]: Hardware watchdog 'Intel_SCU IOH Watc
hdog', version 0
[ 2.555094] systemd[1]: Set hardware watchdog to 1min 30s.

[ 2.574478] systemd-getty-g (97) used greatest stack depth: 6
372 bytes left
[ 2.583649] systemd-fstab-generator[102]: Checking was reques
ted for "rootfs.
[ 2.587348] systemd-efi-boo (100) used greatest stack depth:
6300 bytes left
[ 2.771628] systemd[1]: [/lib/systemd/system/wyliodrin-server
.service:3] Fait
[ 2.774813] systemd[1]: [/lib/systemd/system/wyliodrin-hyperv
isor.service:3]t
[ 2.778573] systemd[1]: Configuration file /lib/systemd/syste
m/connman-init..
[ 2.788255] systemd[1]: [/lib/systemd/system/redis.service:7]
Unknown lvalue'
[ 2.832092] systemd[1]: Expecting device dev-ttyMFD2.device..
.
[ 2.895498] systemd[1]: Starting Forward Password Requests to
Wall Directory.
[ 2.896132] systemd[1]: Started Forward Password Requests to
Wall Directory .

156

Display Message
[ 2.896262] systemd[1]: Starting Remote File Systems.

[ 2.945393] systemd[1]: Reached target Remote File Systems.

[ 2.945521] systemd[1]: Expecting device dev-disk-by\x2dpartl
abel-factory.de.
[ 2.995412] systemd[1]: Expecting device sys-subsystem-net-de
vices-usb0.devi.
[ 3.045449] systemd[1]: Starting Dispatch Password Requests t
o Console Direc.
[ 3.045884] systemd[1]: Started Dispatch Password Requests to
Console Direct.
[ 3.045999] systemd[1]: Starting Paths.

[ 3.095377] systemd[1]: Reached target Paths.

[ 3.095495] systemd[1]: Starting Swap.

[ 3.145363] systemd[1]: Reached target Swap.

[ 3.145483] systemd[1]: Starting boot.automount.

[ 3.207546] systemd[1]: boot.automount: Directory /boot to mo
unt over is not.
[ 3.255469] systemd[1]: Set up automount boot.automount.

[ 3.255629] systemd[1]: Starting Root Slice.

[ 3.375338] systemd[1]: Created slice Root Slice.

[ 3.375469] systemd[1]: Starting User and Session Slice.

[ 3.425366] systemd[1]: Created slice User and Session Slice.

[ 3.425492] systemd[1]: Starting Delayed Shutdown Socket.

[ 3.475322] systemd[1]: Listening on Delayed Shutdown Socket.

[ 3.475443] systemd[1]: Starting /dev/initctl Compatibility N
amed Pipe.

157

Display Message
[ 3.525315] systemd[1]: Listening on /dev/initctl Compatibili
ty Named Pipe.
[ 3.525471] systemd[1]: Starting udev Control Socket.

[ 3.575309] systemd[1]: Listening on udev Control Socket.

[ 3.575452] systemd[1]: Starting udev Kernel Socket.

[ 3.625313] systemd[1]: Listening on udev Kernel Socket.

[ 3.625467] systemd[1]: Starting Journal Socket.

[ 3.675294] systemd[1]: Listening on Journal Socket.

[ 3.675489] systemd[1]: Starting System Slice.

[ 3.725311] systemd[1]: Created slice System Slice.

[ 3.725451] systemd[1]: Mounting Temporary Directory...

[ 3.840607] systemd[1]: Starting system-serial\x2dgetty.slice
.
[ 3.905398] systemd[1]: Created slice system-serial\x2dgetty.
slice.
[ 3.905551] systemd[1]: Starting system-getty.slice.

[ 3.955314] systemd[1]: Created slice system-getty.slice.

[ 4.018359] systemd[1]: Starting Create list of required stat
ic device nodes.
[ 4.069391] systemd[1]: Starting udev Coldplug all Devices...

[ 4.134053] systemd[1]: Starting Load Kernel Modules...

[ 4.180131] systemd[1]: Mounting Debug File System...

[ 4.229218] systemd[1]: Mounted Huge Pages File System.

[ 4.229467] systemd[1]: Mounting POSIX Message Queue File Sys
tem...

158

Display Message
[ 4.274374] systemd[1]: Starting Apply Kernel Variables...

[ 4.289982] dhd_module_init in

[ 4.290014] found wifi platform device wlan

[ 4.290121] Power-up adapter 'DHD generic adapter'

[ 4.298696] systemd[1]: Starting Journal Service...

[ 4.403314] systemd[1]: Started Journal Service.

[ 4.555268] EXT4-fs (mmcblk0p8): re-mounted. Opts: discard,ba
rrier=1,data=orc
[ 4.715961] wifi_platform_set_power = 1

[ 4.924894] wifi_platform_bus_enumerate device present 1

[ 4.950710] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter

[ 4.950934] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter

[ 4.950955] bus num (host idx)=2, slot num (rca)=1

[ 4.950970] found adapter info 'DHD generic adapter'

[ 4.961330] F1 signature OK, socitype:0x1 chip:0xa94c rev:0x2
pkg:0x0
[ 4.962881] DHD: dongle ram size is set to 524288(orig 524288
) at 0x0
[ 4.964657] wifi_platform_get_mac_addr

[ 4.964739] wifi_get_mac_addr_intel: unable to open /config/w
ifi/mac.txt
[ 4.965948] wl_create_event_handler(): thread:wl_event_handle
r:7e started
[ 4.974874] CFG80211-ERROR) wl_event_handler : tsk Enter, tsk
= 0xf5001540
[ 4.975006] dhd_attach(): thread:dhd_watchdog_thread:7f start
ed

159

Display Message
[ 4.984966] dhd_attach(): thread:dhd_dpc:80 started

[ 4.985000] dhd_deferred_work_init: work queue initialized

[ 4.985615] Dongle Host Driver, version 1.141.59 (r)

Compiled in /export/users/neck/iotdk_3.5_dev/workdir/build_ediso
n/tmp/work/edis7
[ 4.986705] Register interface [wlan0] MAC: 00:00:00:00:00:0
0
[ 4.986734] dhd_prot_ioctl : bus is down. we have nothing to
do
[ 4.987346] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter

[ 4.987472] wifi_platform_set_power = 0

[ 4.988557] wifi_platform_bus_enumerate device present 0

[ 5.064149] g_multi gadget: using random host ethernet addres
s
[ 5.065334] usb0: MAC 02:00:86:58:c2:af

[ 5.065357] usb0: HOST MAC d2:aa:a7:ff:43:58

[ 5.084993] g_multi gadget: Mass Storage Function, version: 2
009/09/11
[ 5.085020] g_multi gadget: Number of LUNs=1

[ 5.085048] lun0: LUN: file: /dev/mmcblk0p9

[ 5.085247] g_multi gadget: Multifunction Composite Gadget

[ 5.085266] g_multi gadget: g_multi ready

[ 5.097795] systemd-modules (109) used greatest stack depth:
5444 bytes left
[ 5.855125] systemd-udevd[143]: starting version 213

[ 6.227320] systemd-journald[117]: Received request to flush

160

Display Message
runtime journal1
[ 6.361626] g_multi gadget: high-speed config #2: Multifuncti
on with CDC ECM
[ 7.142147] EXT4-fs (mmcblk0p5): mounted filesystem without j
ournal. Opts: dc
[ 10.851914] EXT4-fs (mmcblk0p10): mounted filesystem with ord
ered data mode.c
[ 12.004007] snd_intel_sst: runtime_resume called

[ 12.034532] snd_intel_sst: FW Version 01.09.00.02

[ 12.034558] snd_intel_sst: Build date Jan 14 2014 Time 20:08:
46
[ 12.034669] snd_intel_sst: Alloc for str 14 pipe 0xe

[ 12.263921] snd_intel_sst: Free for str 14 pipe 0xe

[ 12.265521] snd_intel_sst: runtime_idle called

[ 12.354303] snd_intel_sst: Alloc for str 14 pipe 0xe

[ 12.473929] snd_intel_sst: Free for str 14 pipe 0xe

[ 12.475351] snd_intel_sst: runtime_idle called

[ 12.502515] snd_intel_sst: Alloc for str 1 pipe 0x90

[ 12.697170] snd_intel_sst: Alloc for str 14 pipe 0xe

[ 12.702996] snd_intel_sst: Free for str 14 pipe 0xe

[ 12.724261] snd_intel_sst: Alloc for str 14 pipe 0xe

[ 12.728953] snd_intel_sst: Free for str 14 pipe 0xe

[ 12.731250] snd_intel_sst: Free for str 1 pipe 0x90

[ 12.733716] snd_intel_sst: runtime_idle called

[ 12.794060] snd_intel_sst: Alloc for str 1 pipe 0x90

161

Display Message

[ 12.959715] snd_intel_sst: Start for str 1 pipe 0x90

[ 12.975143] snd_intel_sst: Alloc for str 14 pipe 0xe

[ 13.035501] snd_intel_sst: Start for str 14 pipe 0xe

[ 18.668303] snd_intel_sst: Stop for str 14 pipe 0xe

[ 18.668980] snd_intel_sst: Free for str 14 pipe 0xe

[ 18.673752] snd_intel_sst: Stop for str 1 pipe 0x90

[ 18.674629] snd_intel_sst: Free for str 1 pipe 0x90

[ 18.677124] snd_intel_sst: runtime_idle called

[ 20.673034] snd_intel_sst: runtime_suspend called

root@edison:~#

162

Modules

Modules
In computing, a loadable kernel module (or LKM) is an object file that contains
code to extend the running kernel, or so-called base kernel, of an operating
system. LKMs are typically used to add support for new hardware (as device
drivers) and/or filesystems, or for adding system calls. Wikipedia

Project: Hello World Kernel Module


Automatic Startup
root@edison:~# cd kernelmodule
root@edison:~/kernelmodule# make clean
root@edison:~/kernelmodule# ls
Makefile helloworld.c

root@edison:~/kernelmodule# make
make -C /lib/modules/3.10.17-poky-edison+/build M=/home/root/ker
nelmodule modules
make[1]: Entering directory '/home/root/usr/src/linux-headers-3.
10.17-poky-edison'
CC [M] /home/root/kernelmodule/helloworld.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/root/kernelmodule/helloworld.mod.o
LD [M] /home/root/kernelmodule/helloworld.ko
make[1]: Leaving directory '/home/root/usr/src/linux-headers-3.1
0.17-poky-edison'
root@edison:~/kernelmodule#

root@edison:~/kernelmodule# cp helloworld.ko /lib/modules/3.10.1


7-poky-edison+/kernel/drivers/

163

Modules

root@edison:~/kernelmodule# ls /usr/lib/modules-load.d/
root@edison:~/kernelmodule#

root@edison:~/kernelmodule# echo helloworld > /usr/lib/modules-l


oad.d/helloworld
root@edison:~/kernelmodule# depmod -a

Release v3.5 Yocto Default Loaded Kernel


Modules
root@edison:~# lsmod
Module Size Used by
usb_f_acm 14335 1

u_serial 18582 6 usb_f_acm

g_multi 70924 0

libcomposite 39238 2 usb_f_acm,g_multi

bcm_bt_lpm 13708 0

bcm4334x 587105 0

Release v3.0 Yocto Default Loaded Kernel


Modules

164

Modules

root@edison:~# lsmod
Module Size Used by
usb_f_acm 14335 1

u_serial 18582 6 usb_f_acm

g_multi 70924 0

libcomposite 39238 2 usb_f_acm,g_multi

bcm_bt_lpm 13708 0

bcm4334x 587105 0

Release v2.1 Yocto Default Loaded Kernel


Modules
root@edison:~# lsmod
Module Size Used by
usb_f_acm 14335 1
u_serial 18582 6 usb_f_acm
g_multi 70924 0
libcomposite 39245 2 usb_f_acm,g_multi
bcm_bt_lpm 13708 0
bcm4334x 587105 0

Search for the name of the default loaded


kernel modules

165

Modules

root@edison:~# modinfo iwlwifi


filename: /lib/modules/3.10.17-poky-edison+/extra/bcm4334x
.ko
license: GPL v2
alias: sdio:c*v02D0dA94D*
depends:
vermagic: 3.10.17-poky-edison+ SMP preempt mod_unload ATOM
parm: dhd_doflow:uint
parm: dhd_dpcpoll:uint
parm: clockoverride:SDIO card clock override (int)
parm: sd_msglevel:uint
parm: sd_power:uint
parm: sd_clock:uint
parm: sd_divisor:uint
parm: sd_sdmode:uint
parm: sd_hiok:uint
parm: sd_f2_blocksize:int
parm: info_string:string
parm: op_mode:int
parm: dhd_msg_level:int
parm: dhd_arp_enable:uint

root@edison:~# nano searchm.sh

for mod in `cat /proc/modules | cut -d " " -f 1`


do
desc=`modinfo -d $mod`
printf "%-20s $desc\n" "$mod:"
done

Output

166

Modules

root@edison:~# sh searchm.sh
usb_f_acm:
u_serial:
g_multi: Multifunction Composite Gadget
libcomposite:
bcm_bt_lpm: bcm43xx_bluetooth
bcm4334x:

Search for a specific kernel module loaded


or compiled
root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e 'uvc'
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/uvc
root@edison:~/IntelEdison/examples# opkg install kernel-modu
le-uvcvideo
Package kernel-module-uvcvideo (3.10.17-r0) installed in roo
t is up to date.
root@edison:~/IntelEdison/examples# lsmod | grep uvc
root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e 'snd'
root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e 'audio'
root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e 'alsa'
root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e ''

Intel Edison Linux Kernel all modules


Release v3.5 Yocto
root@edison:~# find /lib/modules/* -name '*'

167

Modules

/lib/modules/3.10.98-poky-edison+

/lib/modules/3.10.98-poky-edison+/modules.dep

/lib/modules/3.10.98-poky-edison+/modules.alias

/lib/modules/3.10.98-poky-edison+/modules.symbols

/lib/modules/3.10.98-poky-edison+/modules.dep.bin

/lib/modules/3.10.98-poky-edison+/modules.builtin.bin

/lib/modules/3.10.98-poky-edison+/modules.builtin

/lib/modules/3.10.98-poky-edison+/modules.softdep

/lib/modules/3.10.98-poky-edison+/modules.devname

/lib/modules/3.10.98-poky-edison+/modules.symbols.bin

/lib/modules/3.10.98-poky-edison+/kernel

/lib/modules/3.10.98-poky-edison+/kernel/net

/lib/modules/3.10.98-poky-edison+/kernel/net/mac80211

/lib/modules/3.10.98-poky-edison+/kernel/net/mac80211/mac80211.k
o
/lib/modules/3.10.98-poky-edison+/kernel/arch

/lib/modules/3.10.98-poky-edison+/kernel/arch/x86

/lib/modules/3.10.98-poky-edison+/kernel/arch/x86/kernel

/lib/modules/3.10.98-poky-edison+/kernel/arch/x86/kernel/test_nx
.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers

/lib/modules/3.10.98-poky-edison+/kernel/drivers/net

168

Modules

/lib/modules/3.10.98-poky-edison+/kernel/drivers/net/usb

/lib/modules/3.10.98-poky-edison+/kernel/drivers/net/usb/rtl8150
.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/net/usb/r8152.k
o
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb

/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/gadget

/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/gadget/u_se
rial.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/gadget/libc
omposite.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/gadget/g_mu
lti.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/gadget/usb_
f_acm.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/serial

/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/serial/cp21
0x.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/usb/serial/ftdi
_sio.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/staging

/lib/modules/3.10.98-poky-edison+/kernel/drivers/staging/iio

/lib/modules/3.10.98-poky-edison+/kernel/drivers/staging/iio/tri
gger
/lib/modules/3.10.98-poky-edison+/kernel/drivers/staging/iio/tri
gger/iio-trig-so
/lib/modules/3.10.98-poky-edison+/kernel/drivers/misc

/lib/modules/3.10.98-poky-edison+/kernel/drivers/misc/bcm-lpm

/lib/modules/3.10.98-poky-edison+/kernel/drivers/misc/bcm-lpm/bc
m_bt_lpm.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media

169

Modules

/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/v4l2-core

/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/v4l2-core
/videobuf2-coreo
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/v4l2-core
/videobuf2-vmalo
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/v4l2-core
/videobuf2-memoo
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb

/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/uvc

/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/uvc/u
vcvideo.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/gspca

/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/gspca
/gspca_ov534_9.o
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/gspca
/gspca_ov534.ko
/lib/modules/3.10.98-poky-edison+/kernel/drivers/media/usb/gspca
/gspca_main.ko
/lib/modules/3.10.98-poky-edison+/extra

/lib/modules/3.10.98-poky-edison+/extra/bcm4334x.ko

/lib/modules/3.10.98-poky-edison+/modules.alias.bin

/lib/modules/3.10.98-poky-edison+/modules.order

root@edison:~#

Release v3.0 Yocto


root@edison:~/IntelEdison/examples# find /lib/modules/* -nam
e '*'
/lib/modules/3.10.17-yocto-standard

170

Modules
/lib/modules/3.10.17-yocto-standard/modules.devname
/lib/modules/3.10.17-yocto-standard/modules.dep
/lib/modules/3.10.17-yocto-standard/modules.alias.bin
/lib/modules/3.10.17-yocto-standard/modules.builtin.bin
/lib/modules/3.10.17-yocto-standard/modules.order
/lib/modules/3.10.17-yocto-standard/modules.softdep
/lib/modules/3.10.17-yocto-standard/extra
/lib/modules/3.10.17-yocto-standard/extra/bcm4334x.ko
/lib/modules/3.10.17-yocto-standard/modules.symbols
/lib/modules/3.10.17-yocto-standard/modules.builtin
/lib/modules/3.10.17-yocto-standard/modules.dep.bin
/lib/modules/3.10.17-yocto-standard/modules.alias
/lib/modules/3.10.17-yocto-standard/kernel
/lib/modules/3.10.17-yocto-standard/kernel/net
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
state.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
length.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
NETMAP.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_broadcast.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
connbytes.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_proto_sctp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nfn
etlink_queue.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_ftp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
policy.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
helper.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
CT.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_

171

Modules
ecn.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_proto_gre.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_irc.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
NFQUEUE.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
string.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
limit.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_netbios_ns.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
realm.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
CLASSIFY.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
connmark.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
connlimit.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_sip.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_ftp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
TRACE.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_sane.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
tcpmss.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_h323.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
mac.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
esp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_

172

Modules
conntrack_amanda.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
pkttype.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
multiport.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_proto_udplite.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nfn
etlink_log.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nfn
etlink.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
dscp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_proto_udplite.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
NFLOG.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_tftp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
cluster.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
tproxy_core.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
dccp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
TCPMSS.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_sip.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_pptp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
conntrack_netlink.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
sctp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_tftp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
DSCP.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_

173

Modules
socket.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_proto_sctp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
u32.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_amanda.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
statistic.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
quota.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
comment.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
hashlimit.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
REDIRECT.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/nf_
nat_irc.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
nat.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/netfilter/xt_
conntrack.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/mac80211
/lib/modules/3.10.17-yocto-standard/kernel/net/mac80211/mac8
0211.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv6
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv6/netfilte
r
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv6/netfilte
r/nf_defrag_ipv6.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_nat_pptp.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/arp_tables.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_nat_h323.ko

174

Modules
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/arptable_filter.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_ah.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_defrag_ipv4.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/iptable_filter.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/iptable_nat.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ip_tables.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/iptable_raw.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_CLUSTERIP.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_conntrack_ipv4.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_ULOG.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_nat_proto_gre.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/arpt_mangle.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_REJECT.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_MASQUERADE.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/iptable_mangle.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/nf_nat_ipv4.ko
/lib/modules/3.10.17-yocto-standard/kernel/net/ipv4/netfilte
r/ipt_ECN.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/v4l
2-core
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/v4l
2-core/videobuf2-vmalloc.ko

175

Modules
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/v4l
2-core/videobuf2-memops.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/v4l
2-core/videobuf2-core.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/uvc
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/uvc/uvcvideo.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/gspca
/lib/modules/3.10.17-yocto-standard/kernel/drivers/media/usb
/gspca/gspca_main.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/staging
/lib/modules/3.10.17-yocto-standard/kernel/drivers/staging/i
io
/lib/modules/3.10.17-yocto-standard/kernel/drivers/staging/i
io/trigger
/lib/modules/3.10.17-yocto-standard/kernel/drivers/staging/i
io/trigger/iio-trig-sysfs.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/seria
l
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/seria
l/cp210x.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/gadge
t
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/gadge
t/usb_f_acm.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/gadge
t/u_serial.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/gadge
t/g_multi.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/usb/gadge
t/libcomposite.ko
/lib/modules/3.10.17-yocto-standard/kernel/drivers/misc
/lib/modules/3.10.17-yocto-standard/kernel/drivers/misc/bcmlpm
/lib/modules/3.10.17-yocto-standard/kernel/drivers/misc/bcmlpm/bcm_bt_lpm.ko

176

Modules
/lib/modules/3.10.17-yocto-standard/kernel/lib
/lib/modules/3.10.17-yocto-standard/kernel/lib/ts_kmp.ko
/lib/modules/3.10.17-yocto-standard/kernel/lib/ts_fsm.ko
/lib/modules/3.10.17-yocto-standard/kernel/lib/ts_bm.ko
/lib/modules/3.10.17-yocto-standard/kernel/fs
/lib/modules/3.10.17-yocto-standard/kernel/fs/aufs
/lib/modules/3.10.17-yocto-standard/kernel/fs/aufs/aufs.ko
/lib/modules/3.10.17-yocto-standard/kernel/arch
/lib/modules/3.10.17-yocto-standard/kernel/arch/x86
/lib/modules/3.10.17-yocto-standard/kernel/arch/x86/kernel
/lib/modules/3.10.17-yocto-standard/kernel/arch/x86/kernel/t
est_nx.ko
/lib/modules/3.10.17-yocto-standard/modules.symbols.bin

177

Filesystem

Filesystem
In computing, a file system (or filesystem) is used to control how data is
stored and retrieved. Without a file system, information placed in a storage
area would be one large body of data with no way to tell where one piece of
information stops and the next begins. By separating the data into pieces and
giving each piece a name, the information is easily isolated and identified.
Taking its name from the way paper-based information systems are named,
each group of data is called a "file". The structure and logic rules used to
manage the groups of information and their names is called a "file system".
Wikipedia

File System Type


Release v3.5 Yocto

178

Filesystem

root@edison:~# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/root 1.4G 1017M 312M 77% /

devtmpfs 480M 0 480M 0% /dev

tmpfs 481M 0 481M 0% /dev/shm

tmpfs 481M 588K 480M 1% /run

tmpfs 481M 0 481M 0% /sys/fs/cgroup

tmpfs 481M 4.0K 481M 1% /tmp

/dev/mmcblk0p10 1.3G 2.1M 1.3G 1% /home

tmpfs 481M 6.1M 474M 2% /var/volatile

/dev/mmcblk0p5 1003K 19K 913K 3% /factory

tmpfs 97M 0 97M 0% /run/user/0

/dev/loop0 767M 4.0K 767M 1% /media/storage
root@edison:~#

Release v3.0 Yocto

179

Filesystem

root@edison:~# df -h
Filesystem Type 1K-blocks Used Available Use% Mounte
d on
/dev/root ext4 1444528 1125392 228656 84% /
devtmpfs devtmpfs 491264 0 491264 0% /dev
tmpfs tmpfs 491548 0 491548 0% /dev/s
hm
tmpfs tmpfs 491548 588 490960 1% /run
tmpfs tmpfs 491548 0 491548 0% /sys/f
s/cgroup
tmpfs tmpfs 491548 3108 488440 1% /tmp
/dev/mmcblk0p10 ext4 1337936 17368 1304184 2% /home
tmpfs tmpfs 491548 6164 485384 2% /var/v
olatile
/dev/mmcblk0p5 ext4 1003 19 913 3% /facto
ry
tmpfs tmpfs 98312 0 98312 0% /run/u
ser/0
/dev/loop0 vfat 784872 4 784868 1% /media
/storage

root@edison:~# mount
/dev/mmcblk0p8 on / type ext4 (rw,nodev,noatime,discard,noauto_d
a_alloc,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=491264k,nr_inod
es=122816,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=
755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,no
exec,relatime,xattr,release_agent=/lib)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,rel
atime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noe

180

Filesystem
xec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,node
v,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,no
exec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,no
exec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noex
ec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev
,noexec,relatime,perf_event)
systemd-1 on /boot type autofs (rw,relatime,fd=22,pgrp=1,timeout
=300,minproto=5,maxproto=5,direct)
tmpfs on /tmp type tmpfs (rw)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
systemd-1 on /home type autofs (rw,relatime,fd=31,pgrp=1,timeout
=300,minproto=5,maxproto=5,direct)
tmpfs on /var/volatile type tmpfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p5 on /factory type ext4 (ro,nosuid,nodev,noatime,di
scard,noauto_da_alloc)
/dev/mmcblk0p10 on /home type ext4 (rw,nosuid,nodev,noatime,disc
ard,noauto_da_alloc,data=ordered)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=9
8312k,mode=700)
/dev/mmcblk0p9 on /media/storage type vfat (ro,relatime,fmask=00
22,dmask=0022,codepage=437,iocharset=i)

File System Disk Space Usage


Release v3.5 Yocto, Fresh Installation

181

Filesystem

root@edison:~# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/root 1.4G 1017M 312M 77% /

devtmpfs 480M 0 480M 0% /dev

tmpfs 481M 0 481M 0% /dev/shm

tmpfs 481M 588K 480M 1% /run

tmpfs 481M 0 481M 0% /sys/fs/cgroup

tmpfs 481M 4.0K 481M 1% /tmp

/dev/mmcblk0p10 1.3G 2.1M 1.3G 1% /home

tmpfs 481M 6.1M 474M 2% /var/volatile

/dev/mmcblk0p5 1003K 19K 913K 3% /factory

tmpfs 97M 0 97M 0% /run/user/0

/dev/loop0 767M 4.0K 767M 1% /media/storage
root@edison:~#

Release v3.0 Yocto, Fresh Installation

182

Filesystem

root@edison:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 1.4G 958M 365M 73% /
devtmpfs 480M 0 480M 0% /dev
tmpfs 481M 0 481M 0% /dev/shm
tmpfs 481M 592K 480M 1% /run
tmpfs 481M 0 481M 0% /sys/fs/cgroup
tmpfs 481M 42M 439M 9% /tmp
tmpfs 481M 6.1M 475M 2% /var/volatile
tmpfs 97M 0 97M 0% /run/user/0
/dev/loop0 767M 4.0K 767M 1% /media/storage
/dev/mmcblk0p10 1.3G 2.1M 1.3G 1% /home
/dev/mmcblk0p5 1003K 19K 913K 3% /factory

Release v2.1 Yocto, Fresh Installation


root@edison:~# df -h
Filesystem Size Used Available Use% Moun
ted on
/dev/root 1.4G 428.6M 934.8M 31% /
devtmpfs 479.8M 0 479.8M 0% /dev
tmpfs 480.1M 0 480.1M 0% /dev
/shm
tmpfs 480.1M 528.0K 479.5M 0% /run
tmpfs 480.1M 0 480.1M 0% /sys
/fs/cgroup
tmpfs 480.1M 4.0K 480.1M 0% /tmp
systemd-1 5.8M 5.3M 456.0K 92% /boo
t
tmpfs 480.1M 0 480.1M 0% /var
/volatile
/dev/mmcblk0p7 5.8M 5.3M 456.0K 92% /boo
t
/dev/mmcblk0p10 1.3G 2.0M 1.3G 0% /hom
e
/dev/mmcblk0p5 1003.0K 19.0K 913.0K 2% /fac
tory

183

Filesystem

Ubilinux, Fresh Installation


edison@ubilinux:~$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 1.4G 812M 504M 62% /
/dev/root 1.4G 812M 504M 62% /
devtmpfs 480M 0 480M 0% /dev
tmpfs 97M 292K 96M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 193M 0 193M 0% /run/shm
tmpfs 481M 0 481M 0% /tmp
/dev/mmcblk0p7 32M 5.3M 27M 17% /boot
/dev/mmcblk0p10 1.3G 2.0M 1.3G 1% /home

File System Disk Space Free Up


root@edison:~# mv /var/cache /home
root@edison:~# cd /var
root@edison:~# ln -sf /home/cache cache
root@edison:~# mv /usr/share /home
root@edison:~# cd /usr
root@edison:~# ln -sf /home/share share

Get additional 800 MB disk space

File System Disk Space uSD


ToDo
How to boot Edison from an SD card (Linux)

File System Disk Space Encryption


ToDo

184

Filesystem

185

Memory

Memory
root@edison:~# free -m

total used free shared b
uffers
Mem: 983068 142684 840384 0
9548
-/+ buffers: 133136 849932

Swap: 0 0 0

root@edison:~#

186

Backup

Backup
Use dd to backup Intel Edison MMC
root@edison:~# dmesg
[420794.481542] mmc1: new high speed SDHC card at address 1234
[420794.482480] mmcblk1: mmc1:1234 SA16G 14.4 GiB
[420794.484152] mmcblk1: p1

root@edison:~# dd if=/dev/mmcblk0 of=/dev/mmcblk1

root@edison:~# fdisk /dev/mmcblk0



GPT PMBR size mismatch (7634944 != 7634943) will be corrected by
w(rite).
Welcome to fdisk (util-linux 2.24.2).

Changes will remain in memory only, until you decide to write th
em.
Be careful before using the write command.

Command (m for help): p



Disk /dev/mmcblk0: 3.7 GiB, 3909091328 bytes, 7634944 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: gpt

187

Backup
Disk identifier: 21200400-0804-0146-9DCC-A8C51255994F

Device Start End Size Type

/dev/mmcblk0p1 2048 6143 2M Microsoft basic
data
/dev/mmcblk0p2 6144 8191 1M Microsoft basic
data
/dev/mmcblk0p3 8192 12287 2M Microsoft basic
data
/dev/mmcblk0p4 12288 14335 1M Microsoft basic
data
/dev/mmcblk0p5 14336 16383 1M Microsoft basic
data
/dev/mmcblk0p6 16384 65535 24M Microsoft basic
data
/dev/mmcblk0p7 65536 131071 32M Microsoft basic
data
/dev/mmcblk0p8 131072 3276799 1.5G Microsoft basic
data
/dev/mmcblk0p9 3276800 4849663 768M Microsoft basic
data
/dev/mmcblk0p10 4849664 7634910 1.3G Microsoft basic
data

root@edison:~# fdisk /dev/mmcblk1


GPT PMBR size mismatch (7634944 != 30367743) will be corrected b
y w(rite).
The backup GPT table is corrupt, but the primary appears OK, so
that will be us.
Welcome to fdisk (util-linux 2.24.2).
Changes will remain in memory only, until you decide to write th
em.
Be careful before using the write command.

Command (m for help): p

188

Backup
Disk /dev/mmcblk1: 14.5 GiB, 15548284928 bytes, 30367744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 21200400-0804-0146-9DCC-A8C51255994F
Device Start End Size Type

/dev/mmcblk1p1 2048 6143 2M Microsoft basic
data
/dev/mmcblk1p2 6144 8191 1M Microsoft basic
data
/dev/mmcblk1p3 8192 12287 2M Microsoft basic
data
/dev/mmcblk1p4 12288 14335 1M Microsoft basic
data
/dev/mmcblk1p5 14336 16383 1M Microsoft basic
data
/dev/mmcblk1p6 16384 65535 24M Microsoft basic
data
/dev/mmcblk1p7 65536 131071 32M Microsoft basic
data
/dev/mmcblk1p8 131072 3276799 1.5G Microsoft basic
data
/dev/mmcblk1p9 3276800 4849663 768M Microsoft basic
data
/dev/mmcblk1p10 4849664 7634910 1.3G Microsoft basic
data

189

Recovery

Recovery
Intel Edison Bricked
Setting Up a New Intel Edison Create a Backup

190

Reboot

Reboot
root@edison:~# reboot
Unmounting /home...
Stopping User Manager for UID 0...
Stopping Hostname Service...
Stopping Bluetooth service...
Stopping Redis Server...
Stopping Watchdog sample daemon...
Starting Store Sound Card State...
[ OK ] Stopped Watchdog sample daemon.

[ OK ] Stopped Bluetooth service.

[ OK ] Stopped Hostname Service.

[ OK ] Stopped Serial Getty on ttyMFD2.

[ OK ] Stopped The Edison status and configuration service.

[ OK ] Stopped User Manager for UID 0.

[ OK ] Unmounted /home.

[ OK ] Stopped Redis Server.

[ OK ] Started Store Sound Card State.

[ OK ] Removed slice user-0.slice.

[ OK ] Stopped target Multi-User System.

Stopping Edison PWR button handler...

Unmounting Mount for factory...

Stopping Mosquitto - lightweight server implementati...

191

Reboot
SN protocols...
Stopping Intel_XDK_Daemon...

Stopping Network Name Resolution...

Stopping PulseAudio Sound System...

Stopping Telephony service...

Stopping Daemon to reset sketches...

Stopping OpenSSH Key Generation...

[ OK ] Stopped OpenSSH Key Generation.

Stopping Bluetooth rf kill event daemon...

Stopping Login Service...

Stopping D-Bus System Message Bus...

[ OK ] Stopped target Login Prompts.

Stopping Getty on tty1...

[ OK ] Removed slice system-serial\x2dgetty.slice.

[ OK ] Stopped Edison PWR button handler.

[ OK ] Stopped Telephony service.

[ OK ] Stopped Bluetooth rf kill event daemon.

[ OK ] Stopped Daemon to reset sketches.

[ OK ] Stopped Login Service.

[ OK ] Stopped D-Bus System Message Bus.

[ OK ] Stopped PulseAudio Sound System.

192

Reboot

[ OK ] Stopped Network Name Resolution.

[ OK ] Stopped Getty on tty1.

[ OK ] Stopped Mosquitto - lightweight server implementatio...
T-SN protocols.
[ OK ] Stopped Intel_XDK_Daemon.

[ OK ] Unmounted Mount for factory.

Stopping Zero-configuration networking...

[ OK ] Removed slice system-getty.slice.

Stopping Permit User Sessions...

Stopping Daemon to handle arduino sketches...

[ OK ] Stopped Daemon to handle arduino sketches.

[ OK ] Stopped Zero-configuration networking.

[ OK ] Stopped Permit User Sessions.

[ OK ] Stopped target Remote File Systems.

[ OK ] Stopped target Network.

[ OK ] Stopped target Basic System.

[ OK ] Stopped target Slices.

[ OK ] Removed slice User and Session Slice.

[ OK ] Stopped target Paths.

[ OK ] Stopped target Timers.

[ OK ] Stopped target Sockets.

193

Reboot

[ OK ] Closed sshd.socket.

[ OK ] Closed RPCbind Server Activation Socket.

[ OK ] Closed D-Bus System Message Bus Socket.

[ OK ] Stopped target System Initialization.

Starting Console System Reboot Logging...

Stopping Load/Save RF Kill Switch Status of rfkill1...

Stopping Network Time Synchronization...

Stopping Update UTMP about System Boot/Shutdown...

Stopping Load Kernel Modules...

[ OK ] Stopped Load Kernel Modules.

Stopping Apply Kernel Variables...

[ OK ] Stopped Apply Kernel Variables.

Stopping Load/Save Random Seed...

[ OK ] Stopped target Swap.

Stopping Load/Save RF Kill Switch Status of rfkill0...

[ OK ] Stopped Network Time Synchronization.

[ OK ] Started Console System Reboot Logging.

[ OK ] Stopped Load/Save RF Kill Switch Status of rfkill1.

[ OK ] Stopped Update UTMP about System Boot/Shutdown.

[ OK ] Stopped Load/Save Random Seed.

194

Reboot

[ OK ] Stopped Load/Save RF Kill Switch Status of rfkill0.

[ OK ] Removed slice system-systemd\x2drfkill.slice.

Stopping Create Volatile Files and Directories...

[ OK ] Stopped Create Volatile Files and Directories.

[ OK ] Stopped target Local File Systems.

Unmounting /run/user/0...

[ OK ] Unset automount boot.automount.

Unmounting /var/volatile...

Unmounting Temporary Directory...

[ OK ] Unmounted /run/user/0.

[ OK ] Failed unmounting /var/volatile.

[ OK ] Unmounted Temporary Directory.

[ OK ] Reached target Unmount All Filesystems.

[ OK ] Stopped target Local File Systems (Pre).

Stopping Remount Root and Kernel File Systems...

[ OK ] Stopped Remount Root and Kernel File Systems.

[ OK ] Reached target Shutdown.

195

Processes

Processes
Mem: 131420K used, 851648K free, 0K shrd, 8988K buff, 57524K cac
hed
CPU: 4% usr 0% sys 0% nic 95% idle 0% io 0% irq 0%
sirq
Load average: 0.27 0.27 0.16 1/135 393
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
393 386 root R 2652 0% 5% top
348 296 root S 111m 12% 0% /usr/bin/node /opt/xdk
-daemon/current/
292 1 pulse S < 109m 11% 0% /usr/bin/pulseaudio -system --resampl
305 290 root S 80208 8% 0% node /usr/lib/edison_c
onfig_tools/edis
296 291 root S 76996 8% 0% /usr/bin/node /opt/xdk
-daemon/main.js
345 1 root S 19896 2% 0% /usr/bin/redis-server
/etc/redis/redis
167 1 systemd- S 12092 1% 0% /lib/systemd/systemd-t
imesyncd
116 1 root S 8680 1% 0% /lib/systemd/systemd-j
ournald
190 1 root S 6380 1% 0% /usr/sbin/wpa_supplica
nt -u -c/etc/wpa
303 301 root S 5264 1% 0% (sd-pam)
194 1 root S 5128 1% 0% /usr/sbin/ofonod -n
237 1 root S 4684 0% 0% /usr/lib/bluez5/blueto
oth/bluetoothd 285 1 root S 4536 0% 0% /usr/sbin/mosquitto -c
/etc/mosquitto/
1 0 root S 4480 0% 0% {systemd} /sbin/init
301 1 root S 3636 0% 0% /lib/systemd/systemd -user
199 1 root S 3228 0% 0% /usr/sbin/bluetooth_rf
kill_event
386 242 root S 3204 0% 0% -sh

196

Processes
291 1 root S 3132 0% 0% {xdk-daemon} /bin/sh /
opt/xdk-daemon/x
200 1 root S 3128 0% 0% {launcher.sh} /bin/sh
/opt/edison/laun
242 1 root S 3120 0% 0% /bin/login --

197

Virtual Network Computing

Virtual Network Computing


In computing, Virtual Network Computing (VNC) is a graphical desktop
sharing system that uses the Remote Frame Buffer protocol (RFB) to
remotely control another computer. It transmits the keyboard and mouse
events from one computer to another, relaying the graphical screen updates
back in the other direction, over a network. Wikipedia

VNC Server @ Edison X Desktop @ Ubilinux


root@edison:~# apt-get install xfce4
root@edison:~# apt-get install vnc4server
root@edison:~# vnc4passwd
Password:
Verify:
root@edison:~# vnc4server -geometry 800x600 -depth 24
xauth: file /home/chip/.Xauthority does not exist
xauth: (stdin):1: bad display name "chip:1" in "add" command
New 'edison:1 (edison)' desktop is edison:1
Creating default startup script /home/root/.vnc/xstartup
Starting applications specified in /home/root/.vnc/xstartup
Log file is /home/root/.vnc/edison:1.log

VNC Server @ Edison Default Desktop

198

Virtual Network Computing

root@edison:~# vnc4server -kill :1


Killing Xvnc4 process ID 18807
root@edison:~# nano ~/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
startxfce4 &
...
root@edison:~# vnc4server -geometry 800x600 -depth 24
xauth: (stdin):1: bad display name "edison:1" in "add" comm
and
New 'edison:1 (edison)' desktop is edison:1
Starting applications specified in /home/root/.vnc/xstartup
Log file is /home/root/.vnc/edison:1.log

VNC Viewer @ Host


root@jessie:/home/xe1gyq# apt-get install xvnc4viewer
Reading package lists... Done
Building dependency tree
Reading state information... Done
xvnc4viewer is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 109 not upgraded.
root@jessie:/home/xe1gyq# exit
exit
xe1gyq@jessie:~$ xvnc4viewer 192.168.1.77:1

199

Text Editors

Text Editors
When getting used to the command-line, Linux novices are often put off by
other, more advanced text editors such as vim and emacs. While they are
excellent programs, they do have a bit of a learning curve. Enter Nano, an
easy-to-use text editor that proves itself versatile and simple. The Beginners
Guide to Nano, the Linux Command-Line Text Editor

vi
vi /via/ is a screen-oriented text editor originally created for the Unix
operating system. The portable subset of the behavior of vi and programs
based on it, and the ex editor language supported within these programs, is
described by (and thus standardized by) the Single Unix Specification and
POSIX. Wikipedia Vi
Gentoo Vi Learning
Wikibooks Vi Learning
root@board:~# vi hellovi.txt
Press "i"
Write some text
Press "ESC" then ":" then "wq" then "Enter"
root@board:~#

nano
nano is a text editor for Unix-like computing systems or operating
environments using a command line interface. It emulates the Pico text editor,
part of the Pine email client, and also provides additional functionality. In
contrast to Pico, nano is licensed under the GNU General Public License
(GPL). Released as free software by Chris Allegretta in 1999, today nano is
part of the GNU Project. Wikipedia GNU Nano

200

Text Editors
See if you can install nano command line editor
root@board:~# opkg install nano
Installing nano (2.0.1-r0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/nano_2
.0.1-r0_core2-32.ipk.
Configuring nano.
root@board:~# nano hello.txt
Write some text
Ctrl-X
root@board:~#

root@board:~# vi hellonano.txt
Write some text
Press "CTRL" + "X" then "Enter" then "Y" then "ENTER"
root@board:~#

201

Services

Services
Init
In Unix-based computer operating systems, init (short for initialization) is the
first process started during booting of the computer system. Init is a daemon
process that continues running until the system is shut down. It is the direct or
indirect ancestor of all other processes and automatically adopts all orphaned
processes. Init is started by the kernel using a hard-coded filename; a kernel
panic will occur if the kernel is unable to start it. Init is typically assigned
process identifier 1. Wikipedia
root@edison:~# mkdir /etc/init.d

root@edison:~# nano /etc/init.d/helloservice.sh

#!/bin/sh
echo "Hello Service At Startup"

root@edison:~# chmod 755 /etc/init.d/helloservice.sh


root@edison:~# update-rc.d helloservice.sh defaults

root@edison:~# shutdown -r now

SystemD

202

Services
systemd is a suite of basic building blocks for a Linux system. It provides a
system and service manager that runs as PID 1 and starts the rest of the
system. Homepage
systemd is an init system used by some Linux distributions to bootstrap the
user space and manage all processes subsequently, instead of the UNIX
System V or Berkeley Software Distribution (BSD) init systems. The name
systemd adheres to the Unix convention of naming daemons by appending
the letter d. Wikipedia
Systemd is an init system and system manager that is widely becoming the
new standard for Linux machines. While there are considerable opinions
about whether systemd is an improvement over the traditional SysV init
systems it is replacing, the majority of distributions plan to adopt it or have
already done so. DigitalOcean
ArchLinux systemd System and Service Manager
root@edison:~# ls /lib/systemd/system
...
...nano /etc/systemd/journald.conf
poweroff.target timers.target
poweroff.target.wants timers.target.wants
printer.target tmp.mount
pulseaudio.service udhcpd-for-hostapd.servi
ce
pwr-button-handler.service umount.target
quotaon.service user.slice
rc-local.service user@.service
reboot.target watchdog-sample.service
reboot.target.wants wpa_supplicant.service
redis.service wpa_supplicant_p2p_event
.service
remote-fs-pre.target wpa_supplicant_wlan0_eve
nt.service
remote-fs.target wyliodrin-hypervisor.ser
vice
rescue.service wyliodrin-server.service
rescue.target xdk-daemon.service

203

Services

Systemctl
systemctl Control the systemd system and service manager. systemctl may
be used to introspect and control the state of the "systemd" system and
service manager. Homepage
systemctl command, the central management tool for controlling the init
system
root@edison:~# systemctl list-unit-files --type=service
...

root@edison:~# ls /etc/systemd/system/*.wants/
...

Services, Disable/Enable
root@edison:~# systemctl stop xdk-daemon
root@edison:~# systemctl disable xdk-daemon
rm '/etc/systemd/system/multi-user.target.wants/xdk-daemon.servi
ce'
root@edison:~# systemctl enable xdk-daemon
ln -s '/lib/systemd/system/xdk-daemon.service' '/etc/systemd/sys
tem/multi-user.target.wants/xdk-daemon.service'

Services, Running by Default, Disable?

204

Services

root@edison:~# systemctl status clloader


clloader.service - Daemon to handle arduino sketches
Loaded: loaded (/lib/systemd/system/clloader.service; enabled
)
Active: active (running) since Sun 2016-05-08 04:15:11 UTC; 5
4min ago
Main PID: 209 (launcher.sh)
CGroup: /system.slice/clloader.service
209 /bin/sh /opt/edison/launcher.sh
210 /opt/edison/clloader --escape --binary --zmodem
--disable-ti...
May 08 04:15:11 edison systemd[1]: Started Daemon to handle ardu
ino sketches.
May 08 04:15:11 edison launcher.sh[209]: Opened /dev/ttyGS0 as i
nputOpened /...s
Hint: Some lines were ellipsized, use -l to show in full.

root@edison:~# systemctl status sketch_reset


sketch_reset.service - Daemon to reset sketches
Loaded: loaded (/lib/systemd/system/sketch_reset.service; ena
bled)
Active: active (running) since Sun 2016-05-08 04:15:11 UTC; 5
5min ago
Main PID: 211 (sketch_reset)
CGroup: /system.slice/sketch_reset.service
211 /opt/edison/sketch_reset -i 207 -o 215 -s /opt/
edison/sketch...
May 08 04:15:11 edison systemd[1]: Started Daemon to reset sketc
hes.

root@edison:~# systemctl status rsmb


rsmb.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

205

Services

root@edison:~# systemctl status mdns


mdns.service - Zero-configuration networking
Loaded: loaded (/lib/systemd/system/mdns.service; enabled)
Active: active (running) since Sun 2016-05-08 04:15:14 UTC; 5
3min ago
Main PID: 265 (mdnsd)
CGroup: /system.slice/mdns.service
265 /usr/sbin/mdnsd
May 08 04:54:08 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 04:54:08 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 04:54:12 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 101...3
May 08 05:00:00 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:00 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:01 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:01 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:08 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:08 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
May 08 05:00:09 edison mDNSResponder[265]: mDNSPlatformSendUDP g
ot error 99 ...3
Hint: Some lines were ellipsized, use -l to show in full.

206

Services

root@edison:~# systemctl status edison_config


edison_config.service - The Edison status and configuration se
rvice
Loaded: loaded (/lib/systemd/system/edison_config.service; en
abled)
Active: active (running) since Sun 2016-05-08 04:15:15 UTC; 5
4min ago
Main PID: 289 (su)
CGroup: /system.slice/edison_config.service
289 /bin/su root -c node /usr/lib/edison_config_too
ls/edison-con...
May 08 04:15:15 edison systemd[1]: Started The Edison status and
configurat...e.
May 08 04:15:15 edison su[289]: Successful su for root by root
May 08 04:15:15 edison su[289]: + ??? root:root
May 08 04:15:15 edison su[289]: pam_unix(su:session): session op
ened for us...0)
Hint: Some lines were ellipsized, use -l to show in full.

root@edison:~# systemctl status systemd-resolved


systemd-resolved.service - Network Name Resolution
Loaded: loaded (/lib/systemd/system/systemd-resolved.service;
enabled)
Active: active (running) since Sun 2016-05-08 04:15:14 UTC; 5
6min ago
Docs: man:systemd-resolved.service(8)
Main PID: 253 (systemd-resolve)
Status: "Processing requests..."
CGroup: /system.slice/systemd-resolved.service
253 /lib/systemd/systemd-resolved
May 08 04:15:14 edison systemd[1]: Started Network Name Resoluti
on.

Services, Start Up Script Execution


207

Services
Musings from Stephanie Automatic Scripting at Boot-Up
Tektyte Running a Script On Startup
root@edison:~# cd /home/root/
root@edison:~# nano hello-world.sh

echo "Hello World!"

root@edison:~# chmod +x hello-world.sh


root@edison:~# cd /lib/systemd/system
root@edison:~# nano hello-world.service

[Unit]
Description=Hello World
After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/bin/bash /home/root/hello-world.sh
Restart=always
RestartSec=10
[Install]
Alias=HelloWorld
WantedBy=multi-user.target

root@edison:~# systemctl daemon-reload


root@edison:~# systemctl --system enable hello-world
root@edison:~# systemctl start hello-world
root@edison:~# systemctl status hello-world.service -l
root@edison:~# systemctl status hello-world

Reboot your Intel Edison


root@edison:~# reboot

208

Services
Once booted, verify again hello-world service status
root@edison:~# systemctl status hello-world

Services, Web Server


Location of the web server content
root@edison:~# ls /usr/lib/edison_config_tools/public/

Location of the web server configuration script


root@edison:~# ls /usr/lib/edison_config_tools/edison-config
-server.js

To stop actual webserver


root@edison:~# systemctl disable edison_config
root@edison:~# systemctl stop edison_config
root@edison:~# systemctl status edison_config

Services, Butterfly, Web Based Terminal


Emulator
A sleek web based terminal emulator
Butterfly is a xterm compatible terminal that runs in your browser
Butterfly Github

209

Services

root@edison:~# pip install butterfly pyserial npyscreen


root@edison:~# butterfly.server.py --unsecure --host=192.168
.1.65 --port=8885
butterfly.conf installed in /etc/butterfly/butterfly.conf
[W 160321 05:41:44 butterfly.server:317] Butterfly is ready,
open your browser to: http://192.168.1.65:8885/

SystemD Automatic Run


root@edison:~# cd /etc/systemd/system
root@edison:~# curl -O https://raw.githubusercontent.com/pa
radoxxxzero/butterfly/master/butterfly.service
root@edison:~# curl -O https://raw.githubusercontent.com/pa
radoxxxzero/butterfly/master/butterfly.socket
root@edison:~# systemctl enable butterfly.socket
root@edison:~# systemctl start butterfly.socket

210

Logs

Logs
JournalCtl
journalctl Query the systemd journal. journalctl may be used to query the
contents of the systemd journal as written by systemd-journald.service.
Homepage
Show logging space
root@edison:~# journalctl --disk-usage

Limit logging space


root@edison:~# nano /etc/systemd/journald.conf
SystemMaxUse=20M

Stop logging
root@edison:~# nano /etc/systemd/journald.conf
#Storage=persistent
Storage=None

Remove all logs


root@edison:~# cd /var/log/journal/
root@edison:/var/log/journal# rm -rf *

Show logging space


root@edison:~# journalctl --disk-usage
No journal files were found.
Journals take up 0B on disk.

211

Logs

212

Package Management Systems

Package Management Systems


A package manager or package management system is a collection of
software tools that automates the process of installing, upgrading, configuring,
and removing computer programs for a computer's operating system in a
consistent manner. Wikipedia

213

Open Package Management

Open Package Management


Opkg (Open PacKaGe Management) is a lightweight package management
system based upon ipkg. It is written in C and resembles APT/dpkg in
operation. It is intended for use on embedded Linux devices and is used in
this capacity in the OpenEmbedded and OpenWrt projects. Wikipedia
Open Package Management Wikipedia
AlexT's Galileo & Edison pages
How to enable the Yocto-provided package management capability

Package Installation via Remote


Repositories
Update Opkg Repositories
root@edison:~# opkg update
Downloading http://iotdk.intel.com/repos/1.5/intelgalactic/P
ackages.
Updated list of available packages in /var/lib/opkg/iotkit.
root@edison:~#

Enable a Opkg feed and update package list, we will not upgrade to avoid
consuming disk space
root@edison:~# vi /etc/opkg/base-feeds.conf # Add the below
lines to the opened file

src/gz all http://repo.opkg.net/edison/repo/all


src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32

214

Open Package Management

root@edison:~# opkg update


Downloading http://repo.opkg.net/edison/repo/all/Packages.gz
.
Inflating http://repo.opkg.net/edison/repo/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/all.
Downloading http://repo.opkg.net/edison/repo/edison/Packages
.gz.
Inflating http://repo.opkg.net/edison/repo/edison/Packages.g
z.
Updated list of available packages in /var/lib/opkg/edison.
Downloading http://repo.opkg.net/edison/repo/core2-32/Packag
es.gz.
Inflating http://repo.opkg.net/edison/repo/core2-32/Packages
.gz.
Updated list of available packages in /var/lib/opkg/core2-32
.
Downloading http://iotdk.intel.com/repos/1.5/intelgalactic/P
ackages.
Updated list of available packages in /var/lib/opkg/iotkit.
root@edison:~#

Install Git, Version Control System


root@edison:~# opkg install git

Check if RMAA and UPM Libraries are installed


root@edison:~# opkg list-installed | grep mraa
root@edison:~# opkg list-installed | grep upm

Install and configure extra packages required


root@edison:~# opkg install nano git python-pip
root@edison:~# git config --global user.name "Name LastName"
root@edison:~# git config --global user.email email@adress.c
om

215

Open Package Management

Package Installation via Local Files


root@edison:~# wget http://repo.opkg.net/edison/repo/core2-3
2/less_458-r0_core2-32.ipk
root@edison:~# opkg install less_458-r0_core2-32.ipk

216

Python Package Index

Python Package Index


The Python Package Index or PyPI is the official third-party software
repository for the Python programming language. Python developers intend it
to be a comprehensive catalog of all open source Python packages.
Wikipedia
The Python Package Index is a repository of software for the Python
programming language. Official Homepage
Python Package Index Homepage
Python Package Index Wikipedia
Python Packaging User Guide
root@edison:~# opkg install python-pip python-dev
root@edison:~# pip install setuptools

Python Library
root@edison:~# python
Python 2.7.3 (default, Dec 19 2015, 23:06:02)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more in
formation.
>>> import psutil
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named psutil
>>> <CTRL-D>

Python Library Search

217

Python Package Index

root@edison:~# pip search psutil


...
psutil - psutil is a cross-platform libra
ry for retrieving
information onrunning processes
and system
utilization (CPU, memory, disks,
network)in
Python.
...

Python Library Optional Installation Path


root@edison:~# pip install psutil --target /root
Downloading/unpacking psutil
Running setup.py egg_info for package psutil
warning: no previously-included files matching '*' found
under directory 'docs/_build'
warning: manifest_maker: MANIFEST.in, line 18: 'recursiv
e-include' expects <dir> <pattern1> <pattern2> ...
0
Installing collected packages: psutil
Running setup.py install for psutil
warning: no previously-included files matching '*' found
under directory 'docs/_build'
warning: manifest_maker: MANIFEST.in, line 18: 'recursiv
e-include' expects <dir> <pattern1> <pattern2> ...
Successfully installed psutil
Cleaning up...
root@edison:~# ls /root/
psutil psutil-3.3.0-py2.7.egg-info
root@edison:~# ls /root/psutil
__init__.py _compat.pyc _psosx.py _pssun
os.pyc

218

Python Package Index


__init__.pyc _psbsd.py _psosx.pyc _psuti
l_linux.so
_common.py _psbsd.pyc _psposix.py _psuti
l_posix.so
_common.pyc _pslinux.py _psposix.pyc _pswin
dows.py
_compat.py _pslinux.pyc _pssunos.py _pswin
dows.pyc
root@edison:~# export PYTHONPATH=$PYTHONPATH:/root
root@edison:~# echo "export PYTHONPATH=$PYTHONPATH:/root" >>
/etc/profile
root@edison:~# python
Python 2.7.3 (default, Dec 19 2015, 23:06:02)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more in
formation.
>>> import psutil
>>> <CTRL-D>
root@edison:~# pip uninstall psutil

Python Library Default Installation Path

219

Python Package Index

root@edison:~# pip install psutil


Downloading/unpacking psutil
Running setup.py egg_info for package psutil
warning: no previously-included files matching '*' found
under directory 'docs/_build'
warning: manifest_maker: MANIFEST.in, line 18: 'recursiv
e-include' expects <dir> <pattern1> <pattern2> ...
Installing collected packages: psutil
Running setup.py install for psutil
warning: no previously-included files matching '*' found
under directory 'docs/_build'
warning: manifest_maker: MANIFEST.in, line 18: 'recursiv
e-include' expects <dir> <pattern1> <pattern2> ...
Successfully installed psutil
Cleaning up...

Python Library Github Installation


root@edison:~# pip install https://github.com/mitsuhiko/flas
k/tarball/master

Python Easy_Install

220

Python Package Index

root@edison:~# easy_install requests


Searching for requests
Reading https://pypi.python.org/simple/requests/
Best match: requests 2.10.0
Downloading https://pypi.python.org/packages/49/6f/183063f01aae1
e025cf0130772b55848750a2f3a89bfa11b385b
35d7329d/requests-2.10.0.tar.gz#md5=a36f7a64600f1bfec4d55ae021d2
32ae
Processing requests-2.10.0.tar.gz
Writing /tmp/easy_install-E4KeMV/requests-2.10.0/setup.cfg
Running requests-2.10.0/setup.py -q bdist_egg --dist-dir /tmp/ea
sy_install-E4KeMV/requests-2.10.0/egg-d
ist-tmp-qSTGq5
warning: no files found matching 'test_requests.py'
creating /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7.
egg
Extracting requests-2.10.0-py2.7.egg to /usr/lib/python2.7/sitepackages
Adding requests 2.10.0 to easy-install.pth file
Installed /usr/lib/python2.7/site-packages/requests-2.10.0-py2.7
.egg
Processing dependencies for requests
Finished processing dependencies for requests
root@edison:~#

221

Nicely Package Make

Nicely Package Make


npm makes it easy for JavaScript developers to share and reuse code, and it
makes it easy to update the code that you're sharing. NPM JS Homepage
Npm Getting Started

Update Npm
root@edison:~# npm install npm -g
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-s
npm@3.8.3 /usr/lib/node_modules/npm

Install Npm Package

222

Nicely Package Make

root@edison:~# npm install mqtt -g


-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\-\|/-\|/-\|/-\|/-\|/-\|-\|/-\|/-\|
/-\|/-\|/--\|/-\|/-\|/-\|/usr/bin/mqtt_pub -> /usr/lib/nos
/usr/bin/mqtt_sub -> /usr/lib/node_modules/mqtt/bin/sub.js
/usr/bin/mqtt -> /usr/lib/node_modules/mqtt/mqtt.js
mqtt@1.7.4 /usr/lib/node_modules/mqtt
inherits@2.0.1
reinterval@1.0.2
xtend@4.0.1
minimist@1.2.0
commist@1.0.0 (leven@1.0.2)
end-of-stream@1.1.0 (once@1.3.3)
mqtt-connection@2.1.1 (through2@0.6.5, reduplexer@1.1.
0)
readable-stream@1.0.33 (isarray@0.0.1, string_decoder@
0.10.31, core-util-is@1.0.2)
mqtt-packet@3.4.6 (bl@0.9.5)
help-me@0.1.0 (pump@1.0.1)
concat-stream@1.5.1 (typedarray@0.0.6, readable-stream
@2.0.6)
websocket-stream@3.1.0 (ws@1.0.1, through2@2.0.1, dupl
exify@3.4.3)

root@edison:~# mqtt sub -t 'hello' -h 'test.mosquitto.org' -v &


[2] 653

root@edison:~# mqtt pub -t 'hello' -h 'test.mosquitto.org' -m 'f


rom MQTT.js'
hello coolbjhbjbjkbm m m
hello from MQTT.js

223

Advanced Packaging Tool

Advanced Packaging Tool


The Advanced Package Tool, or APT, is a free software user interface that
works with core libraries to handle the installation and removal of software on
the Debian Linux distribution and its variants. APT simplifies the process of
managing software on Unix-like computer systems by automating the
retrieval, configuration and installation of software packages, either from
precompiled files or by compiling source code. Wikipedia
root@ubilinux:~# apt-get update && sudo apt-get upgrade
root@ubilinux:~# apt-get install git-core
root@ubilinux:~# apt-get install ca-certificates

224

Manual

Manual
Pywapi
Pywapi is a Python wrapper around different weather APIs
Pywapi Pip Homepage
root@edison:~# wget https://launchpad.net/python-weather-api
/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz
--2016-03-19 18:51:24-- https://launchpad.net/python-weathe
r-api/trunk/0.3.8/+download/pywapi-0.3.8.tar.gz
Resolving launchpad.net... 91.189.89.223, 91.189.89.222
Connecting to launchpad.net|91.189.89.223|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporaril
y
Location: https://launchpadlibrarian.net/166317636/pywapi-0.
3.8.tar.gz [following]
--2016-03-19 18:51:26-- https://launchpadlibrarian.net/1663
17636/pywapi-0.3.8.tar.gz
Resolving launchpadlibrarian.net... 91.189.89.228, 91.189.89
.229
Connecting to launchpadlibrarian.net|91.189.89.228|:443... c
onnected.
HTTP request sent, awaiting response... 200 OK
Length: 25166 (25K) [application/x-tar]
Saving to: 'pywapi-0.3.8.tar.gz.1'
100%[======================================>] 25,166 1
39KB/s in 0.2s
2016-03-19 18:51:27 (139 KB/s) - 'pywapi-0.3.8.tar.gz.1' sav
ed [25166/25166]
root@edison:~# tar zxvf pywapi-0.3.8.tar.gz
pywapi-0.3.8/examples/pywapi-countries-example.py
pywapi-0.3.8/setup.py
pywapi-0.3.8/MANIFEST

225

Manual
pywapi-0.3.8/examples/
pywapi-0.3.8/examples/pywapi-noaa-example.py
pywapi-0.3.8/examples/pywapi-example.py
pywapi-0.3.8/pywapi.pyc
pywapi-0.3.8/LICENSE
pywapi-0.3.8/examples/pywapi-weather-com-example.py
pywapi-0.3.8/pywapi.py
pywapi-0.3.8/examples/pywapi-cities-example.py
pywapi-0.3.8/CHANGELOG
pywapi-0.3.8/README
pywapi-0.3.8/
pywapi-0.3.8/examples/pywapi-yahoo-example.py
pywapi-0.3.8/examples/get-weather.py
root@edison:~# cd pywapi-0.3.8
root@edison:~/pywapi-0.3.8# ls
CHANGELOG MANIFEST examples pywapi.pyc
LICENSE README pywapi.py setup.py
root@edison:~/pywapi-0.3.8# python setup.py build
running build
running build_py
creating build
creating build/lib
copying pywapi.py -> build/lib
root@edison:~/pywapi-0.3.8# python setup.py install
running install
running build
running build_py
running install_lib
copying build/lib/pywapi.py -> /usr/lib/python2.7/site-packa
ges
byte-compiling /usr/lib/python2.7/site-packages/pywapi.py to
pywapi.pyc
running install_egg_info
Writing /usr/lib/python2.7/site-packages/pywapi-0.3.8-py2.7.
egg-info
root@edison:~/pywapi-0.3.8# cd
root@edison:~#

Alternate Installation
226

Manual

root@edison:~/pywapi-0.3.8# python setup.py install --user

227

Conda

Conda
Conda is a package manager application that quickly installs, runs, and
updates packages and their dependencies. Intro to Conda
Anaconda is a free, easy-to-install package manager, environment manager,
Python distribution, and collection of over 720 open source packages with
free community support. Hundreds more open source packages and their
dependencies can be installed with a simple conda install [packagename].
Its platform-agnostic, can be used on Windows, OS X and Linux. New to
Anaconda Start Here
Conda Download
Conda Test Drive
root@edison:~# opkg install python-pip
root@edison:~# wget http://09c8d0b2229f813c1b93-c95ac804525a
ac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.1.0-Linux-x8
6.sh
root@edison:~# opkg install http://repo.opkg.net/edison/repo
/core2-32/bash_4.3-r0_core2-32.ipk
root@edison:~# opkg install http://repo.opkg.net/edison/repo
/core2-32/tar_1.27.1-r0_core2-32.ipk
root@edison:~# bash ./Anaconda-2.1.0-Linux-x86.sh
tar: lib/python2.7/site-packages/sklearn/utils/weight_vector
.so: Cannot write: No space left on device
tar: Exiting with failure status due to previous errors

Miniconda
These Miniconda installers contain the conda package manager and Python.
Once Miniconda is installed, you can use the conda command to install any
other packages and create environments, etc.
Miniconda Python on Intel Edison
The most important stuff to know about Intel Edison
228

Conda

root@edison:~# wget http://ftp.gnu.org/gnu/tar/tar-latest.tar.gz



--2016-06-25 12:58:20-- http://ftp.gnu.org/gnu/tar/tar-latest.t
ar.gz
Resolving ftp.gnu.org... 208.118.235.20, 2001:4830:134:3::b

Connecting to ftp.gnu.org|208.118.235.20|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 3962257 (3.8M) [application/x-gzip]

Saving to: 'tar-latest.tar.gz'

100%[======================================>] 3,962,257 260KB
/s in 13s
2016-06-25 12:58:33 (308 KB/s) - 'tar-latest.tar.gz' saved [3962
257/3962257]
root@edison:~$ tar xvf tar-latest.tar.gz
root@edison:~$ cd tar-1.29/
root@edison:~/tar-1.29$ ls
ABOUT-NLS ChangeLog.1 Makefile.in TODO config.h.in
gnu rmt
AUTHORS INSTALL NEWS acinclude.m4 configure
lib scripts
COPYING Make.rules README aclocal.m4 configure.ac
m4 src
ChangeLog Makefile.am THANKS build-aux doc
po tests
root@edison:~/tar-1.29$ sh configure
root@edison:~/tar-1.29$ make
root@edison:~/tar-1.29# make install

229

Conda

root@edison:~# wget https://repo.continuum.io/miniconda/Mini


conda3-latest-Linux-x86.sh
--2016-03-21 06:23:29-- https://repo.continuum.io/miniconda
/Miniconda3-latest-Linux-x86.sh
Resolving repo.continuum.io... 23.21.234.195, 54.197.250.243
, 23.23.254.16, ...
Connecting to repo.continuum.io|23.21.234.195|:443... connec
ted.
HTTP request sent, awaiting response... 200 OK
Length: 29686993 (28M) [application/octet-stream]
Saving to: 'Miniconda3-latest-Linux-x86.sh'
100%[=======================================================
=====================================>] 29,686,993 1.20MB/s in
25s
2016-03-21 06:23:55 (1.13 MB/s) - 'Miniconda3-latest-Linux-x
86.sh' saved [29686993/29686993]

root@edison:~# bash Miniconda3-latest-Linux-x86.sh


...
[/home/root/miniconda3] >>>
PREFIX=/home/root/miniconda3
installing: _cache-0.0-py35_x0 ...
...
You may wish to edit your .bashrc or prepend the Miniconda3
install location:
$ export PATH=/home/root/miniconda3/bin:$PATH
Thank you for installing Miniconda3!
Share your notebooks and packages on Anaconda Cloud!
Sign up for free: https://anaconda.org

root@edison:~# export PATH=/home/root/miniconda3/bin:$PATH


root@edison:~# conda --version

230

Conda

conda 4.0.5

root@edison:~# conda update conda

Fetching package metadata: ....

.Solving package specifications: .........

Package plan for installation in environment /home/root/minicond
a3:
The following packages will be downloaded:

package | build

---------------------------|-----------------

conda-env-2.5.1 | py35_0 27 KB

ruamel_yaml-0.11.7 | py35_0 379 KB

conda-4.1.3 | py35_0 201 KB

-----------------------------------------------------------
Total: 607 KB

The following NEW packages will be INSTALLED:

ruamel_yaml: 0.11.7-py35_0

The following packages will be UPDATED:

231

Conda
conda: 4.0.5-py35_0 --> 4.1.3-py35_0

conda-env: 2.4.5-py35_0 --> 2.5.1-py35_0

Proceed ([y]/n)? y

Fetching packages ...

conda-env-2.5. 100% |################################| Time: 0:0
0:00 292.28 kB/s
ruamel_yaml-0. 100% |################################| Time: 0:0
0:01 253.50 kB/s
conda-4.1.3-py 100% |################################| Time: 0:0
0:01 126.19 kB/s
Extracting packages ...

[ COMPLETE ]|#########################################
##########| 100%
Unlinking packages ...

[ COMPLETE ]|#########################################
##########| 100%
Linking packages ...

[ COMPLETE ]|#########################################
##########| 100%
root@edison:~# conda search --full-name python
python 1.0.1 0 de
faults
...
* 3.5.1 0 de
faults
root@edison:~# conda create --name snakes python=3
...
#
# To activate this environment, use:
# $ source activate snakes
#

232

Conda
# To deactivate this environment, use:
# $ source deactivate
#
root@edison:~# conda info --envs
# conda environments:
#
snakes /home/root/miniconda3/envs/snakes
root * /home/root/miniconda3
root@edison:~#

233

Libraries

Libraries

234

Mraa

MRAA
Low Level Skeleton Library for IO Communication on GNU/Linux platforms
C/C++ library with bindings to JavaScript and Python to interface with the I/O
on the Intel Galileo board, Intel Edison board, and other platforms. With
board detection done at runtime, you can create portable code that works
across multiple platforms.
AIO Sensors requiring an ADC value to be read
I2C Modules using the i2c bus
SPI Modules using the SPI bus
GPIO Modules using GPIOs directly
PWM Modules using a PWM capable GPIO pin
UART Modules using a serial connection (RX/TX)
MRAA Github

Manual Installation, Latest Github


Yocto

235

Mraa

root@edison:~# git clone https://github.com/intel-iot-devkit


/mraa.git
root@edison:~# mkdir mraa/build && cd $_
root@edison:~# cmake ..
root@edison:~# make
root@edison:~# make install
root@edison:~# nano /etc/ld.so.conf
/usr/local/lib/i386-linux-gnu/
root@edison:~# ldconfig
root@edison:~# ldconfig -p | grep mraa
root@edison:~# export PYTHONPATH=$PYTHONPATH:$(dirname $(fin
d /usr/local -name mraa.py))
root@edison:~# nano ~/.bashrc
export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -n
ame mraa.py))

Ubilinux

236

Mraa

root@ubilinux:~# apt-get update


root@ubilinux:~# apt-cache search pcre
root@ubilinux:~# apt-get install libpcre3-dev
root@ubilinux:~# apt-get install git
root@ubilinux:~# apt-get install cmake
root@ubilinux:~# apt-get install python-dev
root@ubilinux:~# apt-get install swig
root@ubilinux:~# git clone https://github.com/intel-iot-devk
it/mraa.git
root@ubilinux:~# mkdir mraa/build && cd $_
root@ubilinux:~# cmake .. -DBUILDSWIGNODE=OFF
root@ubilinux:~# make
root@ubilinux:~# make install
root@ubilinux:~# cd
root@ubilinux:~# nano /etc/ld.so.conf
/usr/local/lib/i386-linux-gnu/
root@ubilinux:~# ldconfig
root@ubilinux:~# ldconfig -p | grep mraa
root@ubilinux:~# export PYTHONPATH=$PYTHONPATH:$(dirname $(f
ind /usr/local -name mraa.py))
root@ubilinux:~# nano ~/.bashrc
export PYTHONPATH=$PYTHONPATH:$(dirname $(find /usr/local -n
ame mraa.py))

Based on Installing libmraa on Ubilinux for Edison

Testing, Opkg
root@edison:~# opkg list-installed | grep mraa
mraa - 1.0.0-r0
mraa-dev - 1.0.0-r0
mraa-doc - 1.0.0-r0

Upgrade, Opkg

237

Mraa

root@edison:~# opkg install mraa



Package mraa (1.0.0-r0) installed in root is up to date.

root@edison:~#

Hello Mraa
root@edison:~# git clone https://github.com/intel-iot-devkit
/mraa.git
root@edison:~# cd mraa/examples
root@edison:~# gcc -lmraa hellomraa.c -o hellomraa
root@edison:~# ./hellomraa
hello mraa
Version: v0.7.3
Running on Intel Edison

238

Upm

UPM
Sensor/Actuator repository for libmraa
High-level repository for sensors and actuators that use libmraa. In other
words, UPM gives you easy function calls to use your sensors, such as
reading temperature values or writing data to an LCD screen. With over a
hundred sensors and more being added, this library speeds up your
development time.
UPM Documentation
UPM Sensor Categories
UPM Github
UPM Python Examples

UPM Updates
Protocols such as ModBus and BACNet
Radio/wireless modules
XBee socket devices
ZigBee, WiFi, WiFly
LoRathe SX1276 chip
ZWaveUSB Controllers
ISM (Industrial, Scientific & Medical) Frequency Shift Keying (FSK) at 434
and 915 MHz

Manual Installation, Latest Github


Ubilinux
Cmake

239

Upm

root@ubilinux:~$ wget http://www.cmake.org/files/v3.2/cmake-3.2.


2.tar.gz
root@ubilinux:~$ tar xvf cmake-3.2.2.tar.gz
root@ubilinux:~$ cd cmake-3.2.2
root@ubilinux:~$ ./bootstrap
root@ubilinux:~$ make
root@ubilinux:~# make install

Upm
root@ubilinux:~$ git clone https://github.com/intel-iot-devkit/u
pm.git
root@ubilinux:~$ cd upm
root@ubilinux:~$ mkdir build
root@ubilinux:~$ cd build
root@ubilinux:~$ cmake ..
root@ubilinux:~$ make
root@ubilinux:~# make install
root@ubilinux:~$ nano ~/.bashrc
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-pack
ages/

Upgrade, Opkg
Check if UPM Library is installed
root@edison:~# opkg list-installed | grep upm
upm - 0.7.0-r0
upm-dev - 0.7.0-r0

240

Upm

root@edison:~# opkg install upm



Package upm (0.7.0-r0) installed in root is up to date.

root@edison:~#

241

OpenCv

Open Source Computer Vision


OpenCV is released under a BSD license and hence its free for both
academic and commercial use. It has C++, C, Python and Java interfaces and
supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed
for computational efficiency and with a strong focus on real-time applications.
Written in optimized C/C++, the library can take advantage of multi-core
processing. Enabled with OpenCL, it can take advantage of the hardware
acceleration of the underlying heterogeneous compute platform. Adopted all
around the world, OpenCV has more than 47 thousand people of user
community and estimated number of downloads exceeding 9 million. Usage
ranges from interactive art, to mines inspection, stitching maps on the web or
through advanced robotics. Homepage
OpenCV Homepage
OpenCV 3.0.0-Beta ( IPP & TBB enabled ) on Yocto with Intel Edison
OpenCV 3.0.0 ( IPP & TBB enabled ) on Yocto with Intel Edison with new
Yocto image release
Maker Garage Facial Recognition with Intel Edison Guide
Learn OpenCV

Required Applications
Opkg Installation
root@edison:~# opkg update
root@edison:~# opkg install opencv opencv-dev opencv-apps
root@edison:~# opkg install opencv-samples opencv-samples-de
v
root@edison:~# opkg install libopencv-imgproc-dev
root@edison:~# opkg install python-numpy python-opencv

Cannot install in some devices

242

OpenCv

root@edison:~# opkg install opencv-samples-dev opencv-dev

Apt-Get Installation
root@edison:~# apt-get update
root@edison:~# apt-get install git python-pip python-serial
python-pyparsing
root@edison:~# apt-get install opencv opencv-samples opencvapps
root@edison:~# apt-get install opencv-dev opencv-samples-dev
root@edison:~# apt-get install libopencv-imgproc-dev
root@edison:~# apt-get install python-numpy python-opencv

Hello OpenCV, Face Recognition


root@edison:~# cd /home/root/
root@edison:~# mkdir opencv
root@edison:~# cd opencv/
root@edison:~/opencv# wget https://raw.githubusercontent.com
/xe1gyq/core/master/configuration/haarcascade_frontalface_alt.xml
root@edison:~/opencv# nano facerecognition.py

import cv2
import os
import sys
class xFaceRecognition(object):
def __init__(self, imageinput="in.jpeg", imageoutput="out.jp
eg"):
self.directorycurrent = os.path.dirname(os.path.realpath
(__file__))

243

OpenCv
self.directoryoutput = self.directorycurrent
self.imageinput = imageinput
self.cascPath = "haarcascade_frontalface_alt.xml"
self.imageoutput = imageoutput
def detect(self):
faceCascade = cv2.CascadeClassifier(self.cascPath)
image = cv2.imread(self.imageinput)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(
gray,
scaleFactor=1.1,
minNeighbors=5,
minSize=(30, 30),
flags = cv2.cv.CV_HAAR_SCALE_IMAGE
)
print "Found {0} faces!".format(len(faces))
for (x, y, w, h) in faces:
cv2.rectangle(image, (x, y), (x+w, y+h), (0, 255, 0)
, 2)
cv2.imwrite(self.imageoutput, image)
cv2.waitKey(0)
if __name__ == "__main__":
idFaceRecognition = xFaceRecognition(imageinput='in.jpeg', i
mageoutput='out.jpeg')
idFaceRecognition.detect()

Low Resolution Picture

244

OpenCv

root@edison:~/opencv# wget https://dab1nmslvvntp.cloudfront.


net/wp-content/uploads/2015/09/1442313353nasa-small.jpg
--2016-03-20 00:49:32-- https://dab1nmslvvntp.cloudfront.ne
t/wp-content/uploads/2015/09/1442313353nasa-small.jpg
Resolving dab1nmslvvntp.cloudfront.net... 23.235.40.133
Connecting to dab1nmslvvntp.cloudfront.net|23.235.40.133|:44
3... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13400 (13K) [image/jpeg]
Saving to: '1442313353nasa-small.jpg.jpeg'
100%[======================================>] 13,400 -.-K/s in 0s
2016-03-20 00:49:33 (27.5 MB/s) - '1442313353nasa-small.jpg.
jpeg' saved [13400/13400]
root@edison:~/opencv# mv 1442313353nasa-small.jpg files/phot
o.jpeg
root@edison:~/opencv# time python facerecognition.py

Found X faces!
real 0m2.249s
user 0m2.010s
sys 0m0.220s

Look at <>

High Resolution Picture

245

OpenCv

root@edison:~/opencv# wget https://upload.wikimedia.org/wiki


pedia/commons/5/5d/Barack_Obama_family_portrait_2011.jpg
--2016-03-20 00:24:03-- https://upload.wikimedia.org/wikipe
dia/commons/5/5d/Barack_Obama_family_portrait_2011.jpg
Resolving upload.wikimedia.org... 208.80.153.240, 2620:0:860
:ed1a::2:b
Connecting to upload.wikimedia.org|208.80.153.240|:443... co
nnected.
HTTP request sent, awaiting response... 200 OK
Length: 1972894 (1.9M) [image/jpeg]
Saving to: 'Barack_Obama_family_portrait_2011.jpg'
100%[======================================>] 1,972,894 2
64KB/s in 16s
2016-03-20 00:24:20 (122 KB/s) - 'Barack_Obama_family_portra
it_2011.jpg' saved [1972894/1972894]
root@edison:~/opencv# mv Barack_Obama_family_portrait_2011.j
pg in.jpeg
root@edison:~/opencv# time python facerecognition.py
???

246

Temboo

Temboo
Put the IoT to work for you. Your IoT Software Stack. Build, grow, and extend
your products for the Internet of Things with less friction and more flexibility.
A cloud-based code generation platform with 2000+ processes for APIs,
databases, and more. Temboo Homepage

IoT Apps
Build IoT Applications with Temboo
Building Management
Energy
Environment
Farming
Logistics
Manufacturing
Smart Cities
Water Management

247

Libiio

Libiio
Libiio is a library that has been developed by Analog Devices to ease the
development of software interfacing Linux Industrial I/O (IIO) devices.
Homepage

248

Cylon JS

Cylon JS
JavaScript framework for robotics, physical computing, and the Internet of
Things (IoT)
JavaScript Robotics, By Your Command. Next generation robotics framework
with support for 43 different platforms Get Started
Cylon.Js
Cylon.Js OpenCv
Cylon.Js Intel Edison

Cylon Intel IoT


Cylon module for Intel-IoT platforms
This repository contains the Cylon adaptor for the Intel Edison and Intel
Galileo IoT platforms. It uses the MRAA node module
(https://github.com/intel-iot-devkit/mraa)
NPM JS Intel IoT
root@edison:~# npm install cylon cylon-intel-iot
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
-\|/-\|/-\|/-\|/-\|/-\|/-\|/cylon@1.2.0 node_modules/cylon
cylon-intel-iot@0.8.1 node_modules/cylon-intel-iot
cylon-gpio@0.27.0
cylon-i2c@0.23.0

root@edison:~# npm install cylon-gpio


-\|/-\|/-\|/-\|/cylon-gpio@0.27.0 node_modules/cylon-gpio

249

Cylon JS

root@edison:~# npm install cylon-i2c


-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-cylon-i2c@0.24.
0 node_modules/cylon-i2c
root@edison:~# vi c.js

var Cylon = require('cylon');


Cylon.robot({
connections: {
edison: { adaptor: 'intel-iot' }
},
devices: {
led: { driver: 'led', pin: 13 }
},
work: function(my) {
every((1).second(), my.led.toggle);
}
}).start();

root@edison:~# node c.js


2016-03-27T18:24:03.339Z : [Robot 1] - Starting connections.
2016-03-27T18:24:03.412Z : [Robot 1] - Starting connection '
edison'.
2016-03-27T18:24:03.415Z : [Robot 1] - Starting devices.
2016-03-27T18:24:03.416Z : [Robot 1] - Starting device 'led'
on pin 13.
2016-03-27T18:24:03.416Z : [Robot 1] - Working.
^Croot@edison:~#

Bluetooth Programming on the Intel Edison


featuring Sphero
Follow up instructions here

250

Cylon JS

Grove Indoor Starter Kit


Using Cylon.js With The Intel Edison and IoT Starter Kit
root@edison:~# npm install cylon cylon-intel-iot cylon-api-http
cylon-gpio cylon-i2c

"use strict";
var cylon = require("cylon");
cylon.api({
host: "0.0.0.0",
port: "3000",
ssl: false
});
cylon.robot({
name: "doorbot",
connections: {
edison: { adaptor: "intel-iot" }
},
devices: {
// digital sensors
button: { driver: "button", pin: 2, connection: "edis
on" },
led: { driver: "led", pin: 3, connection: "edis
on" },
// i2c devices
screen: { driver: "jhd1313m1", connection: "edison" }
},
writeMessage: function(message, color) {
var that = this;
var str = message.toString();
while (str.length < 16) {
str = str + " ";
}
console.log(message);

251

Cylon JS
that.screen.setCursor(0,0);
that.screen.write(str);
switch(color)
{
case "red":
that.screen.setColor(255, 0, 0);
break;
case "green":
that.screen.setColor(0, 255, 0);
break;
case "blue":
that.screen.setColor(0, 0, 255);
break;
default:
that.screen.setColor(255, 255, 255);
break;
}
},
reset: function() {
this.writeMessage("Doorbot ready");
this.led.turnOff();
},
work: function() {
var that = this;
that.reset();
that.button.on('push', function() {
that.led.turnOn();
that.writeMessage("Lights On", "blue");
});
that.button.on('release', function() {
that.reset();
});
}
}).start();

Cylon OpenCV
252

Cylon JS

root@edison:~# npm install cylon cylon-opencv

253

Johnny Five

Johnny Five
The JavaScript "Tessel 2" Programming Framework
Johnny-Five is the original JavaScript Robotics programming framework.
Released by Bocoup in 2012, Johnny-Five is maintained by a community of
passionate software developers and hardware engineers. Over 75 developers
have made contributions towards building a robust, extensible and
composable ecosystem.
Johnny Five Homepage
Johnny Five Github
Johnny Five IO Plugins
Intel Galileo & Intel Edison IO Plugin for Johnny-Five

galileo-io
Intel Galileo IO Plugin for Johnny-Five JavaScript Robotics
NPM JS Galileo-Io
root@edison:~# npm install galileo-io johnny-five
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\-\|/-\|/--\|/-\|
> galileo-io@0.9.4 postinstall /home/root/node_modules/galil
eo-io
> node scripts/postinstall
...
es6-shim@0.35.0
serialport@2.0.6 (bindings@1.2.1, sf@0.1.7, async@
0.9.0, debug@2.2.0, optimist@0.6.1, nan@2.0.9)
root@edison:~# vi jf.js

254

Johnny Five

var five = require("johnny-five");


var Edison = require("galileo-io");
var board = new five.Board({
io: new Edison()
});
board.on("ready", function() {
var led = new five.Led(13);
led.blink(500);
});

root@edison:~# node jf.js


1459102398059 Device(s) Intel Edison
1459102398074 Connected Intel Edison
1459102398097 Repl Initialized
>>
^C
>> 1459102426530 Board Closing.
root@edison:~#

edison-io
Intel Edison IO Plugin for Johnny-Five JavaScript Robotics
Requirements:
Grove Button @ D4
root@edison:~/trash# npm install johnny-five edison-io
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/ ...
npm WARN engine edison-io@0.9.4: wanted: {"node":"latest"} (
current: {"node":"0.10.38",")
edison-io@0.9.4 ../node_modules/edison-io
root@edison:~/trash# vi edi.js

255

Johnny Five

var five = require("johnny-five");


var Edison = require("edison-io");
var board = new five.Board({
io: new Edison()
});
board.on("ready", function() {
var button = new five.Button(4);
var led = new five.Led(13);
button.on("press", function() {
led.on();
});
button.on("release", function() {
led.off();
});
});

root@edison:~/trash# node edi.js


1459107445851 Device(s) Intel Edison
1459107445867 Connected Intel Edison
1459107445892 Repl Initialized
>>

Push Grove Button and see Board Led


^C
(^C again to quit)
>>
1459107452651 Board Closing.

LCD I2C
Requirements:

256

Johnny Five
Grove LCD RGB Backlight @ I2C
var five = require("johnny-five");
var Edison = require("edison-io");
var board = new five.Board({
io: new Edison()
});
board.on("ready", function() {
var lcd = new five.LCD({
controller: "JHD1313M1"
});
lcd.useChar("heart");
lcd.cursor(0, 0).print("hello :heart:");
lcd.blink();
lcd.cursor(1, 0).print("Blinking? ");
});

257

ROS

Robot Operating System (ROS)


The Robot Operating System (ROS) is a flexible framework for writing robot
software. It is a collection of tools, libraries, and conventions that aim to
simplify the task of creating complex and robust robot behavior across a wide
variety of robotic platforms. The Robot Operating System (ROS) Homepage
Installing ROS Indigo on Intel Edison
ROS on Intel Edison using Ubilinux and Porting to Yocto
Installing ROS on the Intel Edison

MavRos
MavRos Github

258

Gobot

Gobot
Go, Robot, Go! Golang Powered Robotics. Next generation robotics
framework with support for 18 different platforms. Gobot Homepage
Gobot is a framework for robotics, physical computing, and the Internet of
Things, written in the Go programming language.
Gobot Intel Edison

259

Pixhawk

Pixhawk
Pixhawk is an independent, open-hardware project aiming at providing highend autopilot hardware to the academic, hobby and industrial communities at
low costs and high availability. We are one of the projects constituting the
Linux Foundation DroneCode project. Pixhawk
Pixhawk Intel Edison

260

Artoo

Artoo
We believe that it's time to bring Ruby and Robots together. Next generation
robotics framework with support for 15 different platforms Artoo Homepage

261

Bower

Bower
Web sites are made of lots of things frameworks, libraries, assets, and
utilities. Bower manages all these things for you. Bower Homepage
root@edison:~# npm install -g bower
-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/
-\|/-\|/-\|/-\|/-\|/-\|/-\|/usr/bin/bower -> /usr/lib/node_mor
bower@1.7.7 /usr/lib/node_modules/bower

262

Zetta

Zetta
Zetta is an open source platform built on Node.js for creating Internet of
Things servers that run across geo-distributed computers and the cloud. Zetta
combines REST APIs, WebSockets and reactive programming perfect for
assembling many devices into data-intensive, real-time applications. Zetta
Homepage

263

Miscellaneous

Misc
Squid Proxy, Ubilinux
Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and
more. It reduces bandwidth and improves response times by caching and
reusing frequently-requested web pages. Squid has extensive access controls
and makes a great server accelerator. It runs on most available operating
systems, including Windows and is licensed under the GNU GPL.
Squid Proxy on Debian Linux
root@ubilinux:~# apt-get install squid3 squid3-common

DHCP, Ubilinux
root@ubilinux:~# apt-get install dhcpd

Apache, Ubilinux
root@ubilinux:~# apt-get install apache2
root@ubilinux:~# apache2 -k restart # Wrong
root@ubilinux:~# /etc/init.d/apache2 restart # Ok

WifiDog

264

Miscellaneous

root@ubilinux:~# git clone https://github.com/wifidog/wifido


g-gateway.git
root@ubilinux:~# cd wifidog-gateway
root@ubilinux:~/wifidog-gateway# ./autogen.sh
root@ubilinux:~/wifidog-gateway# ./configure
root@ubilinux:~/wifidog-gateway# make
root@ubilinux:~/wifidog-gateway# make install
root@ubilinux:~/wifidog-gateway# wifidog
[6][Fri Jan 8 23:23:20 2016][16159](conf.c:651) Reading con
figuration file '/usr/local/etc/wifidog.conf'
[3][Fri Jan 8 23:23:20 2016][16159](conf.c:654) Could not o
pen configuration file '/usr/local/etc/wifidog.conf', exiting...
root@ubilinux:~# git clone https://github.com/wifidog/wifido
g-auth.git
root@ubilinux:~# apt-get install postgresql-9.1
root@ubilinux:~# apt-get install php5-pgsql
root@ubilinux:~# apt-get install php-pear
root@ubilinux:~# apt-get install php5-curl
root@ubilinux:~# wget http://prdownloads.sourceforge.net/phl
ickr/Phlickr-0.2.5.tgz?download
root@ubilinux:~# pear install Phlickr-0.2.5.tgz\?download

FreeRadius
root@ubilinux:~# apt-get install freeradius

FreeRadius Homepage

265

Subsystems

Subsystems
Anatomy of the Linux kernel
KernelLinux Kernel Subsystems
Hacking platform drivers into Intel Edison

266

X File Systems

X File Systems
Procfs
The proc filesystem (procfs) is a special filesystem in Unix-like operating
systems that presents information about processes and other system
information in a hierarchical file-like structure, providing a more convenient
and standardized method for dynamically accessing process data held in the
kernel than traditional tracing methods or direct access to kernel memory.
Typically, it is mapped to a mount point named /proc at boot time. Wikipedia
root@edison:~# ls /proc/
1 21 290 45 7 93 filesystems sch
ed_debug
10 210 291 4504 70 94 fs sch
edstat
11 213 292 451 71 95 interrupts scs
i
117 214 297 4523 72 96 iomem sel
f
12 218 3 4526 73 asound ioports sla
binfo
125 22 30 4545 76 buddyinfo irq sof
tirqs
126 225 309 4549 77 bus kallsyms stat
127 23 310 46 78 cgroups key-users sys
13 244 317 460 8 cmdline keys sys
rq-trigger
131 25 321 47 80 consoles kmsg sys
vipc
132 251 327 486 82 cpuinfo kpagecount tim
er_list
14 256 331 492 83 crypto kpageflags tim
er_stats
142 26 332 5 84 debug_read_history loadavg tty

267

X File Systems
16 27 387 541 85 devices locks upt
ime
166 270 43 60 86 diskstats meminfo ver
sion
17 276 434 61 87 dma misc vma
llocinfo
18 278 4382 62 88 dri modules vms
tat
19 28 4383 63 89 driver mounts zon
einfo
2 284 44 65 9 emmc_ipanic_console mtrr
20 286 4457 66 90 emmc_ipanic_header net
200 289 4458 67 91 execdomains pagetypeinfo

205 29 447 69 92 fb partitions

root@edison:~#

Devfs
devfs is an obsolete and no longer available virtual filesystem that
automatically generated the contents of /dev on some older versions of the
Linux kernel. Wikipedia
How Devfs and Dev Filesystem differ
root@edison:~# ls /dev/
...
char loop7 ram10 tty14 tty42
ttyPTI0
console mcelog ram11 tty15 tty43
ttyPTI1
cpu mem ram12 tty16 tty44
ttymcu0
cpu_dma_latency mid_ipc ram13 tty17 tty45
ttymcu1
disk mmcblk0 ram14 tty18 tty46
ttymcu2

268

X File Systems
fd mmcblk0boot0 ram15 tty19 tty47
uhid
full mmcblk0boot1 ram2 tty2 tty48
uinput
fuse mmcblk0p1 ram3 tty20 tty49
urandom
i2c-1 mmcblk0p10 ram4 tty21 tty5
usbmon0
i2c-2 mmcblk0p2 ram5 tty22 tty50
vcs
i2c-3 mmcblk0p3 ram6 tty23 tty51
vcs1
i2c-4 mmcblk0p4 ram7 tty24 tty52
vcs2
i2c-5 mmcblk0p5 ram8 tty25 tty53
vcs3
i2c-6 mmcblk0p6 ram9 tty26 tty54
vcs4
i2c-7 mmcblk0p7 random tty27 tty55
vcs5
iio:device0 mmcblk0p8 rfkill tty28 tty56
vcs6
iio:device1 mmcblk0p9 rtc tty29 tty57
vcsa
initctl mmcblk0rpmb rtc0 tty3 tty58
vcsa1
input mmcblk1 shm tty30 tty59
vcsa2
intel_sst_ctrl mqueue snd tty31 tty6
vcsa3
kmem net spidev5.1 tty32 tty60
vcsa4
kmsg network_latency stderr tty33 tty61
vcsa5
log network_throughput stdin tty34 tty62
vcsa6
loop-control null stdout tty35 tty63
vga_arbiter
loop0 nvram tty tty36 tty7
watchdog

269

X File Systems
loop1 port tty0 tty37 tty8
zero
loop2 pti tty1 tty38 tty9

loop3 ptmx tty10 tty39 ttyGS0

loop4 pts tty11 tty4 ttyMFD0

Sysfs
sysfs is a virtual file system provided by the Linux kernel that exports
information about various kernel subsystems, hardware devices, and
associated device drivers, from the kernel's device model to user space,
through virtual files. Wikipedia
Driver porting: Device model overview
Driver porting: An example /sys hierarchy
Driver porting: Devices and attributes
/sys/
/sys/fs
/sys/fs/ext4
/sys/fs/fuse
/sys/fs/selinux
/sys/fs/cgroup
/sys/fs/pstore
/sys/bus
/sys/bus/cpu
/sys/bus/i2c
/sys/bus/hid
/sys/bus/iio
/sys/bus/mmc
/sys/bus/pci
/sys/bus/spi
/sys/bus/usb
/sys/bus/usb-serial
/sys/bus/scsi
/sys/bus/sdio

270

X File Systems
sys/bus/clocksource
/sys/bus/media
/sys/bus/rpmsg
/sys/bus/serio
/sys/bus/machinecheck
/sys/bus/event_source
/sys/bus/workqueue
/sys/bus/pci_express
/sys/bus/virtio
/sys/bus/virtio
/sys/bus/platform
/sys/bus/mdio_bus
/sys/dev
/sys/dev/char
/sys/dev/block
/sys/devices
/sys/devices/cpu
/sys/devices/software
/sys/devices/pci0000:00
/sys/devices/tracepoint
/sys/devices/system
/sys/devices/virtual
/sys/devices/platform
/sys/devices/breakpoint
/sys/block
/sys/block/ram0
/sys/block/ram1
/sys/block/ram2
/sys/block/ram3
/sys/block/ram4
/sys/block/ram5
/sys/block/ram7
/sys/block/ram8
/sys/block/ram9
/sys/block/loop0
/sys/block/loop1
/sys/block/loop2
/sys/block/loop3
/sys/block/loop4
/sys/block/loop5

271

X File Systems
/sys/block/loop6
/sys/block/loop7
/sys/block/ram10
/sys/block/ram11
/sys/block/ram12
/sys/block/ram13
/sys/block/ram14
/sys/block/ram15
/sys/block/mmcblk0rpmb
/sys/block/mmcblk0boot0
/sys/block/mmcblk0boot1
/sys/block/mmcblk0
/sys/block/mmcblk1
/sys/class
/sys/class/vc
/sys/class/bdi
/sys/class/bsg
/sys/class/dma
/sys/class/dmi
/sys/class/drm
/sys/class/mem
/sys/class/net
/sys/class/msr
/sys/class/pps
/sys/class/ptp
/sys/class/pwm
/sys/class/rtc
/sys/class/udc
/sys/class/tty
/sys/class/mmc_host
/sys/class/scsi_disk
/sys/class/scsi_host
/sys/class/gpio
/sys/class/leds
/sys/class/misc
/sys/class/regulator
/sys/class/devfreq
/sys/class/i2c-dev
/sys/class/block
/sys/class/cpuid

272

X File Systems
/sys/class/hwmon
/sys/class/input
/sys/class/graphics
/sys/class/sound
/sys/class/spi_master
/sys/class/power_supply
/sys/class/ieee80211
/sys/class/thermal
/sys/class/firmware
/sys/class/scsi_generic
/sys/class/extcon
/sys/class/hidraw
/sys/class/scsi_device
/sys/class/rfkill
/sys/class/spidev
/sys/class/usbmon
/sys/class/vtconsole
/sys/class/backlight
/sys/class/i2c-adapter
/sys/class/video_output
/sys/class/pci_bus
/sys/class/mdio_bus
/sys/class/bluetooth
/sys/class/video4linux
/sys/power
/sys/power/state
/sys/power/wake_unlock
/sys/power/pm_freeze_timeout
/sys/power/pm_print_times
/sys/power/wakeup_count
/sys/power/pm_async
/sys/power/wake_lock
/sys/power/pm_test
/sys/firmware
/sys/firmware/sfi
/sys/firmware/memmap
/sys/kernel
/sys/kernel/mm
/sys/kernel/rcu_expedited
/sys/kernel/slab

273

X File Systems
/sys/kernel/pmic_debug
/sys/kernel/debug
/sys/kernel/notes
/sys/kernel/kexec_crash_size
/sys/kernel/config
/sys/kernel/fscaps
/sys/kernel/kexec_crash_loaded
/sys/kernel/uevent_helper
/sys/kernel/uevent_seqnum
/sys/kernel/profiling
/sys/kernel/fw_update
/sys/kernel/vmcoreinfo
/sys/kernel/kexec_loaded
/sys/module
/sys/module/sg
/sys/module/vt
/sys/module/mmc_core
/sys/module/brd
/sys/module/drm
/sys/module/hid
/sys/module/nfs
/sys/module/otg
/sys/module/pti
/sys/module/sit
/sys/module/snd
/sys/module/stm
/sys/module/tcp_cubic
/sys/module/asix
/sys/module/bnep
/sys/module/fuse
/sys/module/hidp
/sys/module/ipv6
/sys/module/loop
/sys/module/cfg80211
/sys/module/ramoops
/sys/module/bcm4334x
/sys/module/u_serial
/sys/module/cpuidle
/sys/module/rcutree
/sys/module/dns_resolver

274

X File Systems
...
/sys/module/usbcore
/sys/module/input_polldev
/sys/module/xz_dec
/sys/module/pcie_aspm
/sys/module/dwc3_intel_mrfl
/sys/module/netconsole
/sys/module/oprofile
/sys/module/cdc_ncm
/sys/module/bluetooth
/sys/module/rcupdate
/sys/module/intel_mid
/sys/module/snd_intel_sst
/sys/module/intel_idle
/sys/module/nf_conntrack
/sys/module/keyboard
/sys/module/xhci_hcd
/sys/module/snd_seq_midi
/sys/module/nf_conntrack_ipv4

root@edison:~# mount
/dev/mmcblk0p8 on / type ext4 (rw,nodev,noatime,discard,noau
to_da_alloc,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=491272k,nr_
inodes=122818,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,m
ode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,node
v,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cg)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec
,relatime)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev
,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,

275

X File Systems
nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,node
v,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,node
v,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,
noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,n
odev,noexec,relatime,perf_event)
systemd-1 on /boot type autofs (rw,relatime,fd=22,pgrp=1,tim
eout=300,minproto=5,maxproto=5,direct)
tmpfs on /tmp type tmpfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
systemd-1 on /home type autofs (rw,relatime,fd=31,pgrp=1,tim
eout=300,minproto=5,maxproto=5,direct)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatim
e)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk0p5 on /factory type ext4 (ro,nosuid,nodev,noatim
e,discard,noauto_da_alloc)
/dev/mmcblk0p10 on /home type ext4 (rw,nosuid,nodev,noatime,
discard,noauto_da_alloc,data=ordered)
/dev/mmcblk0p7 on /boot type vfat (rw,nosuid,nodev,noatime,f
mask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortna)

276

Pin Muxing

Pin Muxing
When working with the ports on the Linux-level, Pin Muxing are performed by
MRAA library. In the case of the microcontroller it is necessary to take care
with scripts...
MRAA Low Level Skeleton Library for IO Communication on GNU/Linux
platforms

Configuring all 4 of the PWM pins


root@edison:~# vi pinmuxpwm.sh
#!/bin/bash
# Configuring PWM pins
# The Intel Edison SoC offers only four PWM pins.
# Setup shield pins of arduino as a PWM output
# the TRI_STATE_ALL signal is controlled by GPIO 214
# Before setting up any muxing, set pin 214 (TRI_STATE_ALL)
to HIGH,
# make all of your changes, then set pin 214 to LOW.
# all GPIO pin-mux must be set to 'mode1' to select PWM
# Shield_Pin | Linux_GPIO | Output=High | Pullup_enable
# IO3 12 251 219
# IO5 13 253 221
# IO6 182 254 222
# IO9 183 257 225
#Export the relevant pins
echo 251 > /sys/class/gpio/export
echo 219 > /sys/class/gpio/export
echo 253 > /sys/class/gpio/export

277

Pin Muxing
echo 221 > /sys/class/gpio/export
echo 254 > /sys/class/gpio/export
echo 222 > /sys/class/gpio/export
echo 257 > /sys/class/gpio/export
echo 225 > /sys/class/gpio/export
echo 214 > /sys/class/gpio/export
echo "Exports Done"
# FIRST Shield_pinIO3
echo low > /sys/class/gpio/gpio214/direction
echo high > /sys/class/gpio/gpio251/direction
echo in > /sys/class/gpio/gpio219/direction
echo mode1 > /sys/kernel/debug/gpio_debug/gpio12/current_pin
mux
echo high > /sys/class/gpio/gpio214/direction
# SECOND Shield_pinIO5
echo low > /sys/class/gpio/gpio214/direction
echo high > /sys/class/gpio/gpio253/direction
echo in > /sys/class/gpio/gpio221/direction
echo mode1 > /sys/kernel/debug/gpio_debug/gpio13/current_pin
mux
echo high > /sys/class/gpio/gpio214/direction
# THIRD Shield_pinIO6
echo low > /sys/class/gpio/gpio214/direction
echo high > /sys/class/gpio/gpio254/direction
echo in > /sys/class/gpio/gpio222/direction
echo mode1 > /sys/kernel/debug/gpio_debug/gpio182/current_pi
nmux
echo high > /sys/class/gpio/gpio214/direction
# FOURTH Shield_pinIO9
echo low > /sys/class/gpio/gpio214/direction
echo high > /sys/class/gpio/gpio257/direction
echo in > /sys/class/gpio/gpio225/direction
echo mode1 > /sys/kernel/debug/gpio_debug/gpio183/current_pi
nmux
echo high > /sys/class/gpio/gpio214/direction

278

Pin Muxing

echo "PWM Pins Configured"

You should be able to use any of the PWM pins as output. For example pin IO6:
root@edison:~# echo 2 > /sys/class/pwm/pwmchip0/export
root@edison:~# echo 2000000 > /sys/class/pwm/pwmchip0/pwm2/d
uty_cycle
root@edison:~# echo 1 > /sys/class/pwm/pwmchip0/pwm2/enable

279

Memory

Memory
Documentation for /proc/sys/vm/*

280

Input

Input
Bluetooth Controller Input

Lab
Daemon listening to Edison PWR long button press, and starting OOBE
service when it happens Power Button Handler

281

General Purpose Input Output

General Purpose Input Output (GPIO)


==
General-purpose input/output (GPIO) is a generic pin on an integrated circuit
whose behaviorincluding whether it is an input or output pinis controllable
by the user at run time. Wikipedia
Linux Kernel GPIO Documentation
LWN GPIO In The Kernel: An Introduction
Wikipedia GPIO

Kernel Integration
Kernel Display Message
root@edison:~# dmesg | grep -i gpio
[ 0.000000] SFI: GPIO E3A27, 0964 (v1 INTEL INTELFDK)
[ 0.189472] wifi_platform_data: GPIO == 64
[ 0.189618] IPC bus, name = msic_gpio, irq = 0x31
[ 0.209216] virtio_rpmsg_bus virtio0: creating channel rp
msg_msic_gpio addr 0x5
[ 1.584512] vwlan gpio 96
[ 1.971456] info[ 0]: name = power_btn, gpio = -1
[ 1.971473] info[ 1]: name = SW1UI4, gpio = 61
[ 2.004409] input: gpio-keys as /devices/platform/gpio-ke
ys/input/input0

Userspace Interfaces

282

General Purpose Input Output

root@edison:~# ls /sys/class/gpio/
export gpio125 gpio127 gpio129 gpio131 gpio1
33 gpiochip0
gpio124 gpio126 gpio128 gpio130 gpio132 gpio1
34 unexport

You are seeing 3 kind of entries:


Control interfaces used to get userspace control over GPIOs;
GPIOs themselves; and
GPIO controllers ("gpio_chip" instances).
GPIO Sysfs

Watching it change (a primer on GPIO and GPIO


configuration this content is moving to GPIO
Subsystem)
To see the status of our exported pins in the Edison, type this your Edison's
terminal:
root@edison:~# watch -n 1 cat /sys/kernel/debug/gpio

Basically, it will output the configured GPIO's to console every second:

283

General Purpose Input Output

Every 1s: cat /sys/kernel/debug/gpio


2015-10-13 21:02:27
PIOs 0-191, pci/0000:00:0c.0, 0000:00:0c.0:
gpio-61 (SW1UI4 ) in hi
gpio-64 (bcm43xx_irq ) in hi
gpio-71 (bcm_bt_lpm ) out lo
gpio-77 (sd_cd ) in hi
gpio-96 (vwlan ) out hi
gpio-111 (Arduino Shield SS ) out hi
gpio-124 (hsu ) in hi
gpio-125 (hsu ) in hi
gpio-126 (hsu ) in hi
gpio-127 (hsu ) in hi
gpio-128 (hsu ) in hi
gpio-129 (hsu ) in hi
gpio-130 (hsu ) in hi
gpio-131 (hsu ) in hi
gpio-132 (hsu ) in lo
gpio-133 (hsu ) out lo
gpio-134 (hsu ) in hi
gpio-184 (bcm_bt_lpm ) out lo
gpio-185 (bcm_bt_lpm ) in lo
GPIOs 200-215, i2c/1-0020, pcal9555a, can sleep:
gpio-207 (sysfs ) in hi
gpio-215 (sysfs ) out lo
GPIOs 216-231, i2c/1-0021, pcal9555a, can sleep:
GPIOs 232-247, i2c/1-0022, pcal9555a, can sleep:
GPIOs 248-263, i2c/1-0023, pcal9555a, can sleep:

The gpio's displayed above, are the ones reserved (AKA exported) by default in a
newly flashed yocto image Poky (Yocto Project Reference Distro) 1.7.2 edison,
kernel 3.10.17-poky-edison+
To reserve and use a GPIO, Before:

284

General Purpose Input Output

root@edison:~# ls /sys/class/gpio
export gpio127 gpio131 gpio207 gpioch
ip216
gpio124 gpio128 gpio132 gpio215 gpioch
ip232
gpio125 gpio129 gpio133 gpiochip0 gpioch
ip248
gpio126 gpio130 gpio134 gpiochip200 unexpo
rt

let's say 48 lets type the following:


root@edison:/# echo 48 > /sys/class/gpio/export

by this mechanism, a new directory is created in /sys/class/gpio, which should be


gpio48: After:
root@edison:/# ls sys/class/gpio/
export gpio127 gpio131 gpio207 gpiochip
200 unexport
gpio124 gpio128 gpio132 gpio215 gpiochip
216
gpio125 gpio129 gpio133 gpio48 gpiochip
232
gpio126 gpio130 gpio134 gpiochip0 gpiochip
248

This directory, is a control interface used to get userspace control over GPIO48,
therefore can have the following read/write attributes:
"direction" ... reads as either "in" or "out". This value ma
y
normally be written. Writing as "out" defaults to
initializing the value as low. To ensure glitch free
operation, values "low" and "high" may be written to
configure the GPIO as an output with that initial value.

285

General Purpose Input Output


Note that this attribute *will not exist* if the kernel
doesn't support changing the direction of a GPIO, or
it was exported by kernel code that didn't explicitly
allow userspace to reconfigure this GPIO's direction.
"value" ... reads as either 0 (low) or 1 (high). If the GPIO
is configured as an output, this value may be written;
any nonzero value is treated as high.
If the pin can be configured as interrupt-generating int
errupt
and if it has been configured to generate interrupts (se
e the
description of "edge"), you can poll(2) on that file and
poll(2) will return whenever the interrupt was triggered
. If
you use poll(2), set the events POLLPRI and POLLERR. If
you
use select(2), set the file descriptor in exceptfds. Aft
er
poll(2) returns, either lseek(2) to the beginning of the
sysfs
file and read the new value or close the file and re-ope
n it
to read the value.
"edge" ... reads as either "none", "rising", "falling", or
"both". Write these strings to select the signal edge(s)
that will make poll(2) on the "value" file return.
This file exists only if the pin can be configured as an
interrupt generating input pin.
"active_low" ... reads as either 0 (false) or 1 (true). Writ
e
any nonzero value to invert the value attribute both
for reading and writing. Existing and subsequent
poll(2) support configuration via the edge attribute
for "rising" and "falling" edges will follow this
setting.

286

General Purpose Input Output

Exercise Change GPIO Direction


As explained before the GPIO control interface has some read/write attributes, so
lets go ahead and change the default direction of the GPIO48.
1. Review the current GPIO direction using the command to debug GPIO
statuses; If the direction is "out" let's change it to "in", if it is "in", change it
to "out"
2. To change it, from "in" to "out " we only have to write "out" to attribute
GPIO48/direction like this:
echo out > /sys/class/gpio/gpio48/direction

Then checking again the GPIO status we can see, that direction has changed.
Here is a table that shows the direction before and after the change:
| GPIO48 Previous Direction | GPIO48 New Direction |
| -- | -- |
| gpio-48 (sysfs ) **in** lo| gpio-48 (sysf
s ) **out** lo |

Exercise Use Python Bindings


mraa
apt-get install python-smbus

Lab
Blinks the Edison LED Here

287

Serial

Serial
In telecommunication and computer science, serial communication is the
process of sending data one bit at a time, sequentially, over a communication
channel or computer bus. This is in contrast to parallel communication, where
several bits are sent as a whole, on a link with several parallel channels.
Wikipedia
Intel Edison: using UART ttyMFD1 serial port
Using USB-serial FTDI adapters with Intel Edison
Intel Edison Types of Serial Ports
Sparkfun Serial Terminal Basics
TLDP Serial HOWTO
Linux Journal Greg Kroah-Hartman The Serial Driver Layer

Kernel Integration
Kernel Display Message
root@edison:~# dmesg | grep -i serial
[ 0.000000] Kernel command line: rootwait root=PARTUUID=0
12b3303-34ac-284d-99b4-34e03a2335f4 rootfstype=ext4 console=ttyM
FD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=
cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSeria
lNumber=5e7bb54a65035af180191c2d7bd527b6 g_multi.dev_addr=02:00:
86:d5:27:b6 platform_mrfld_audio.audio_codec=dummy
[ 0.704157] HSU serial 0000:00:04.0: FUNC: 0 driver: 0 ad
dr:ff010000 len:80
[ 0.704215] HSU serial 0000:00:04.1: FUNC: 1 driver: 0 ad
dr:ff010080 len:80
[ 0.705663] HSU serial 0000:00:04.2: FUNC: 2 driver: 0 ad
dr:ff010100 len:80
[ 0.707102] HSU serial 0000:00:04.3: FUNC: 3 driver: 0 ad
dr:ff010180 len:80
[ 0.744061] usbcore: registered new interface driver usbs

288

Serial
erial
[ 0.744199] usbserial: USB Serial support registered for
pl2303
[ 3.758915] systemd[1]: Starting system-serial\x2dgetty.s
lice.
[ 3.833730] systemd[1]: Created slice system-serial\x2dge
tty.slice.
root@edison:~# dmesg | grep -i tty
[ 0.000000] Kernel command line: rootwait root=PARTUUID=0
12b3303-34ac-284d-99b4-34e03a2335f4 rootfstype=ext4 console=ttyM
FD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=
cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSeria
lNumber=5e7bb54a65035af180191c2d7bd527b6 g_multi.dev_addr=02:00:
86:d5:27:b6 platform_mrfld_audio.audio_codec=dummy
[ 0.705116] 0000:00:04.1: ttyMFD0 at MMIO 0xff010080 (irq
= 28) is a hsu_bt_port_p
[ 0.706565] 0000:00:04.2: ttyMFD1 at MMIO 0xff010100 (irq
= 29) is a hsu_uart1_port_p
[ 0.707871] 0000:00:04.3: ttyMFD2 at MMIO 0xff010180 (irq
= 54) is a hsu_uart2_port_p
[ 0.713301] console [ttyMFD2] enabled
[ 1.969453] Bluetooth: RFCOMM TTY layer initialized
[ 2.776422] systemd[1]: Expecting device dev-ttyMFD2.devi
ce...
[ 3.758915] systemd[1]: Starting system-serial\x2dgetty.s
lice.
[ 3.833730] systemd[1]: Created slice system-serial\x2dge
tty.slice.
[ 3.833870] systemd[1]: Starting system-getty.slice.
[ 3.883637] systemd[1]: Created slice system-getty.slice.

Userspace Interfaces
Sysfs

289

Serial

root@edison:~# find /sys/ -name 'tty:ttyS*'


/sys/devices/pci0000:00/0000:00:04.1/tty
/sys/devices/pci0000:00/0000:00:04.1/tty/ttyMFD0
/sys/devices/pci0000:00/0000:00:04.2/tty
/sys/devices/pci0000:00/0000:00:04.2/tty/ttyMFD1
/sys/devices/pci0000:00/0000:00:04.3/tty
/sys/devices/pci0000:00/0000:00:04.3/tty/ttyMFD2
/sys/devices/pci0000:00/0000:00:12.0/tty
/sys/devices/pci0000:00/0000:00:12.0/tty/ttyPTI0
/sys/devices/pci0000:00/0000:00:12.0/tty/ttyPTI1
/sys/devices/virtual/tty
/sys/devices/virtual/tty/tty
/sys/devices/virtual/tty/tty0
/sys/devices/virtual/tty/tty1
...
/sys/devices/virtual/tty/ttyXX
/sys/devices/platform/intel_mcu/tty
/sys/devices/platform/intel_mcu/tty/ttymcu0
/sys/devices/platform/intel_mcu/tty/ttymcu1
/sys/devices/platform/intel_mcu/tty/ttymcu2
/sys/class/tty
/sys/class/tty/tty
/sys/class/tty/tty0
/sys/class/tty/tty63
/sys/class/tty/ttyMFD0
/sys/class/tty/ttyMFD1
/sys/class/tty/ttyMFD2
/sys/class/tty/ttyPTI0
/sys/class/tty/ttyPTI1
/sys/class/tty/ttymcu0
/sys/class/tty/ttymcu1
/sys/class/tty/ttymcu2
/sys/class/tty/ttyGS0

Devfs

290

Serial

root@edison:~# ls /dev/tty*
/dev/tty /dev/tty2 /dev/tty31 /dev/tty43 /dev
/tty55 /dev/ttyGS0
/dev/tty0 /dev/tty20 /dev/tty32 /dev/tty44 /dev
/tty56 /dev/ttyMFD0
/dev/tty1 /dev/tty21 /dev/tty33 /dev/tty45 /dev
/tty57 /dev/ttyMFD1
/dev/tty10 /dev/tty22 /dev/tty34 /dev/tty46 /dev
/tty58 /dev/ttyMFD2
/dev/tty11 /dev/tty23 /dev/tty35 /dev/tty47 /dev
/tty59 /dev/ttyPTI0
/dev/tty12 /dev/tty24 /dev/tty36 /dev/tty48 /dev
/tty6 /dev/ttyPTI1
/dev/tty13 /dev/tty25 /dev/tty37 /dev/tty49 /dev
/tty60 /dev/ttymcu0
/dev/tty14 /dev/tty26 /dev/tty38 /dev/tty5 /dev
/tty61 /dev/ttymcu1
/dev/tty15 /dev/tty27 /dev/tty39 /dev/tty50 /dev
/tty62 /dev/ttymcu2
/dev/tty16 /dev/tty28 /dev/tty4 /dev/tty51 /dev
/tty63
/dev/tty17 /dev/tty29 /dev/tty40 /dev/tty52 /dev
/tty7
/dev/tty18 /dev/tty3 /dev/tty41 /dev/tty53 /dev
/tty8
/dev/tty19 /dev/tty30 /dev/tty42 /dev/tty54 /dev
/tty9

Applications / Libraries
Setup
Opkg

291

Serial

root@edison:~# opkg install screen


Installing screen (4.0.3-r4) on root.
...
Configuring screen.
root@edison:~#

Pip
root@edison:~# pip install pyserial
Cleaning up...
root@edison:~#

Apt-Get
root@edison:~# apt-get install screen minicom cu setserial s
tty
root@edison:~# pip install pyserial

Programs
root@edison:~# screen /dev/ttyS0
root@edison:~# minicom /dev/ttyS0
root@edison:~# cu /dev/ttyUSB0 115200
root@edison:~# setserial -g /dev/ttyS[0123]
root@edison:~# setserial -g /dev/ttyUSBS[0123]
root@edison:~# setserial -g /dev/ttyMFD[0123]
root@edison:~# setserial /dev/ttyS0 115200
root@edison:~# stty -F /dev/ttyUSB0 115200
root@edison:~# stty -F /dev/ttyMFD 115200

Python

292

Serial

#!/usr/bin/python
import serial
ser = serial.Serial("/dev/ttyMFD0", timeout=10)
lines = ser.readlines()
for i in range(10):
print(lines[i].strip())

293

Bluetooth

BlueTooth
Bluetooth is a wireless technology standard for exchanging data over short
distances from fixed and mobile devices, and building personal area networks
... Wikipedia
Intel Edison Boards Bluetooth User Guide
Setting Up a New Intel Edison Set Up Bluetooth
Turn your Intel Edison into an iBeacon
Sparkfun Bluetooth Profiles

Kernel Integration
BlueZ. Official Linux Bluetooth Protocol Stack
Bluetooth tools and daemons. This package contains tools and system
daemons for using Bluetooth devices. BlueZ is the official Linux Bluetooth
protocol stack. It is an Open Source project distributed under GNU
General Public License (GPL). Bluez Homepage
BlueZ GIT Repository
Bluetooth Kernel Subsystem
bluetooth.git
bluetooth-next.git
Bluez Tools
hciconfig - HCI device configuration utility
hciattach - HCI UART driver initialization utility
l2ping - L2CAP ping
hcidump - HCI packet analyzer
hcitool - Generic writing and monitoring to the HCI interface
bluetooth-agent
bluetoothctl

294

Bluetooth

Kernel Display Message


Bluetooth Built-In Controller
root@edison:~# dmesg | grep -i blue
[ 0.235619] Bluetooth: Core ver 2.16
[ 0.235722] Bluetooth: HCI device and connection manager
initialized
[ 0.235752] Bluetooth: HCI socket layer initialized
[ 0.235778] Bluetooth: L2CAP socket layer initialized
[ 0.235876] Bluetooth: SCO socket layer initialized
[ 0.922994] Bluetooth: HCI UART driver ver 2.2
[ 0.923015] Bluetooth: HCI H4 protocol initialized
[ 1.588016] Bluetooth: RFCOMM TTY layer initialized
[ 1.588081] Bluetooth: RFCOMM socket layer initialized
[ 1.588100] Bluetooth: RFCOMM ver 1.11
[ 1.588116] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 1.588130] Bluetooth: BNEP filters: protocol multicast
[ 1.588160] Bluetooth: BNEP socket layer initialized
[ 1.588175] Bluetooth: HIDP (Human Interface Emulation) v
er 1.2
[ 1.588202] Bluetooth: HIDP socket layer initialized

Bluetooth USB Dongle

295

Bluetooth

root@edison:~# dmesg
...
[ 85.022971] usb 1-1: new full-speed USB device number 2 using
dwc3-host
[ 85.085188] usb 1-1: New USB device found, idVendor=0a12, idP
roduct=0001
[ 85.085218] usb 1-1: New USB device strings: Mfr=1, Product=2
, SerialNumber=0
[ 85.085240] usb 1-1: Product: Bluetooth V2.0 Dongle

[ 85.085259] usb 1-1: Manufacturer: Bluetooth v2.0
```sh
### Kernel Modules
```sh
root@edison:~# lsmod
Module Size Used by
usb_f_acm 14335 1
...
bcm_bt_lpm 13708 0
bcm4334x 587105 0

Applications / Libraries

296

Bluetooth
ConnMan
Daemon for managing Internet connections within embedded device and
integrates a vast range of communication features usually split between
many daemons such as DHCP, DNS and NTP. The result of this
consolidation is low memory consumption with a fast, coherent,
synchronized reaction to changing network conditions. ConnMan
Homepage
RFKill
A small userspace tool to query the state of the rfkill switches, buttons
and subsystem interfaces. Some devices come with a hard switch that
lets you kill different types of RF radios: 802.11 / Bluetooth / NFC / UWB /
WAN / WIMAX / FM. Some times these buttons may kill more than one
RF type. The Linux kernel rfkill subsystem exposes these hardware
buttons and lets userspace query its status and set its status through a
/dev/rfkill. Given that at times some RF devices do not have hardware
rfkill buttons rfkill the Linux kernel also exposes software rfkill capabilities
that allows userspace to mimic a hardware rfkill event and turn on or off
RF. Rfkill Homepage
Python interface to Bluetooth LE on Linux Github
root@edison:~# rfkill list
0: phy0: wlan
Soft blocked: no
Hard blocked: no
1: brcmfmac-wifi: wlan
Soft blocked: no
Hard blocked: no
2: bcm43xx Bluetooth: bluetooth
Soft blocked: yes
Hard blocked: no

Setup
Opkg
297

Bluetooth

root@edison:~# opkg install bluez5-dev

Pip
root@edison:~# pip install pyserial pybluez

Apt-Get
root@edison:~# apt-get install bluetooth pulseaudio pulseaud
io-module-bluetooth pavucontrol bluez-firmware
root@edison:~# /etc/init.d/bluetooth start

Programs

298

Bluetooth

root@edison:~# systemctl status bluetooth.service


root@edison:~# systemctl stop bluetooth
root@edison:~# systemctl start bluetooth
root@edison:~# systemctl enable bluetooth
root@edison:~# rfkill unblock bluetooth
root@edison:~# rfkill list bluetooth
2: bcm43xx Bluetooth: bluetooth
Soft blocked: no
Hard blocked: no
4: hci0: bluetooth
Soft blocked: no
Hard blocked: no
root@edison:~# hciconfig hci0 down
root@edison:~# hciconfig hci0 up
root@edison:~# hciconfig hci0 status
hci0: Type: BR/EDR Bus: UART
BD Address: 98:4F:EE:03:39:02 ACL MTU: 1021:8 SCO MTU:
64:1
UP RUNNING PSCAN
...
root@edison:~# hciconfig hci0 piscan
...
root@edison:~# hcitool scan

Python

299

Bluetooth

root@edison:~# git clone https://github.com/karulis/pybluez


Cloning into 'pybluez'...
remote: Counting objects: 1082, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 1082 (delta 5), reused 0 (delta 0), pack-reuse
d 1061
Receiving objects: 100% (1082/1082), 415.85 KiB | 407.00 KiB
/s, done.
Resolving deltas: 100% (658/658), done.
Checking connectivity... done.
root@edison:~# cd pybluez/examples
root@edison:~/pybluez/examples# ls
advanced ble bluezchat simple

Npm
Install "Locate Beacon" Android App
root@edison:~# opkg update
root@edison:~# opkg install bluez5-dev
root@edison:~# npm install -g async
root@edison:~# npm install noble
root@edison:~# npm install bleno
root@edison:~# node node_modules/bleno/test-ibeacon.js
bleno - iBeacon
on -> stateChange: poweredOn
on -> advertisingStart

Usage Models
Device Pairing

300

Bluetooth

root@edison:~# rfkill unblock bluetooth


root@edison:~# bluetoothctl
[bluetooth]# scan on
[bluetooth]# scan off
[bluetooth]# pair 40:78:6A:26:4A:C2
[bluetooth]# connect 40:78:6A:26:4A:C2
[bluetooth]# paired-devices
[bluetooth]# info 40:78:6A:26:4A:C2
[bluetooth]# exit
root@edison:~# rfcomm bind - 40:78:6A:26:4A:C2 1
root@edison:~# ls /dev/rfcomm0

Text
root@edison:~# systemctl status bluetooth.service
root@edison:~# systemctl start bluetooth
root@edison:~# systemctl enable bluetooth
root@edison:~# rfkill unblock bluetooth
root@edison:~# rfkill list bluetooth
root@edison:~# hciconfig hci0 status
Make Your Device Discoverable
root@edison:~# hcitool scan
root@edison:~# rfcomm bind 0 40:78:6A:26:4A:C2

SPP
root@edison:~# systemctl enable bluetooth
root@edison:~# rfkill unblock bluetooth

root@edison:~# vi /etc/dbus-1/system.d/bluetooth.conf

301

Bluetooth

<policy context="default">
...
<allow send_interface="org.bluez.Profile1"/>
...
</policy>

root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C MyEdison [default]
[NEW] Device 98:4F:EE:06:1B:99 edison
[bluetooth]# show
Controller 98:4F:EE:04:1A:8C
Name: edison
Alias: MyEdison
Class: 0x6c0110
Powered: yes
Discoverable: no
Pairable: yes
UUID: Generic Attribute Profile (00001801-0000-1000-8000
-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000
-00805f9b34fb)
UUID: SIM Access (0000112d-0000-1000-8000
-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000
-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000
-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000
-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000
-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000
-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000
-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0525
Discovering: no
[bluetooth]#

302

Bluetooth

root@edison:~# wget https://downloadmirror.intel.com/24909/eng/S


PP-loopback.py

root@edison:~# python SPP-loopback.py -C 22 &


[3] 462

303

Bluetooth

root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C MyEdison [default]
[NEW] Device 98:4F:EE:06:1B:99 edison
[bluetooth]# show
Controller 98:4F:EE:04:1A:8C
Name: edison
Alias: MyEdison
Class: 0x6c0110
Powered: yes
Discoverable: no
Pairable: yes
UUID: Generic Attribute Profile (00001801-0000-1000-8000
-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000
-00805f9b34fb)
UUID: SIM Access (0000112d-0000-1000-8000
-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000
-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000
-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000
-00805f9b34fb)
UUID: Audio Source (0000110a-0000-1000-8000
-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000
-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000
-00805f9b34fb)
UUID: Serial Port (00001101-0000-1000-8000
-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0525
Discovering: no
[bluetooth]#

[bluetooth]# exit
[DEL] Controller 98:4F:EE:04:1A:8C MyEdison [default]
root@edison:~# bluetoothctl

304

Bluetooth
[NEW] Controller 98:4F:EE:04:1A:8C MyEdison [default]
[NEW] Device 5B:78:E1:26:DF:12 5B-78-E1-26-DF-12
[NEW] Device E4:56:CA:13:F1:5F Kontakt
[NEW] Device 46:1F:08:C5:D9:DD 46-1F-08-C5-D9-DD
[NEW] Device BC:85:56:1D:DD:BA PCJESU
[NEW] Device 20:C3:8F:88:49:99 RECAM53SJX07788
[NEW] Device 94:65:9C:1B:FC:AA DESKTOP-NFCK84P
[NEW] Device 54:27:1E:18:86:32 Bluetooth USB Host Controller
[NEW] Device C0:D9:62:06:AA:F6 Bluetooth USB Host Controller
[NEW] Device 40:78:6A:26:4A:C2 XT1008
[NEW] Device 20:C9:D0:7E:C1:D8 MacBook Pro de Carlos
[NEW] Device 4A:C6:4B:F5:E9:FD 4A-C6-4B-F5-E9-FD
[NEW] Device 20:16:04:18:56:94 HC-05
[NEW] Device 5C:AC:4C:E4:B4:A0 Dell Wireless 365 Bluetooth Modul
e
[NEW] Device 34:E6:AD:01:5A:F8 IVAN
[NEW] Device A4:5E:60:BC:87:C2 Lluvia
[NEW] Device 80:E6:50:06:2F:7B MacBook Pro de Darius
[NEW] Device E4:F8:9C:19:69:40 RESG
[NEW] Device 28:C2:DD:21:D5:28 OSCAROMAA
[NEW] Device 9C:B7:0D:4C:EA:DC ELKIN-PC
[NEW] Device 12:27:07:00:09:24 ILIUM S420
[NEW] Device A4:5E:60:EA:3D:0E Dan Amador
[NEW] Device 34:36:3B:60:81:E9 Jonatan
[NEW] Device 52:57:A0:D5:5F:CC 52-57-A0-D5-5F-CC
[NEW] Device 43:F0:FB:66:86:E3 43-F0-FB-66-86-E3
[NEW] Device EA:A2:C0:D8:0A:0E Kontakt
[NEW] Device F1:C1:83:A4:17:0C Evolutel
[NEW] Device 4F:5E:E1:48:16:5F 4F-5E-E1-48-16-5F
[NEW] Device 62:40:14:83:78:AE 62-40-14-83-78-AE
[NEW] Device 62:D9:82:60:9E:83 62-D9-82-60-9E-83
[NEW] Device 4B:51:23:FE:59:00 4B-51-23-FE-59-00
[NEW] Device 6C:AD:AD:DE:F0:47 6C-AD-AD-DE-F0-47
[NEW] Device 69:A4:03:B7:6C:06 69-A4-03-B7-6C-06
[NEW] Device 5F:56:C1:11:DA:22 5F-56-C1-11-DA-22
[NEW] Device 98:4F:EE:06:1B:99 edison
[NEW] Device 2C:D0:5A:80:7A:44 AARCEMOR-MOBL3
[CHG] Controller 98:4F:EE:04:1A:8C Discoverable: no
[bluetooth]# pair 40:78:6A:26:4A:C2
Attempting to pair with 40:78:6A:26:4A:C2

305

Bluetooth
[CHG] Device 40:78:6A:26:4A:C2 Connected: yes
[CHG] Device 40:78:6A:26:4A:C2 Modalias: bluetooth:v001Dp1200d14
36
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001105-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 0000110a-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 0000110c-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 0000110e-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001112-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001116-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 0000111f-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 0000112f-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001132-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001200-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001800-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 UUIDs: 00001801-0000-1000-8000-00
805f9b34fb
[CHG] Device 40:78:6A:26:4A:C2 Paired: yes
Pairing successful
[CHG] Device 40:78:6A:26:4A:C2 Connected: no
[bluetooth]# trust 40:78:6A:26:4A:C2
[CHG] Device 40:78:6A:26:4A:C2 Trusted: yes
Changing 40:78:6A:26:4A:C2 trust succeeded
[bluetooth]#

306

Bluetooth

systemctl enable bluetooth


rfkill unblock bluetooth
bluetoothctl
agent KeyboardDisplay
default-agent
pair 40:78:6A:26:4A:C2
trust 40:78:6A:26:4A:C2
connect 40:78:6A:26:4A:C2

307

Bluetooth

root@edison:~# git clone https://git.kernel.org/pub/scm/bluetoot


h/bluez.git
root@edison:~# cd bluez/
root@edison:~/bluez# ls
AUTHORS Makefile.obexd android doc pe
ripheral
COPYING Makefile.plugins attrib emulator pl
ugins
COPYING.LIB Makefile.tools bootstrap gdbus pr
ofiles
ChangeLog NEWS bootstrap-configure gobex sr
c
HACKING README btio lib te
st
INSTALL TODO client monitor to
ols
Makefile.am acinclude.m4 configure.ac obexd un
it
root@edison:~/bluez# cd test/
root@edison:~/bluez/test# dir
bluezutils.py pbap-client test-device
dbusdef.py sap_client.py test-discovery
example-advertisement service-did.xml test-gatt-profile
example-gatt-client service-ftp.xml test-health
example-gatt-server service-opp.xml test-health-sink
exchange-business-cards service-record.dtd test-heartrate
ftp-client service-spp.xml test-hfp
get-managed-objects simple-agent test-manager
get-obex-capabilities simple-endpoint test-nap
list-devices simple-obex-agent test-network
list-folders simple-player test-profile
map-client test-adapter test-proximity
monitor-bluetooth test-alert test-sap-server
opp-client test-cyclingspeed test-thermometer
root@edison:~/bluez/test# ./test-profile -u 101 -n edisonSpp -s
-P 3 -C 22 serial22

https://communities.intel.com/message/269607#269607

308

Bluetooth

SPP Rfcomm
root@edison:~# rfkill unblock bluetooth
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C edison [default]
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# pair <id android device>
[bluetooth]# trust <id android device>
[bluetooth]# connect <id you paired with>
[bluetooth]# exit

309

Bluetooth

root@edison:~# rfkill unblock bluetooth


root@edison:~# hciconfig hci0 up
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C MyEdison [default]
[NEW] Device 98:4F:EE:06:1B:99 edison
[NEW] Device 2C:D0:5A:80:7A:44 AARCEMOR-MOBL3
[NEW] Device 40:78:6A:26:4A:C2 XT1008
[bluetooth]# discoverable on
Changing discoverable on succeeded
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Device 40:78:6A:26:4A:C2 Connected: yes
[CHG] Device 40:78:6A:26:4A:C2 Connected: no
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# quit
Agent unregistered
[DEL] Controller 98:4F:EE:04:1A:8C MyEdison [default]
root@edison:~# rfcomm listen hci0 &
[1] 377
root@edison:~# Waiting for connection on channel 1
Connection from 40:78:6A:26:4A:C2 to /dev/rfcomm0
Press CTRL-C for hangup
root@edison:~#

Connect from Android device from BlueTerm application


root@edison:~# cat /dev/rfcomm0

Write data from Android device from BlueTerm application

BlueTooth Headsets

310

Bluetooth

root@edison:~# rfkill unblock bluetooth


root@edison:~# bluetoothctl
root@edison:~# scan on
root@edison:~# pair 40:78:6A:26:4A:C1
root@edison:~# connect 40:78:6A:26:4A:C1
root@edison:~# quit
root@edison:~# pactl list sinks
root@edison:~# pactl set-default-sink bluez_sink.40_78_6A_26
_4A_C1
root@edison:~# gst-launch-1.0 filesrc location=sample.wav !
waveparse ! pulsesink
root@edison:~# paired-devices
root@edison:~# remove 40:78:6A:26:4A:C1

Bluetooth Sound
root@edison:~# opkg install alsa-utils kernel-module-snd-usb
-audio bluez5 gstreamer pulseaudio
root@edison:~# opkg install kernel-module-ftdi-sio
root@edison:~# rfkill unblock bluetooth
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C edison [default]
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# pair <id you find>
[bluetooth]# trust <id>
[bluetooth]# connect <id you paired with>

Serial Port Profile (SPP)


Libraries
For C Bluetooth Development:
root@edison:~# sudo apt-get install libbluetooth-dev

311

Bluetooth
For Python Bluetooth Development:
root@edison:~# sudo apt-get install python-bluez

For Python Bluetooth in Edison (using pip, if for some reason you don't have it,
learn How-To Install Pip):
root@edison:~# pip install pybluez

There are two common ways to test SPP, one is by using D-BUS, the other is by
using RFCOMM transport protocol.
To test using D-Bus we can use this python script, copy it to Edison, enable the
bluetooth device and run it:
root@edison:~# rfkill unblock bluetooth
root@edison:~# python SPP-loopback.py &

Then in an android device install a Bluetooth SPP Manager.


At this point you need to pair the Intel Edison with your android device (see
example above on how to use bluetoothctl, hcicontrol or any other user level
application in your Edison).
Once paired, open the Bluetooth SPP Manager app, hit search, and when the
Intel Edison appears tap on in to connect. now you can send text messages to
Edison which can be seen on the terminal window of the Edison.
I know this need a lil' bit further explanation. just dropped here so i won't forget.
Also what is going to be added is how to programmatically do the device
discovering, pairing and SPP using c and python

Audio
https://github.com/w4ilun/edison-guides/wiki/Bluetooth-Audio-On-Intel-Edison
https://software.intel.com/en-us/articles/play-audio-from-your-intel-edison-viabluetooth-using-advanced-audio-distribution-profile?language=fr
312

Bluetooth
http://www.instructables.com/id/Intel-Edison-pushing-bluetooth-audio/?
ALLSTEPS

313

Hackathon

Hackathon
Install Android BlueTerm Application
root@edison:~# rfkill unblock bluetooth
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C edison [default]
[bluetooth]# power on
[bluetooth]# agent on
[bluetooth]# scan on
[bluetooth]# pair <id android device>
[bluetooth]# trust <id android device>
[bluetooth]# connect <id you paired with>
[bluetooth]# exit

314

Hackathon

root@edison:~# rfkill unblock bluetooth


root@edison:~# hciconfig hci0 up
root@edison:~# bluetoothctl
[NEW] Controller 98:4F:EE:04:1A:8C MyEdison [default]
[NEW] Device 98:4F:EE:06:1B:99 edison
[NEW] Device 2C:D0:5A:80:7A:44 AARCEMOR-MOBL3
[NEW] Device 40:78:6A:26:4A:C2 XT1008
[bluetooth]# discoverable on
Changing discoverable on succeeded
[bluetooth]# pairable on
Changing pairable on succeeded
[CHG] Device 40:78:6A:26:4A:C2 Connected: yes
[CHG] Device 40:78:6A:26:4A:C2 Connected: no
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# quit
Agent unregistered
[DEL] Controller 98:4F:EE:04:1A:8C MyEdison [default]
root@edison:~# rfcomm listen hci0 &
[1] 377
root@edison:~# Waiting for connection on channel 1
Connection from 40:78:6A:26:4A:C2 to /dev/rfcomm0
Press CTRL-C for hangup
root@edison:~#

Connect from Android device from BlueTerm application


root@edison:~# cat /dev/rfcomm0

Write data from Android device from BlueTerm application

315

Hackathon

#! /usr/bin/python
import serial
from time import sleep
bluetoothSerial = serial.Serial( "/dev/rfcomm0", baudrate=9600 )
count = None
while count == None:
try:
count = int(raw_input( "Please enter the number of times
to blink the LED" ))
except:
pass
while True:
bluetoothSerial.write( str("hola") )
sleep(2)
print bluetoothSerial.readline()

316

WiFi

WiFi
Wi-Fi (or WiFi) is a local area wireless computer networking technology that
allows electronic devices to connect to the network, mainly using the 2.4
gigahertz (12 cm) UHF and 5 gigahertz (6 cm) SHF ISM radio bands.
Wikipedia
Intel Edison Features
Wi-Fi peer-to-peer connectivity with Wi-Fi Direct, Allows two Intel
Edison devices (or one Intel Edison device and a smartphone) to create
a direct Wi-Fi connection to each other without an access point.
Wi-Fi multirole, Allows a connection to an access point simultaneously
with Wi-Fi Direct operation.
Wi-Fi IBSS mode, Allows creation of multinode ad hoc networks that
contain no access point.
WiFi Wikipedia
Intel Edison Boards Wi-Fi User Guide
Intel Edison Network Access
Edison Wi-Fi Configuration
Realtek 8192 chipset driver, ported to kernel 3.11

Kernel Integration
Kernel Display Message

317

WiFi

root@edison:~# dmesg | grep -i wifi


[ 0.189658] Using generic wifi platform data
[ 0.189675] wifi_platform_data: GPIO == 64
[ 3.850154] found wifi platform device wlan
[ 4.171606] wifi_platform_set_power = 1
[ 4.373687] wifi_platform_bus_enumerate device present 1
[ 4.412928] wifi_platform_get_mac_addr
[ 4.413069] wifi_get_mac_addr_intel: unable to open /conf
ig/wifi/mac.txt
[ 4.420354] wifi_platform_set_power = 0
[ 4.421428] wifi_platform_bus_enumerate device present 0
[ 38.194385] wl_android_wifi_on in
[ 38.194403] wifi_platform_set_power = 1
[ 39.117444] wifi_platform_get_mac_addr
[ 39.117488] wifi_get_mac_addr_intel: unable to open /conf
ig/wifi/mac.txt

Kernel Modules
root@edison:~# lsmod
Module Size Used by0
usb_f_acm 14335 1
...
bcm_bt_lpm 13708 0
bcm4334x 587105 0

Applications / Libraries

318

WiFi
RFKill
rfkill is a small userspace tool to query the state of the rfkill switches,
buttons and subsystem interfaces. Some devices come with a hard
switch that lets you kill different types of RF radios: 802.11 / Bluetooth /
NFC / UWB / WAN / WIMAX / FM. Some times these buttons may kill
more than one RF type. The Linux kernel rfkill subsystem exposes these
hardware buttons and lets userspace query its status and set its status
through a /dev/rfkill. Given that at times some RF devices do not have
hardware rfkill buttons rfkill the Linux kernel also exposes software rfkill
capabilities that allows userspace to mimic a hardware rfkill event and
turn on or off RF. Rfkill Homepage
root@edison:~# rfkill list
0: phy0: wlan
Soft blocked: no
Hard blocked: no
1: brcmfmac-wifi: wlan
Soft blocked: no
Hard blocked: no
2: bcm43xx Bluetooth: bluetooth
Soft blocked: yes
Hard blocked: no

Usage Models, Ubilinux

319

WiFi

edison@ubilinux:~$ su
Password: edison
root@ubilinux:/home/edison# cd
root@ubilinux:~# nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#auto usb0
#iface usb0 inet static
# address 192.168.2.15
# netmask 255.255.255.0
auto wlan0
iface wlan0 inet dhcp
# For WPA
wpa-ssid INFINITUMxxxx
wpa-psk yyyy
# For WEP
#wireless-essid itesm
#wireless-mode Managed
#wireless-key s:""
root@ubilinux:~# ifup wlan0
root@ubilinux:~# reboot
<reboot your board, sign in and become root>

Usage Models, Yocto


Default Configuration

320

WiFi

root@Edison:~# configure_edison --wifi


Configure Edison: WiFi Connection
root@edison:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
...
usb0 Link encap:Ethernet HWaddr 5a:2a:15:c5:5f:7b
inet addr:192.168.2.15 Bcast:192.168.2.255 Mask
:255.255.255.0
...
wlan0 Link encap:Ethernet HWaddr 78:4b:87:a6:cf:5e
inet addr:192.168.1.68 Bcast:0.0.0.0 Mask:255.2
55.255.0
root@edison:~# ping -c 3 8.8.8.8
PING google.com (173.194.115.196): 56 data bytes
64 bytes from 173.194.115.196: seq=0 ttl=58 time=28.487 ms
64 bytes from 173.194.115.196: seq=1 ttl=58 time=29.391 ms
64 bytes from 173.194.115.196: seq=2 ttl=58 time=29.773 ms
--- google.com ping statistics -- 3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 28.487/29.217/29.773 ms
root@edison:~#

Persistent Connection
root@edison:~# configure_edison -wifi
...
root@edison:~# systemctl enable wpa_supplicant
root@edison:~# systemctl start wpa_supplicant

Manual Persistent Configuration


Make sure there are no soft blocks
root@edison:~# rfkill list

321

WiFi
Make sure wlan0 is loaded and see IP
root@edison:~# ifconfig

Load the wlan0 device driver


root@edison:~# wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wp
a_supplicant/wpa_supplicant.conf

Get DHCP and DNS


root@edison:~# busybox udhcpc -i wlan0

Move usb0 to a different non-conflicting subnet


root@edison:~# vi /etc/system/system/basic.target.wants/netw
ork-gadget-init.service

Disable usb0 device from loading


root@edison:~# systemctl disable network-gadget-init.service

Ensure there is a wpa_supplicant network{} definition and remove unneeded


networks
root@edison:~# vi /etc/wpa_supplicant/wpa_supplicant.conf

Enable first network definition


root@edison:~# wpa_cli
> enable_network 0
> select_network 0
> save
> quit

322

WiFi
Example WEP key wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
network={
ssid="YOURSSID"
scan_ssid=1
key_mgmt=NONE
auth_alg=OPEN
wep_key0=f0039faded348299992344be23
}

Remove soft block on wlan0


root@edison:~# rfkill unblock wlan

Enable wifi on boot once config is confirmed correct


root@edison:~# systemctl enable wa_supplicant

WiFi to connect at power up:


systemctl enable wpa_supplicant
systemctl start wpa_supplicant

Password Lenght
... I am asked for a 5 or 13 character network password, but my network's
password is 10 characters long ... Edison WiFi setup - password must be
either 5 or 13 characters
--- configure_edison.orig
+++ configure_edison
@@ -60,6 +60,15 @@
wep_key0="%s"

323

WiFi
}
'''
+ WEP_26HEX = '''
+network={
+ ssid="%s"
+ %s
+ key_mgmt=NONE
+ group=WEP104 WEP40
+ wep_key0=%s
+}
+'''
WPAPSK = '''
network={
ssid="%s"
@@ -359,10 +368,13 @@
return wpa_templates.OPEN % (ssid, "scan_ssid=1")
elif security == 1:
password = ''
- while len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ while len(password) != 5 and len(password) != 13 and len(
password) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
password = getNetworkPassword()
- return wpa_templates.WEP % (ssid, "scan_ssid=1", password
)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "scan_ssid=1"
, password)
+ else:
+ return wpa_templates.WEP % (ssid, "scan_ssid=1", pass
word)
elif security == 2:
password = ''
while len(password) < 8 or len(password) > 63:
@@ -384,10 +396,13 @@
return wpa_templates.OPEN % (ssid, "")
elif network_map[ssid] == "WEP":
password = ''

324

WiFi
- while len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ while len(password) != 5 and len(password) != 13 and len(pa
ssword) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
password = getNetworkPassword()
- return wpa_templates.WEP % (ssid, "", password)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "", password)
+ else:
+ return wpa_templates.WEP % (ssid, "", password)
elif network_map[ssid] == "WPA-PSK":
password = ''
while len(password) < 8 or len(password) > 63:
@@ -409,10 +424,13 @@
return wpa_templates.OPEN % (ssid, "scan_ssid=1")
elif protocol == "WEP":
password = changewifi[2]
- if len(password) != 5 and len(password) != 13:
- print "Password must be either 5 or 13 characters."
+ if len(password) != 5 and len(password) != 13 and len(passw
ord) != 26:
+ print "Password must be either 5 or 13 ascii characters
or 26 hex."
return None
- return wpa_templates.WEP % (ssid, "scan_ssid=1", password)
+ if len(password) == 26:
+ return wpa_templates.WEP_26HEX % (ssid, "scan_ssid=1", pa
ssword)
+ else:
+ return wpa_templates.WEP % (ssid, "scan_ssid=1", password
)
elif protocol == "WPA-PSK":
password = changewifi[2]
if len(password) < 8 or len(password) > 63:

Mode Access Point @ Ubilinux

325

WiFi
Ubilinux Access Point Hostapd

Testing
ToDo iPerf ...

326

Audio

Audio
An audio signal is a representation of sound, typically as an electrical voltage.
Audio signals have frequencies in the audio frequency range of roughly 20 to
20,000 Hz (the limits of human hearing). wikipedia
Intel Edison Audio Setup Guide
Edidoom Intel Edison Audio
Play Audio from your Intel Edison via Bluetooth* using Advanced Audio
Distribution Profile (A2DP)

Required Hardware
USB Audio Dongle USB PnP Sound Device

Kernel Integration
Advanced Linux Sound Architecture
The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI
functionality to the Linux operating system.
Advanced Linux Sound Architecture Homepage

Kernel Display Message

327

Audio

root@edison:~# dmesg | grep -i audio


[ 9635.624279] usb 1-1.2: new full-speed USB device number 4
using dwc3-host
[ 9635.646994] usb 1-1.2: New USB device found, idVendor=0d8
c, idProduct=013c
[ 9635.647025] usb 1-1.2: New USB device strings: Mfr=1, Pro
duct=2, SerialNumber=0
[ 9635.647046] usb 1-1.2: Product: USB PnP Sound Device
[ 9635.647065] usb 1-1.2: Manufacturer: C-Media Electronics
Inc.
[ 9636.203053] input: C-Media Electronics Inc. USB PnP
Sound Device as /devices/pci0000:00/0000:00:11.0/dwc3-host.2/
usb1/1-1/1-1.2/1-1.2:1.3/input/input3
[ 9636.203880] hid-generic 0003:0D8C:013C.0001: input,hidraw
0: USB HID v1.00 Device [C-Media Electronics Inc. USB Pn
P Sound Device] on usb-dwc3-host.2-1.2/input3
root@edison:~# lsusb
Bus 001 Device 002: ID 05e3:0606 Genesys Logic, Inc. USB 2.0
Hub / D-Link DUB-H4 USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h
ub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root h
ub
Bus 001 Device 003: ID 0458:708a KYE Systems Corp. (Mouse Sy
stems)
Bus 001 Device 004: ID 0d8c:013c C-Media Electronics, Inc. C
M108 Audio Controller

USB Devices

328

Audio

root@edison:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root h
ub
Bus 001 Device 002: ID 0d8c:013c C-Media Electronics, Inc. C
M108 Audio Controller
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h
ub
root@edison:~#

Userspace Interfaces
ProcFs
root@edison:~# cat /proc/asound/cards
0 [Loopback ]: Loopback - Loopback
Loopback 1
1 [dummyaudio ]: dummy-audio - dummy-audio
dummy-audio
2 [Device ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound
Device at usb-dwc3-host.2-1, full speed
root@edison:~#

Applications / Libraries
Setup
Opkg

329

Audio

root@edison:~# opkg install alsa-utils mpg123 espeak


...
Configuring libsamplerate0.
Configuring libjack.
Configuring alsa-utils-alsaloop.
Configuring alsa-utils-alsaucm.
Configuring alsa-utils-midi.
Configuring alsa-utils-iecset.
Configuring alsa-utils-aconnect.
Configuring libportaudio2.
Configuring espeak.
Configuring alsa-utils-speakertest.
Configuring alsa-utils-aseqnet.
Configuring alsa-utils-aseqdump.
Configuring alsa-utils.
Configuring mpg123.
...

root@edison:~# opkg install --nodeps jack-dev Installing jack-dev (0.121.0-r0) on


root. Downloading http://repo.opkg.net/edison/repo/core2-32/jack-dev_0.121.0r0_core2-32.ipk. Configuring jack-dev. root@edison:~# opkg install --nodeps
libportaudio-dev Installing libportaudio-dev (v19+svnr1387-r0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/libportaudiodev_v19+svnr1387-r0_core2-32.ipk. Configuring libportaudio-dev. root@edison:~#

Apt-Get
root@edison:~# apt-get install alsa-utils mpg123 espeak

Free Sound Effects


Soundbible
Soundjay
freeSFX

Programs
330

Audio
Mad

Audio Files
root@edison:~# ls /usr/share/sounds/alsa/
Front_Center.wav Noise.wav Rear_Right.wav
Front_Left.wav Rear_Center.wav Side_Left.wav
Front_Right.wav Rear_Left.wav Side_Right.wav

List Capture Hardware Devices

331

Audio

root@edison:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PC
M]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PC
M]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: dummyaudio [dummy-audio], device 0: 14 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: dummyaudio [dummy-audio], device 1: ((null)) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: dummyaudio [dummy-audio], device 2: ((null)) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB
Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
root@edison:~#

332

Audio

List Playback Hardware Devices


root@edison:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PC
M]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PC
M]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: dummyaudio [dummy-audio], device 0: 14 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: dummyaudio [dummy-audio], device 1: ((null)) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: dummyaudio [dummy-audio], device 2: ((null)) []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB
Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

333

Audio

Arecord / Aplay
root@edison:~# arecord -f cd -D plughw:2,0 -d 20 test.wav # USB
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44
100 Hz, Stereo
^CAborted by signal Interrupt...
root@edison:~# aplay -D hw:2,0 test.wav # USB
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 4410
0 Hz, Stereo

Device Configuration
root@edison:~# vi ~/.asoundrc

pcm.!default {
type plug
slave {
pcm "hw:2,0"
}
}
ctl.!default {
type plug
slave {
pcm "hw:2,0"
}
}

root@edison:~# arecord -f cd -d 20 test.wav


Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44
100 Hz, Stereo
^CAborted by signal Interrupt...
root@edison:~# aplay test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 4410
0 Hz, Stereo

334

Audio

pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:2,0"
}
capture.pcm {
type plug
slave.pcm "hw:3,0"
}
}
ctl.!default {
type plug
slave {
pcm "hw:2,0"
}
}

Play Wav Sample File


root@edison:~# aplay /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sou
nds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 4
8000 Hz, Mo
root@edison:~# aplay /usr/share/sounds/alsa/Rear_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Rear_Center.wav' : Signed 1
6 bit Little Endian, Rate 48000 Hz, Moo
root@edison:~#

Speaker-Test

335

Audio

root@edison:~# speaker-test
speaker-test 1.0.28
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
...
...
^C
root@edison:~#

Mpg123
root@edison:~# mpg123

Espeak
root@edison:~# espeak

Other Configuration
pcm.!default {
type asym
playback.pcm {
type plug
slave.pcm "hw:2,0"
}
capture.pcm {
type plug
slave.pcm "hw:2,0"
}
}

root@edison:~# vi /etc/asound.conf
pcm.!default sysdefault:Device

336

Audio

root@edison:~# aplay -Ll


root@edison:~# vi ~/.asoundrc
root@edison:~# vi /etc/asound.conf
pcm.!default sysdefault:Device
root@edison:~# aplay /usr/share/sounds/alsa/Front_Center.wav
root@edison:~# aplay -D hw:1,0 /usr/share/sounds/alsa/Front_
Center.wav

337

Camera

Camera
USB Video Device Class Webcam UVC-compatible. The USB video device
class (also USB video class or UVC) is a USB device class that describes
devices capable of streaming video like webcams, digital camcorders,
transcoders, analog video converters and still-image cameras. Wikipedia

Required Hardware
USB Camera HD Webcam C525

Kernel Integration
Kernel Display Message
root@edison:~# dmesg
...
[ 1857.820461] usb 1-1: new high-speed USB device number 3 u
sing dwc3-host
[ 1858.108224] usb 1-1: New USB device found, idVendor=046d,
idProduct=0826
[ 1858.108256] usb 1-1: New USB device strings: Mfr=0, Produ
ct=2, SerialNumber=1
[ 1858.108277] usb 1-1: Product: HD Webcam C525
[ 1858.108296] usb 1-1: SerialNumber: 99DB4F90
[ 1858.458453] set resolution quirk: cval->res = 384
[ 1858.568064] uvcvideo: Found UVC 1.00 device HD Webcam C52
5 (046d:0826)
[ 1858.582220] input: HD Webcam C525 as /devices/pci0000:00/
0000:00:11.0/dwc3-host.2/usb1/1-1/1-1:1.2/input/input3
[ 1858.582896] usbcore: registered new interface driver uvcv
ideo
[ 1858.582915] USB Video Class driver (1.1.1)

338

Camera

Kernel Modules
root@edison:~# lsmod
Module Size Used by
uvcvideo 71516 0
videobuf2_vmalloc 13003 1 uvcvideo
videobuf2_memops 13001 1 videobuf2_vmalloc
videobuf2_core 37707 1 uvcvideo
...
root@edison:~# find /lib/modules/* -name 'uvc'
/lib/modules/3.10.17-poky-edison+/kernel/drivers/media/usb/u
vc

Userspace Interfaces
DevFs
root@edison:~# ls -l /dev/video0
crw-rw---- 1 root video 81, 0 Mar 21 18:21 /de
v/video0

Applications / Libraries
fswebcam
a small and simple webcam app for *nix. It can capture images from a
number of different sources and perform simple manipulation on the
captured image. The image can be saved as one or more PNG or JPEG
files.
ffmpeg
A complete, cross-platform solution to record, convert and stream audio
and video. FFMpeg Homepage

339

Camera

Setup
Manual
Install ffmpeg by following Video Streaming on Intel Edison

Opkg
root@edison:~# opkg install kernel-module-uvcvideo
Package kernel-module-uvcvideo (3.10.17-r0) installed in roo
t is up to date.
root@edison:~# opkg install libx264-133 libx264-bin libx264dev libx264-staticdev
Installing libx264-133 (r2265+git0+ffc3ad4945-r0) on root.
Installing libx264-bin (r2265+git0+ffc3ad4945-r0) on root.
Installing libx264-dev (r2265+git0+ffc3ad4945-r0) on root.
Installing libx264-staticdev (r2265+git0+ffc3ad4945-r0) on r
oot.
root@edison:~# opkg install opencv python-opencv
Package opencv (2.4.11+git0+2c9547e314-r0) installed in root
is up to date.
Package python-opencv (2.4.11+git0+2c9547e314-r0) installed
in root is up to date.
root@edison:~# opkg install fswebcam
Installing fswebcam (20140113-r0) on root.
Installing libgd3 (2.1.0-r0) on root.
Installing libvpx (1.3.0-r0) on root.

Pip
root@edison:~# pip install flask

Programs
Fswebcam

340

Camera

root@edison:~# fswebcam -r 1280x1024 -s brightness=65% -s Co


ntrast=50% -s Gamma=100% --jpeg 100 --no-banner image.jpg

Python OpenCv Live Stream


From Github Smoyerman Live Stream Processed
root@edison:~# vi livestream.py

341

Camera

from flask import Flask, Response


import cv2
import numpy as np
class Camera(object):
def __init__(self):
self.cap = cv2.VideoCapture(0)
# Reset camera capture size for faster processing
self.cap.set(3,480)
self.cap.set(4,360)
def get_frame(self):
ret, frame = self.cap.read()
# Apply laplacian edge detection to image
laplacian = cv2.Laplacian(frame,cv2.CV_64F)
# Write out original and edge detected images at once
cv2.imwrite('blah.jpg',np.hstack((frame,laplacian)))
return open('blah.jpg', 'rb').read()
app = Flask(__name__)
def gen(camera):
while True:
frame = camera.get_frame()
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\
r\n')
@app.route('/')
def video_feed():
return Response(gen(Camera()),
mimetype='multipart/x-mixed-replace; boundar
y=frame')
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)

342

Camera

root@edison:~# python livestream.py


* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 775-529-825

See Live Stream by connecting from a web browser to http://youripaddress:5000/


192.168.1.70 - - [21/Mar/2016 18:48:16] "GET / HTTP/1.1" 200
192.168.1.70 - - [21/Mar/2016 18:48:17] "GET / HTTP/1.1" 200
-

Online Examples
Github Smoyerman Video Capture
Rustem Iskuzhin Making your own live streaming camera

OpenCV
USB Camera
IP Camera

343

Block

Block
Block devices are hardware devices distinguished by the random (that is, not
necessarily sequential) access of fixed-size chunks of data, called blocks. The
most common block device is a hard disk, but many other block devices exist,
such as floppy drives, CD-ROM drives, and flash memory. Notice how these
are all devices on which you mount a filesystemfilesystems are the lingua
franca of block devices. Makelinux
Differences between flash devices and block drives
Creating a ram disk on Linux
Free Electrons Block Drivers

Kernel Integration
Kernel Display Message Card Insertion
root@edison:~# dmesg
...
[ 4430.481280] mmc1: new high speed SDHC card at address 123
4
[ 4430.482221] mmcblk1: mmc1:1234 SA04G 3.63 GiB
[ 4430.485107] mmcblk1: p1

Kernel Display Message Default


root@edison:~# dmesg | grep mmc
[ 0.190762] SDIO bus = 1, name = bcm43xx_clk_vmmc, ref_cl
ock = 26000000, addr =0x401
[ 0.741385] emmc_ipanic: init success
[ 1.013752] mmc0: no vqmmc regulator found
[ 1.108914] mmc0: BKOPS_EN bit is not set00
[ 1.417542] mmc0: new HS200 MMC card at address 0001
[ 1.418397] mmcblk0: mmc0:0001 H4G1d\x04 3.64 GiB

344

Block
[ 1.418943] mmcblk0boot0: mmc0:0001 H4G1d\x04 partition 1
4.00 MiB
[ 1.419442] mmcblk0boot1: mmc0:0001 H4G1d\x04 partition 2
4.00 MiB
[ 1.419935] mmcblk0rpmb: mmc0:0001 H4G1d\x04 partition 3
4.00 MiB
[ 1.426000] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10
[ 1.434287] mmcblk0boot1: unknown partition table
[ 1.437970] mmcblk0boot0: unknown partition table
[ 1.438383] mmc0: SDHCI controller on PCI [0000:00:01.0]
using ADMA
[ 1.454185] emmc_ipanic: panic partition found, label:pan
ic, device:mmcblk0p6
[ 1.557291] emmc_ipanic: emmc_panic_notify_add: Data avai
lable in panic partition
[ 1.557341] emmc_ipanic: emmc_panic_notify_add: proc entr
y created: emmc_ipanic_header
[ 1.557362] emmc_ipanic: emmc_panic_notify_add: log file
0(1024, 52340)
[ 1.557390] emmc_ipanic: emmc_panic_notify_add: proc entr
y created: emmc_ipanic_console
[ 1.557407] emmc_ipanic: emmc_panic_notify_add: log file
1(4286578688, 0)
[ 1.557420] emmc_ipanic: emmc_panic_notify_add: empty log
file 1
[ 1.557436] emmc_ipanic: emmc_panic_notify_add: log file
2(4286578688, 0)
[ 1.557449] emmc_ipanic: emmc_panic_notify_add: empty log
file 2
[ 1.584823] mmc1: no vqmmc regulator found
[ 1.585258] mmc1: SDHCI controller on PCI [0000:00:01.2]
using ADMA
[ 1.586232] mmc2: no vqmmc regulator found
[ 1.586668] mmc2: SDHCI controller on PCI [0000:00:01.3]
using ADMA
[ 1.746719] EXT4-fs (mmcblk0p8): INFO: recovery required
on readonly filesystem
[ 1.746745] EXT4-fs (mmcblk0p8): write access will be ena
bled during recovery
[ 1.819782] mmc1: error -84 whilst initialising SD card

345

Block
[ 1.831504] EXT4-fs (mmcblk0p8): recovery complete
[ 1.834101] EXT4-fs (mmcblk0p8): mounted filesystem with
ordered data mode. Opts: (null)
[ 1.897473] mmc1: new high speed SDHC card at address 123
4
[ 1.898207] mmcblk1: mmc1:1234 SA08G 7.21 GiB
[ 1.899941] mmcblk1: p1 p2
[ 2.226457] mmc2: queuing unknown CIS tuple 0x91 (3 bytes
)
[ 2.226495] mmc2: new ultra high speed DDR50 SDIO card at
address 0001
[ 4.543403] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter
[ 4.543666] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter
[ 4.567337] bcmsdh_sdmmc: bcmsdh_sdmmc_probe Enter
[ 5.453381] EXT4-fs (mmcblk0p8): re-mounted. Opts: (null)
[ 5.965905] lun0: LUN: file: /dev/mmcblk0p9
[ 8.512646] FAT-fs (mmcblk0p7): Volume was not properly u
nmounted. Some data may be corrupt. Please run fsck.
[ 8.557697] EXT4-fs (mmcblk0p10): mounted filesystem with
ordered data mode. Opts: (null)

Applications / Libraries
Setup
Opkg
root@edison:~# opkg update
root@edison:~# opkg install e2fsprogs dosfstools

Apt-Get
root@edison:~# apt-get update
root@edison:~# apt-get install e2fsprogs dosfstools xfsprogs

346

Block

Programs
Mount
root@edison:~# mount
/dev/mmcblk0p8 on / type ext4 (rw,nodev,noatime,discard,noau
to_da_alloc,data=ordered)
...
/dev/mmcblk0p7 on /boot type vfat (rw,nosuid,nodev,noatime,f
mask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortna)

/dev/mmcblk1p1 on /media/sdcard type ext3 (rw,relatime,error
s=continue,user_xattr,acl,barrier=1,data=writeback)

Usage Models
SD Cards, Mount

347

Block

root@edison:~# mount
/dev/mmcblk0p7 on /boot type vfat (rw,relatime,fmask=0022,dm
ask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,err)
/dev/mmcblk0p10 on /home type ext4 (rw,relatime,data=ordered
)
/dev/mmcblk1p1 on /media/sdcard type vfat (rw,relatime,uid=6
5534,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,ioch)
root@edison:~# mkfs.ext4 /dev/mmcblk1
mke2fs 1.42.9 (28-Dec-2013)
/dev/mmcblk1 is apparently in use by the system; will not ma
ke a filesystem here!
root@edison:~# umount
root@edison:~# umount /media/sdcard/
root@edison:~# mkfs.ext4 /dev/mmcblk1
mke2fs 1.42.9 (28-Dec-2013)
Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
...
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: d
one
root@edison:~# mkfs.ext4 -t ext4 /dev/mmcblk1

SD Cards, Manual Mount


root@edison:~# mkdir localdirectory
root@edison:~# mount -t ext4 /dev/mmcblk1 localdirectory
root@edison:~# mount | grep mmcblk1
...
/dev/mmcblk1 on /root/localdirectory type ext4 (rw,relatime,
data=ordered)
root@edison:~# cd localdirectory/
root@edison:~/localdirectory# ls
lost+found
root@edison:~/localdirectory#

348

Block

SD Cards, Umount
root@edison:~# umount localdirectory
root@edison:~# umount /dev/mmcblk1

SD Cards, Automatic Mount


root@edison:~# vi /etc/fstab
/dev/mmcblk1 /path/to/localdirectory

Tmpfs
tmpfs is a common name for a temporary file storage facility on many Unixlike operating systems. It is intended to appear as a mounted file system, but
stored in volatile memory instead of a persistent storage device. Wikipedia
root@edison:~# cd /tmp
root@edison:~# mkdir temptmpfs
root@edison:~# mount -o size=16G -t tmpfs none temptmpfs/
root@edison:~# cd temptmpfs/
root@edison:~# ls
root@edison:~# cd ..
root@edison:~# mount
...
none on /root/temptmpfs type tmpfs (rw,relatime,size=1677721
6k)
root@edison:~# umount /root/temptmpfs

349

Virtual File System

Virtual File System


A virtual file system (VFS) or virtual filesystem switch is an abstraction layer
on top of a more concrete file system. The purpose of a VFS is to allow client
applications to access different types of concrete file systems in a uniform
way. Wikipedia
The Linux kernel implements the concept of Virtual File System (VFS,
originally Virtual Filesystem Switch), so that it is (to a large degree) possible
to separate actual "low-level" filesystem code from the rest of the kernel. The
Linux Virtual File System
A tour of the Linux VFS

350

Universal Serial Bus

Universal Serial Bus


USB, short for Universal Serial Bus, is an industry standard developed in the
mid-1990s that defines the cables, connectors and communications protocols
used in a bus for connection, communication, and power supply between
computers and electronic devices.[4] It is currently developed by the USB
Implementers Forum. Wikipedia
Intel Edison USB Host
Linux Journal Greg Kroah-Hartman Writing a Simple USB Driver
Linux Journal Greg Kroah-Hartman How to Write a Linux USB Device Driver
Persistent Names
Persistent Names
Yoctopuce
Yoctopuce designs, manufactures and sells USB devices to let your
computer sit in the real world, not in the cloud. Our USB modules are tiny,
easy to install and easy to drive programmatically. Homepage

Kernel Integration
Kernel Display Message

351

Universal Serial Bus

root@edison:~# dmesg | grep -i usb


[ 0.207321] usbcore: registered new interface driver usbf
s
[ 0.207421] usbcore: registered new interface driver hub
[ 0.207628] usbcore: registered new device driver usb
[ 0.742079] usbcore: registered new interface driver asix
[ 0.742161] usbcore: registered new interface driver cdc_
subset
[ 0.742291] usbcore: registered new interface driver cdc_
ncm
[ 0.744743] ehci_hcd: USB 2.0 'Enhanced' Host Controller
(EHCI) Driver
[ 0.745063] usbcore: registered new interface driver cdc_
acm
[ 0.745081] cdc_acm: USB Abstract Control Model driver for
USB modems and ISDN adapters
[ 0.745196] usbcore: registered new interface driver usbstorage
[ 0.745383] usbcore: registered new interface driver usbs
erial
[ 0.745454] usbcore: registered new interface driver pl23
03
[ 0.745521] usbserial: USB Serial support registered for
pl2303
[ 1.666307] usbcore: registered new interface driver usbh
id
...

Kernel Modules

352

Universal Serial Bus

root@edison:~# lsmod
Module Size Used by
...
usb_f_acm 14335 1
u_serial 18582 6 usb_f_acm
g_multi 70924 0
libcomposite 39245 2 usb_f_acm,g_multi
...

Userspace Interfaces
Sysfs

353

Universal Serial Bus

root@edison:~# ls -l /sys/bus/usb/drivers/
drwxr-xr-x 2 root root 0 Jan 1 2000 asi
x
drwxr-xr-x 2 root root 0 Jan 1 2000 cdc
_acm
drwxr-xr-x 2 root root 0 Jan 1 2000 cdc
_ncm
drwxr-xr-x 2 root root 0 Jan 1 2000 cdc
_subset
drwxr-xr-x 2 root root 0 Jan 1 2000 hub
drwxr-xr-x 2 root root 0 Jan 1 2000 pl2
303
drwxr-xr-x 2 root root 0 Jan 1 2000 snd
-usb-audio
drwxr-xr-x 2 root root 0 Jan 1 2000 usb
drwxr-xr-x 2 root root 0 Jan 1 2000 usb
-storage
drwxr-xr-x 2 root root 0 Jan 1 2000 usb
fs
drwxr-xr-x 2 root root 0 Jan 1 2000 usb
hid
drwxr-xr-x 2 root root 0 Jan 1 2000 usb
serial
drwxr-xr-x 2 root root 0 Mar 21 18:21 uvc
video
root@edison:~# cat /sys/bus/usb/drivers/option/***/bInterfac
e*
root@edison:~# cat /proc/bus/usb/devices

Applications / Libraries
libusb
C library that gives applications easy access to USB devices on many
different operating systems. libusb homepage

Setup
354

Universal Serial Bus

Opkg
root@edison:~# opkg install libusb-1.0-dev

Apt-Get
root@edison:~# apt-get install libusb-1.0-dev libudev-dev
root@edison:~# apt-get install libtool

Programs
Lsusb
If USB-host is not powered
root@edison:~# lsusb
unable to initialize libusb: -99

If USB-host is powered

355

Universal Serial Bus

root@edison:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root h
ub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h
ub
root@edison:~# ls -l /sys/bus/usb/drivers
total 0
drwxr-xr-x 2 root root 0 Jan 1 00:01 asix
drwxr-xr-x 2 root root 0 Jan 1 00:01 cdc_acm
drwxr-xr-x 2 root root 0 Jan 1 00:01 cdc_ncm
drwxr-xr-x 2 root root 0 Jan 1 00:01 cdc_subset
drwxr-xr-x 2 root root 0 Jan 1 00:01 ftdi_sio
drwxr-xr-x 2 root root 0 Jan 1 00:01 hub
drwxr-xr-x 2 root root 0 Jan 1 00:01 pl2303
drwxr-xr-x 2 root root 0 Jan 1 00:01 snd-usb-audio
drwxr-xr-x 2 root root 0 Jan 1 00:01 usb
drwxr-xr-x 2 root root 0 Jan 1 00:01 usbfs
drwxr-xr-x 2 root root 0 Jan 1 00:01 usbhid
drwxr-xr-x 2 root root 0 Jan 1 00:01 usbserial
drwxr-xr-x 2 root root 0 Jan 1 00:01 usb-storage
drwxr-xr-x 2 root root 0 Jan 1 00:01 uvcvideo

Libusb Git Repository


root@edison:~# git clone https://github.com/libusb/libusb.git
root@edison:~# cd libusb
root@edison:~# ./autogen.sh -disable-udev
root@edison:~# make
root@edison:~# cd examples
root@edison:~# ./listdevs
1d6b:0003 (bus 2, device 1)
0458:708a (bus 1, device 3) path: 1.1
05e3:0606 (bus 1, device 2) path: 1
1d6b:0002 (bus 1, device 1)

356

Universal Serial Bus

357

Inter Integrated Circuit

Inter Integrated Circuit


IC (Inter-Integrated Circuit), pronounced I-squared-C, is a multi-master, multislave, single-ended, serial computer bus invented by Philips Semiconductor
(now NXP Semiconductors). It is typically used for attaching lower-speed
peripheral ICs to processors and microcontrollers. Wikipedia
Linux Journal Greg Kroah-Hartman I2C Drivers Part I
Linux Journal Greg Kroah-Hartman I2C Drivers Part II

Required Hardware
One I2C sensor

Kernel Integration
Kernel Display Message
root@edison:~# dmesg | grep -i i2c
[ 0.190675] I2C bus = 1, name = pcal9555a-1, irq = 0
x 0, addr = 0x20
[ 0.190711] I2C bus = 1, name = pcal9555a-2, irq = 0
x 0, addr = 0x21
[ 0.190743] I2C bus = 1, name = pcal9555a-3, irq = 0
x 0, addr = 0x22
[ 0.190774] I2C bus = 1, name = pcal9555a-4, irq = 0
x 0, addr = 0x23
[ 0.746686] i2c /dev entries driver

Userspace Interfaces
SysFs

358

Inter Integrated Circuit

root@edison:~# ls /sys/class/i2c-dev/
i2c-1 i2c-2 i2c-3 i2c-4 i2c-5 i2c-6 i2c-7

DevFs
root@edison:~# ls /dev/i2c-*
/dev/i2c-1 /dev/i2c-2 /dev/i2c-3 /dev/i2c-4 /dev/i2c-5
/dev/i2c-6 /dev/i2c-7

ProcFs
root@edison:~# cat /proc/interrupts | grep i2c
7: 44 0 IO-APIC-fasteoi i2c- desig
nware-1
10: 0 0 IO-APIC-fasteoi i2c-designwar
e-2
12: 0 0 IO-APIC-fasteoi watchdog, i2c
-designware-3
13: 0 0 IO-APIC-fasteoi i2c-designwar
e-4
14: 0 0 IO-APIC-fasteoi i2c-designwar
e-5
15: 0 0 IO-APIC-fasteoi i2c-designwar
e-6
16: 0 0 IO-APIC-fasteoi i2c-designwar
e-7

Applications / Libraries
Setup
Opkg

359

Inter Integrated Circuit

root@edison:~# opkg install i2c-tools


Package i2c-tools (3.1.1-r0) installed in root is up to date
.
...

Programs
i2cdetect
root@edison:~# i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: UU UU UU UU -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

360

Peripheral Component Interconnect

Peripheral Component Interconnect


Conventional PCI, often shortened to PCI, is a local computer bus for
attaching hardware devices in a computer. PCI is the initialism for Peripheral
Component Interconnect[2] and is part of the PCI Local Bus standard. The
PCI bus supports the functions found on a processor bus but in a
standardized format that is independent of any particular processor's native
bus. Devices connected to the PCI bus appear to a bus master to be
connected directly to its own bus and are assigned addresses in the
processor's address space. It is a parallel bus, synchronous to a single bus
clock. Wikipedia
Wikipedia Peripheral Component Interconnect

Kernel Integration
Kernel Display Message
root@edison:~# dmesg | grep -i pci
[ 0.000000] e820: [mem 0x40000000-0xfebfffff] available f
or PCI devices
[ 0.191609] PCI: MMCONFIG for domain 0000 [bus 00-00] at
[mem 0x3f500000-0x3f5fffff] (base 0x3f500000)
[ 0.191633] PCI: MMCONFIG at [mem 0x3f500000-0x3f5fffff]
reserved in E820
[ 0.191647] PCI: Using MMCONFIG for extended config space
[ 0.191660] PCI: Using configuration type 1 for base acce
ss
[ 0.214309] Intel MID platform detected, using MID PCI op
s
[ 0.214322] PCI: Probing PCI hardware
[ 0.214337] PCI: root bus 00: using default resources
[ 0.214352] PCI: Probing PCI hardware (bus 00)
[ 0.214615] PCI host bridge to bus 0000:00
...

361

Peripheral Component Interconnect

Applications / Libraries
Programs
lspci
A command on Unix-like operating systems that prints ("lists") detailed
information about all PCI buses and devices in the system. It is based on
a common portable library libpci which offers access to the PCI
configuration space on a variety of operating systems.
root@edison:~# lspci
00:00.0 Host bridge: Intel Corporation Device 1170 (rev 01)

00:01.0 SD Host controller: Intel Corporation Device 1190 (r
ev 01)
00:01.2 SD Host controller: Intel Corporation Device 1190 (r
ev 01)
00:01.3 SD Host controller: Intel Corporation Device 1190 (r
ev 01)
00:02.0 Display controller: Intel Corporation Device 1182 (r
ev 01)
00:04.0 Serial controller: Intel Corporation Device 1191 (re
v 01)
00:04.1 Serial controller: Intel Corporation Device 1191 (re
v 01)
00:04.2 Serial controller: Intel Corporation Device 1191 (re
v 01)
00:04.3 Serial controller: Intel Corporation Device 1191 (re
v 01)
00:05.0 Serial controller: Intel Corporation Device 1192 (re
v 01)
00:06.0 System peripheral: Intel Corporation Device 1193 (re
v 01)
00:06.1 System peripheral: Intel Corporation Device 1193 (re
v 01)
00:07.0 System peripheral: Intel Corporation Device 1194 (re
v 01)
00:07.1 System peripheral: Intel Corporation Device 1194 (re

362

Peripheral Component Interconnect


v 01)
00:07.2 System peripheral: Intel Corporation Device 1194 (re
v 01)
00:08.0 Communication controller: Intel Corporation Device 1
195 (rev 01)
00:08.1 Communication controller: Intel Corporation Device 1
195 (rev 01)
00:08.2 Communication controller: Intel Corporation Device 1
195 (rev 01)
00:08.3 Communication controller: Intel Corporation Device 1
195 (rev 01)
00:09.0 Communication controller: Intel Corporation Device 1
196 (rev 01)
00:09.1 Communication controller: Intel Corporation Device 1
196 (rev 01)
00:09.2 Communication controller: Intel Corporation Device 1
196 (rev 01)
00:0a.0 Communication controller: Intel Corporation Device 1
197 (rev 01)
00:0b.0 Encryption controller: Intel Corporation Device 1198
(rev 01)
00:0c.0 System peripheral: Intel Corporation Device 1199 (re
v 01)
00:0d.0 Multimedia audio controller: Intel Corporation Devic
e 119a (rev 01)
00:0e.0 System peripheral: Intel Corporation Device 119b (re
v 01)
00:11.0 USB controller: Intel Corporation Device 119e (rev 0
1)
00:12.0 Signal processing controller: Intel Corporation Devi
ce 119f (rev 01)
00:13.0 Co-processor: Intel Corporation Device 11a0 (rev 01)

00:14.0 Co-processor: Intel Corporation Device 11a1 (rev 01)

00:15.0 System peripheral: Intel Corporation Device 11a2 (re
v 01)
00:16.0 Co-processor: Intel Corporation Device 11a3 (rev 01)

00:16.1 Co-processor: Intel Corporation Device 11a4 (rev 01)

363

Peripheral Component Interconnect



00:17.0 System peripheral: Intel Corporation Device 11a5 (re
v 01)
00:18.0 Display controller: Intel Corporation Device 11a6 (r
ev 01)
root@ubilinux:~# cat /proc/bus/pci/devices

364

Clock

Clock
A Linux system actually has two clocks: One is the battery powered "Real
Time Clock" (also known as the "RTC", "CMOS clock", or "Hardware clock")
which keeps track of time when the system is turned off but is not used when
the system is running. The other is the "system clock" (sometimes called the
"kernel clock" or "software clock") which is a software counter based on the
timer interrupt. It does not exist when the system is not running, so it has to
be initialized from the RTC (or some other time source) at boot time.
References to "the clock" in the ntpd documentation refer to the system clock,
not the RTC. The Clock Mini-HOWTO

Kernel Integration
Kernel Display Message
root@edison:~# dmesg | grep -i clock
[ 0.190320] SDIO bus = 1, name = bcm43xx_clk_vmmc, ref_cl
ock = 26000000, addr =0x401
[ 0.208133] PTP clock support registered
[ 0.240814] hsu core clock 38 M
[ 0.242400] Switching to clocksource refined-jiffies
[ 1.534698] Switching to clocksource tsc
[ 2.076269] rtc_cmos rtc_cmos: setting system clock to 20
00-01-01 00:00:09 UTC (946684809)

Applications / Libraries
Setup
Opkg

365

Clock

root@edison:~# opkg install ntp


Installing ntp (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntp_4.
2.6p5-r6.0_core2-32.ipk.
ntp: unsatisfied recommendation for iana-etc
Installing ntp-tickadj (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntp-ti
ckadj_4.2.6p5-r6.0_core2-32.ipk.
Installing libbsd0 (0.7.0-r0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/libbsd
0_0.7.0-r0_core2-32.ipk.
Running useradd commands...
NOTE: Performing useradd with [ --system --home-dir /var/lib
/ntp --no-create-home y
Configuring libbsd0.
Configuring ntp-tickadj.
Configuring ntp.
ln -s '/lib/systemd/system/ntpd.service' '/etc/systemd/syste
m/multi-user.target.wants/ntpd.service'
root@edison:~# opkg install ntpdate
root@edison:~# opkg install ntpdate
Installing ntpdate (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntpdat
e_4.2.6p5-r6.0_core2-32.ipk.
Configuring ntpdate.
adding crontab
ln -s '/lib/systemd/system/ntpdate.service' '/etc/systemd/sy
stem/multi-user.target.wants/ntpdate.service'

Programs
Network Time Protocol Client

366

Clock

root@edison:~# opkg install ntp


Installing ntp (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntp_4.2.6p
5-r6.0_core2-32.ipk.
ntp: unsatisfied recommendation for iana-etc
Installing ntp-tickadj (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntp-tickad
j_4.2.6p5-r6.0_core2-32.ipk.
Installing libbsd0 (0.7.0-r0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/libbsd0_0.
7.0-r0_core2-32.ipk.
Running useradd commands...
NOTE: Performing useradd with [ --system --home-dir /var/lib/ntp
--no-create-hoy
Configuring libbsd0.
Configuring ntp-tickadj.
Configuring ntp.
ln -s '/lib/systemd/system/ntpd.service' '/etc/systemd/system/mu
lti-user.target.wants/ntpd.service'
root@edison:~#

root@edison:~# opkg install ntpdate


Installing ntpdate (4.2.6p5-r6.0) on root.
Downloading http://repo.opkg.net/edison/repo/core2-32/ntpdate_4.
2.6p5-r6.0_core2-32.ipk.
Configuring ntpdate.
adding crontab
ln -s '/lib/systemd/system/ntpdate.service' '/etc/systemd/system
/multi-user.target.wants/ntpdate.servi'

root@edison:~# ntpdate -s time.nist.gov


root@edison:~# date
Mon Mar 21 20:14:51 UTC 2016

367

Modems

Modems
A modem (modulator-demodulator) is a network hardware device that
modulates one or more carrier wave signals to encode digital information for
transmission and demodulates signals to decode the transmitted information.
The goal is to produce a signal that can be transmitted easily and decoded to
reproduce the original digital data. Wikipedia

Required Hardware
T & A Mobile Phones

Applications / Libraries
Setup @ Ubilinux
Apt-Get
root@ubilinux:~# apt-get update
root@ubilinux:~# apt-get install ppp bzip2 usb-modeswitch
<Connect Modem>
root@ubilinux:~# dmesg
[ 450.792009] usb 1-1.3: new high-speed USB device number 3
using dwc3-host
[ 450.817656] usb 1-1.3: New USB device found, idVendor=1bb
b, idProduct=f017
[ 450.817688] usb 1-1.3: New USB device strings: Mfr=3, Pro
duct=2, SerialNumber=0
[ 450.817709] usb 1-1.3: Product: Mobile Broad Band
[ 450.817727] usb 1-1.3: Manufacturer: USBModem
[ 450.821346] usb-storage 1-1.3:1.0: USB Mass Storage devic
e detected
[ 450.821851] scsi0 : usb-storage 1-1.3:1.0

368

Modems
[ 450.822947] usb-storage 1-1.3:1.1: USB Mass Storage devic
e detected
[ 450.823370] scsi1 : usb-storage 1-1.3:1.1
[ 451.823343] scsi 0:0:0:0: Direct-Access USBModem MMC
Storage 2.31 PQ: 0 ANSI: 2
[ 451.824283] scsi 1:0:0:0: CD-ROM USBModem MMC
Storage 2.31 PQ: 0 ANSI: 2
[ 451.827155] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 451.828944] sr0: scsi-1 drive
[ 451.828967] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 451.830033] sr 1:0:0:0: Attached scsi CD-ROM sr0
[ 451.830818] sr 1:0:0:0: Attached scsi generic sg1 type 5
[ 451.831854] sd 0:0:0:0: [sda] Attached SCSI removable dis
k
root@ubilinux:~# lsusb
Bus 001 Device 002: ID 8564:4000
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h
ub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root h
ub
Bus 001 Device 003: ID 1bbb:f017 T & A Mobile Phones
root@ubilinux:~# nano /etc/udev/rules.d/50-myrules.rules
ATTRS{idVendor}=="1bbb",ATTRS{idProduct}=="0017", RUN+="/sbi
n/modprobe usbserial vendor=0x1bbb product=0x0017"

<Disconnect Modem>
root@ubilinux:~# reboot
<Connect Modem>

369

Modems

root@ubilinux:~# tail -f /var/log/messages


...
Jan 10 04:44:44 ubilinux usb_modeswitch: switching device 1b
bb:f017 on 001/005
Jan 10 04:44:44 ubilinux kernel: [ 678.066175] usb 1-1.3: U
SB disconnect, device number 5
Jan 10 04:44:47 ubilinux kernel: [ 681.341248] usb 1-1.3: n
ew high-speed USB device number 6 using dwc3-host
Jan 10 04:44:47 ubilinux kernel: [ 681.367432] usb 1-1.3: N
ew USB device found, idVendor=1bbb, idProduct=011e
Jan 10 04:44:47 ubilinux kernel: [ 681.367464] usb 1-1.3: N
ew USB device strings: Mfr=3, Product=2, SerialNumber=0
Jan 10 04:44:47 ubilinux kernel: [ 681.367485] usb 1-1.3: P
roduct: Mobile Broad Band
Jan 10 04:44:47 ubilinux kernel: [ 681.367503] usb 1-1.3: M
anufacturer: USBModem
Jan 10 04:44:47 ubilinux kernel: [ 681.386865] option 1-1.3
:1.0: GSM modem (1-port) converter detected
Jan 10 04:44:47 ubilinux kernel: [ 681.387472] usb 1-1.3: G
SM modem (1-port) converter now attached to ttyUSB0
Jan 10 04:44:47 ubilinux kernel: [ 681.388296] option 1-1.3
:1.1: GSM modem (1-port) converter detected
Jan 10 04:44:47 ubilinux kernel: [ 681.388843] usb 1-1.3: G
SM modem (1-port) converter now attached to ttyUSB1
Jan 10 04:44:47 ubilinux kernel: [ 681.389475] usb-storage
1-1.3:1.2: USB Mass Storage device detected
Jan 10 04:44:47 ubilinux kernel: [ 681.390829] scsi5 : usbstorage 1-1.3:1.2
Jan 10 04:44:47 ubilinux kernel: [ 681.392186] option 1-1.3
:1.3: GSM modem (1-port) converter detected
Jan 10 04:44:47 ubilinux kernel: [ 681.392818] usb 1-1.3: G
SM modem (1-port) converter now attached to ttyUSB2
Jan 10 04:44:48 ubilinux kernel: [ 682.392520] scsi 5:0:0:0
: Direct-Access USBModem MMC Storage 2.31 PQ: 0 ANSI: 2
Jan 10 04:44:48 ubilinux kernel: [ 682.394153] sd 5:0:0:0:
Attached scsi generic sg0 type 0
Jan 10 04:44:48 ubilinux kernel: [ 682.396784] sd 5:0:0:0:
[sda] Attached SCSI removable disk

370

Modems

Programs
Sakis 3G
root@ubilinux:~# wget "http://www.sakis3g.com/downloads/saki
s3g.tar.gz" -O sakis3g.tar.gz
root@ubilinux:~# tar -xzvf sakis3g.tar.gz
root@ubilinux:~# chmod +x sakis3g
root@ubilinux:~# ./sakis3g --interactive
...
root@ubilinux:~# ping google.com

371

Networking

Networking
Intel Edison Connecting to a Network
Intel Edison Static IP Address

Applications / Libraries
Programs
Misc
root@edison:~# systemctl start connman
root@edison:~# systemctl start wpa_supplicant
root@edison:~# connmanctl
connmanctl> enable_wifi
connmanctl> scan_wifi
connmanctl> agent_on
connmanctl> connect ...

root@edison:~# vi /lib/systemd/system/sshd.socket
[Unit]
Conflicts=sshd.service
[Socket]
ExecStartPre=/bin/mkdir -p /var/run/sshd
ListenStream=22
# restrict access to wired access for security reasons
# comment this line to remove restriction
BindToDevice=usb0
Accept=yes
[Install]
WantedBy=sockets.target

372

Networking

Controller Area Network


1
2
3

373

Power

Power
D0, Device power state, equivalent to fully on. D1 and D2 are intermediate
states; D3 is Off
S0ix, An active idle sleep state, which delivers the same power consumption
as S3 sleep, yet provides a quick activate time into full S0 state
Links
https://scivision.co/measured-power-consumption-of-intel-edison/
https://communities.intel.com/thread/61067?tstart=0
cat scaling_available_frequencies
https://communities.intel.com/message/338257#338257
Intel Edison Power consumption

Kernel Integration
root@edison:~# rfkill block Bluetooth # BlueTooth
root@edison:~# modprobe -r bcm4334x # WiFi
root@edison:~# modprobe bcm4334x # WiFi
root@edison:~# /sbin/iwconfig wlan0 power off
root@edison:~# /sbin/iwconfig wlan0 power on
root@edison:~# cat /sys/power/state
freeze mem
root@edison:~# cat /sys/power/pm_test
[none] core processors platform devices freezer
root@edison:~# echo 1 > /sys/devices/system/cpu/offline
root@edison:~# ls /sys/power/
pm_async pm_print_times state wak
e_unlock
pm_freeze_timeout pm_test wake_lock wak

374

Power
eup_count
root@edison:~# cat /sys/devices/system/cpu/
cpu0/ cpuidle/ offline power/ release
cpu1/ kernel_max online present uevent
cpufreq/ modalias possible probe
root@edison:~# ls /sys/devices/system/cpu/cpu0/cpufreq/

affected_cpus scaling_cur_freq
cpuinfo_cur_freq scaling_driver
cpuinfo_max_freq scaling_governor
cpuinfo_min_freq scaling_max_freq
cpuinfo_transition_latency scaling_min_freq
related_cpus scaling_setspeed
scaling_available_frequencies stats
scaling_available_governors
root@edison:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scal
ing_available_governors
ondemand userspace performance
root@edison:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scal
ing_available_frequencies
500000
```sh
### Suspend to Ram, Yocto BSP Edison 3.0
```sh
root@edison:~# echo mem > /sys/power/state
[ 64.899755] intel_scu_watchdog_evo: watchdog_stop
root@edison:~# echo mem > /sys/power/state
[ 72.953877] intel_scu_watchdog_evo: watchdog_stop

Failure under some specific condition

375

Power

root@edison:~# echo mem > /sys/power/state


[ 2644.850650] intel_scu_watchdog_evo: watchdog_stop
[ 2644.904499] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0 retu
rns -16
[ 2644.904516] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0 retu
rns -16
[ 2644.904532] PM: Device 0000:00:01.3 failed to suspend async:
error -16
[ 2644.925786] PM: Some devices failed to suspend
-sh: echo: write error: Device or resource busy

Suspend to Ram, Yocto BSP Edison 2.1


root@edison:~# echo "mem" > /sys/power/state
[23496.070128] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0
returns -16
[23496.070144] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0
returns -16
[23496.070158] PM: Device 0000:00:01.3 failed to suspend asy
nc: error -16
[23496.091362] PM: Some devices failed to suspend
-sh: echo: write error: Device or resource busy
[23495.740274] PM: Syncing filesystems ... done.
[23495.743025] PM: Preparing system for mem sleep
[23495.752571] Freezing user space processes ... (elapsed 0.
06 seconds) done.
[23495.820232] Freezing remaining freezable tasks ... (elaps
ed 0.01 seconds) done.
[23495.840185] PM: Entering mem sleep
[23495.840463] Suspending console(s) (use no_console_suspend
to debug)
[23495.980087] snd_intel_sst: runtime_resume called
[23496.001158] CFG80211-ERROR) wl_cfg80211_disconnect : Reas
on 3
[23496.005525] CFG80211-ERROR) wl_is_linkdown : Link down Re
ason : WLC_E_LINK
[23496.005543] link down if wlan0 may call cfg80211_disconne

376

Power
cted. event : 16, reason=2 from f8:01:13:a8:2b:40
[23496.007379] CFG80211-ERROR) wl_is_linkdown : Link down Re
ason : WLC_E_DEAUTH
[23496.007392] CFG80211-ERROR) wl_is_linkdown : Link down Re
ason : WLC_E_DEAUTH
[23496.011506] snd_intel_sst: runtime_suspend called
[23496.011626] bcove_thrm bcove_thrm: suspend called.
[23496.011798] cfg80211: Calling CRDA for country: MX
[23496.020168] bcmsdh_sdmmc_suspend Enter
[23496.020174] bcmsdh_sdmmc_suspend Enter
[23496.070092] bcmsdh_sdmmc_resume Enter
[23496.070128] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0
returns -16
[23496.070144] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0
returns -16
[23496.070158] PM: Device 0000:00:01.3 failed to suspend asy
nc: error -16
[23496.091362] PM: Some devices failed to suspend
[23496.091661] bcove_thrm bcove_thrm: resume called.
[23496.092335] snd_intel_sst: runtime_resume called
[23496.200343] PM: resume of devices complete after 108.965
msecs
[23496.202457] PM: Finishing wakeup.
[23496.202472] Restarting tasks ... done.
[23496.239956] snd_intel_sst: runtime_idle called
[23496.239982] snd_intel_sst: runtime_suspend called
[23496.249816] ------------[ cut here ]----------- [23496.249861] WARNING: at /data/jenkins_worker/workspace/ed
ison-weekly/linux-kernel/drivers/usb/dwc3/gadget.c:1248 __dwc)
[23496.249875] Modules linked in: bcm4334x(O) usb_f_acm u_se
rial g_multilibcomposite bcm_bt_lpm [last unloaded: bcm4334x]
[23496.249941] CPU: 0 PID: 142 Comm: systemd-udevd Tainted:
GO3.10.17-poky-edison+ #1
[23496.249956] Hardware name: Intel Corporation Merrifield/B
ODEGA BAY, BIOS 5422015.01.21:18.19.48
[23496.249969] c1b4326c 00000000 f6c0bd00 c18d9eea f6c0bd28
c12408be c1ae1657c1b4326c
[23496.250020] 000004e0 c15fa14e c15fa14e f6c49020 f675f180
f6c0bd88 f6c0bd38c1240982
[23496.250068] 00000009 00000000 f6c0bd94 c15fa14e f6c0bd7c

377

Power
00000000 0000003635dac802
[23496.250116] Call Trace:
[23496.250150] [<c18d9eea>] dump_stack+0x16/0x18
[23496.250179] [<c12408be>] warn_slowpath_common+0x5e/0x80
[23496.250204] [<c15fa14e>] ? __dwc3_gadget_kick_transfer+0
x3de/0x430
[23496.250227] [<c15fa14e>] ? __dwc3_gadget_kick_transfer+0
x3de/0x430
[23496.250253] [<c1240982>] warn_slowpath_null+0x22/0x30
[23496.250277] [<c15fa14e>] __dwc3_gadget_kick_transfer+0x3
de/0x430
[23496.250305] [<c15fa47e>] dwc3_gadget_ep_queue+0x2de/0x3a
0
[23496.250353] [<f8906824>] eth_start_xmit+0x1a4/0x330 [g_m
ulti]
[23496.250382] [<c17411e3>] dev_hard_start_xmit+0x343/0x570
[23496.250407] [<c18df22f>] ? _raw_spin_unlock_bh+0x1f/0x30
[23496.250432] [<c176506a>] ? __nf_conntrack_confirm+0x21a/
0x340
[23496.250459] [<c175ad1c>] sch_direct_xmit+0x7c/0x1c0
[23496.250484] [<c1741572>] dev_queue_xmit+0x162/0x400
[23496.250512] [<c177a2e0>] ip_finish_output+0x210/0x3a0
[23496.250536] [<c177a0d0>] ? ip_fragment+0x970/0x970
[23496.250562] [<c177bb17>] ip_output+0xb7/0xc0
[23496.250586] [<c177a0d0>] ? ip_fragment+0x970/0x970
[23496.250611] [<c177b230>] ip_local_out+0x20/0x30
[23496.250637] [<c17ac771>] igmpv3_sendpack+0x51/0x60
[23496.250663] [<c17ad2c3>] igmp_ifc_timer_expire+0x173/0x2
90
[23496.250689] [<c1250c02>] call_timer_fn+0x32/0x140
[23496.250715] [<c17ad150>] ? igmp_gq_timer_expire+0x30/0x3
0
[23496.250739] [<c1250e52>] run_timer_softirq+0x142/0x230
[23496.250766] [<c1270ddb>] ? get_parent_ip+0xb/0x40
[23496.250791] [<c17ad150>] ? igmp_gq_timer_expire+0x30/0x3
0
[23496.250817] [<c1249251>] __do_softirq+0xe1/0x260
[23496.250843] [<c1249170>] ? tasklet_action+0x120/0x120
[23496.250856] <IRQ> [<c1249555>] ? irq_exit+0xa5/0xb0
[23496.250899] [<c18e535b>] ? smp_apic_timer_interrupt+0x5b

378

Power
/0x8b
[23496.250928] [<c14d9ee4>] ? trace_hardirqs_off_thunk+0xc/
0x18
[23496.250953] [<c18dfc2a>] ? apic_timer_interrupt+0x32/0x3
8
[23496.250978] [<c18d0000>] ? init_intel_cacheinfo+0x1b3/0x
37e
[23496.250994] ---[ end trace ab9c379ac6289fd6 ]-- [23500.707829] CFG80211-ERROR) wl_cfg80211_connect : Connect
ting withf8:01:13:a8:2b:40 channel (1) ssid "INFINITUMfjph", )
[23500.707829]
[23500.763280] wl_bss_connect_done succeeded with f8:01:13:a
8:2b:40
[23500.769798] wl_bss_connect_done succeeded with f8:01:13:a
8:2b:40

https://communities.intel.com/thread/61067?tstart=0
https://github.com/01org/edisonlinux/commit/149de7abd8829bcc009641e215b53fe89fcf29b2

Userspace Applications
SystemCtl, Yocto BSP Edison 3.0
From ArchLinux SystemD
Shut down and reboot the system:
root@edison:~# systemctl reboot
Shut down and power-off the system:
root@edison:~# systemctl poweroff
Suspend the system:
root@edison:~# systemctl suspend
Put the system into hibernation:
root@edison:~# systemctl hibernate
Put the system into hybrid-sleep state (or suspend-to-both):
root@edison:~# systemctl hybrid-sleep

379

Power

root@edison:~# systemctl suspend


[ 2283.848450] intel_scu_watchdog_evo: watchdog_stop
[ 2283.907087] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0 retu
rns -16
[ 2283.907105] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0 retu
rns -16
[ 2283.907120] PM: Device 0000:00:01.3 failed to suspend async:
error -16
[ 2283.928403] PM: Some devices failed to suspend
[ 2284.491363] intel_scu_watchdog_evo: watchdog_stop
[ 2284.537447] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0 retu
rns -16
[ 2284.537464] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0 retu
rns -16
[ 2284.537479] PM: Device 0000:00:01.3 failed to suspend async:
error -16
[ 2284.558639] PM: Some devices failed to suspend
A dependency job for suspend.target failed. See 'journalctl -xn'
for details.
root@edison:~#

root@edison:~# dmesg
...
[ 2284.038549] Restarting tasks ... done.
[ 2284.088450] snd_intel_sst: runtime_idle called
[ 2284.088478] snd_intel_sst: runtime_suspend called
[ 2284.096683] PM: Syncing filesystems ... done.
[ 2284.100314] PM: Preparing system for freeze sleep
[ 2284.106998] ------------[ cut here ]-----------[ 2284.107045] WARNING: at /iotdk/noel/newpull/devkit-build-tool
s/workdir/poky/$
[ 2284.107060] Modules linked in: usb_f_acm u_serial g_multi lib
composite bcm_b$
[ 2284.107123] CPU: 1 PID: 406 Comm: kworker/u4:2 Tainted: G
O 3.10.1$
[ 2284.107137] Hardware name: Intel Corporation Merrifield/BODEG
A BAY, BIOS 542$
[ 2284.107160] Workqueue: kmmcd mmc_rescan

380

Power
[ 2284.107176] c1b472c8 00000000 f6f8fd00 c18dc6da f6f8fd28 c12
408ae c1ae494a $
[ 2284.107226] 000004e0 c15fa18e c15fa18e f6c49020 f5c20000 f6f
8fd88 f6f8fd38 $
[ 2284.107273] 00000009 00000000 f6f8fd94 c15fa18e f6f8fd7c 000
00000 00000036 $
[ 2284.107321] Call Trace:
[ 2284.107353] [<c18dc6da>] dump_stack+0x16/0x18
[ 2284.107384] [<c12408ae>] warn_slowpath_common+0x5e/0x80
[ 2284.107409] [<c15fa18e>] ? __dwc3_gadget_kick_transfer+0x3de
/0x430
...
[ 2284.108500] [<c1263560>] ? kthread+0xa0/0xb0
[ 2284.108523] [<c18e5465>] ? sub_preempt_count+0x95/0xf0
[ 2284.108551] [<c18e73f7>] ? ret_from_kernel_thread+0x1b/0x28
[ 2284.108574] [<c12634c0>] ? kthread_create_on_node+0xc0/0xc0
[ 2284.108592] ---[ end trace 33110b433ad381ba ]--[ 2284.299642] Freezing user space processes ... (elapsed 0.01 s
econds) done.
[ 2284.317476] Freezing remaining freezable tasks ... (elapsed 0
.01 seconds) do$
[ 2284.337404] PM: Entering freeze sleep
[ 2284.337423] Suspending console(s) (use no_console_suspend to
debug)
[ 2284.467318] snd_intel_sst: runtime_resume called
[ 2284.490418] snd_intel_sst: runtime_suspend called
[ 2284.491080] bcmsdh_sdmmc_suspend Enter
[ 2284.491087] bcmsdh_sdmmc_suspend Enter
[ 2284.491363] intel_scu_watchdog_evo: watchdog_stop
[ 2284.491761] bcove_thrm bcove_thrm: suspend called.
[ 2284.537411] bcmsdh_sdmmc_resume Enter
[ 2284.537447] pci_pm_suspend(): sdhci_pci_suspend+0x0/0xd0 retu
rns -16
[ 2284.537464] dpm_run_callback(): pci_pm_suspend+0x0/0x1d0 retu
rns -16
[ 2284.537479] PM: Device 0000:00:01.3 failed to suspend async:
error -16
[ 2284.558639] PM: Some devices failed to suspend
[ 2284.558944] bcove_thrm bcove_thrm: resume called.
[ 2284.559690] snd_intel_sst: runtime_resume called

381

Power
[ 2284.670305] PM: resume of devices complete after 111.609 msec
s
[ 2284.672284] PM: Finishing wakeup.
[ 2284.702653] snd_intel_sst: runtime_idle called
[ 2284.702678] snd_intel_sst: runtime_suspend called
[ 2284.672297] Restarting tasks ... done.
[ 2288.575692] CFG80211-ERROR) wl_cfg80211_connect : Connectting
withf8:01:13:a$

root@edison:~# systemctl poweroff


root@edison:~# cat /sys/module/pcie_aspm/parameters/policy
default [performance] powersave
root@edison:~# cpufreq-info
root@edison:~# head /sys/class/regulator/*/name

Setup
Opkg
Apt-Get

Device Configuration
Usage Models
Links
ACPI Wikipedia
http://www.helios.de/heliosapp/edison/index.html
https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
https://www.kernel.org/doc/Documentation/power/states.txt
https://www.kernel.org/doc/Documentation/power/basic-pm-debugging.txt
https://communities.intel.com/thread/61067

382

Power
performance states (P-states) or power saving states (C-states)
Dongle Host Driver, version 1.141.59 (r)

Suspend Issue
In the latest Yocto release (2.1 from 09/28/15), there is a problem when trying to
put asleep the edison board. The commands to put the edison board in S3 state
are:
root@debian8:~# systemctl stop wpa_supplicant
root@debian8:~# echo -n "mem" > /sys/power/state

But this only works the first time after a reboot. The patch involves modifying two
lines of code from intel_soc_pmu.c file from the linux kernel:
https://github.com/01org/edisonlinux/commit/149de7abd8829bcc009641e215b53fe89fcf29b2
Assuming you have a working yocto build environment (Check Edison BSP
instructions for this), the file is on the following path:
iotlab@debian8:~/edison-src$ vim ./out/linux64/build/tmp/wor
k/edison-poky-linux/linux- yocto/3.10.17-r0/linux/arch/x86/platf
orm/intel-mid/intel_soc_pmu.c

Then we need to recompile and rebuild the image:


iotlab@debian8:~/edison-src/out/linux64$ source poky/oe-init
-build-env iotlab@debian8:~/edison-src/out/linux64/build$ bitbak
e linux-yocto -f -c compile iotlab@debian8:~/edison-src/out/linu
x64/build$ bitbake edison-image iotlab@debian8:~/edison-src/out/
linux64/build$ cd ~/edison-src/meta-intel-edison/utils/flash iot
lab@debian8:~/edison-src/meta-intel-edison/utils/flash$ ./postBu
ild.sh

383

Power

384

Thermal

Thermal
root@edison:~# cat /sys/class/thermal/thermal_zone0/trip_point_0
_tem

385

Graphics

Graphics
Edidoom Intel Edison Homepage
Edidoom Intel Edison Display driver code and test program

386

LED

LED
If you are using Linux as your kernel on a SoC design, youll be glad to know
that it has an entire subsystem dedicated to LEDs! Fabio Baltieri Linux LED
Subsystem
Linux Kernel GPIO Documentation
menuconfig LEDS_TRIGGERS
bool "LED Trigger support"
depends on LEDS_CLASS
help
This option enables trigger support for the leds class.
These triggers allow kernel events to drive the LEDs and c
an
be configured via sysfs. If unsure, say Y.
if LEDS_TRIGGERS
...
config LEDS_TRIGGER_HEARTBEAT
tristate "LED Heartbeat Trigger"
depends on LEDS_TRIGGERS
help
This allows LEDs to be controlled by a CPU load average.
The flash frequency is a hyperbolic function of the 1-minu
te
load average.
If unsure, say Y.
...

387

LIDAR

LIDAR
RPLIDAR A2 - 360 Degree Laser Scanner Development Kit

388

Debug

Debug
Debugging is the process of finding and resolving or defects that prevent
correct operation of computer software or a system. Debugging tends to be
harder when various subsystems are tightly coupled, as changes in one may
cause bugs to emerge in another. Wikipedia
Ubuntu Kernel Debugging Tricks

Kernel Configuration
Kernel hacking
-*- Kernel debugging
[*] Magic SysRq key
-*- Debug filesystem
[*] Detect Soft Lockups
[ ] Collect scheduler statistics
[*] Debug slab memory allocations
[*] Memory leak debugging
[*] Mutex debugging, deadlock detection
[*] Spinlock debugging
[*] Sleep-inside-spinlock checking
[ ] kobject debugging
[ ] Highmem debugging
[ ] Compile the kernel with debug info

Kernel Integration
Linux Debug Filesystem

389

Debug
Debugfs exists as a simple way for kernel developers to make information
available to user space. Unlike /proc, which is only meant for information
about a process, or sysfs, which has strict one-value-per-file rules, debugfs
has no rules at all. Wikipedia
Linux Kernel Documentation Debugfs
Linux Kernel Debugfs
root@edison:~# mount -t debugfs none /sys/kernel/debug
mount: none is already mounted or /sys/kernel/debug busy
none is already mounted on /tmp/temptmpfs
root@edison:~# ls /sys/kernel/debug/
asoc gpio_debug pmu_sync_d0ix
bdi hid pwm
bluetooth hsu regmap
boot_params ieee80211 regulator
c_states_stat ignore_add remoteproc
cstate_ignore_add ignore_remove s3_ctrl
cstate_ignore_remove iio sched_features
debug_feature intel_scu_oshob soc_thermal
disable_emmc_ipanic kprobes sst
dma_buf mce suspend_stats
dri mid_pmu_states tracing
dump_cmd mmc0 usb
dump_output mmc1 wakeup_sources
dwc3-device.1 mmc2 watchdog
dynamic_debug pmic_ccsm x86
emmc_ipanic pmu_force_d0i0
gpio pmu_force_d0i3
root@edison:~#

Linux Magic System Request Key Hacks


It is a 'magical' key combo you can hit which the kernel will respond to
regardless of whatever else it is doing, unless it is completely locked up.
Documentation
Linux Magic System Request Key Hacks

390

Debug

Ftrace
Debugging the kernel using Ftrace - Part 1
root@edison:~# cd /sys/kernel/debug/tracing
root@edison:/sys/kernel/debug/tracing# cat available_tracers
blk function_graph wakeup_rt wakeup preemptirqsoff preemptof
f irqsoff function nop
root@edison:/sys/kernel/debug/tracing# echo function > curre
nt_tracer
root@edison:/sys/kernel/debug/tracing# cat current_tracer
function

Applications / Libraries
Programs
None

391

Application Development

Application Development
Intel Edison Native Application Guide
Self Updating Edison Apps
Smart Attendance System (Intel Edison Inside)
Self Updating Edison Apps
Embedded Linux Applications
Top IoT Open Source Projects

Heroku
Learn about building, deploying and managing your apps on Heroku
Homepage

392

C Compiler

C Language
C (/si/, as in the letter c) is a general-purpose, imperative computer
programming language, supporting structured programming, lexical variable
scope and recursion, while a static type system prevents many unintended
operations Wikipedia)
Exploring Intel Edison in C

GCC Compiler
Upgrade
root@edison:~# opkg upgrade packagegroup-core-buildessential

Native Compilation C, Sockets


Socket Implementation, Server
root@edison:~# nano socketserver.c

#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
int main( int argc, char *argv[] ) {
int sockfd, newsockfd, portno, clilen;
char buffer[256];
struct sockaddr_in serv_addr, cli_addr;

393

C Compiler
int n;
/* First call to socket() function */
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("ERROR opening socket");
exit(1);
}
/* Initialize socket structure */
bzero((char *) &serv_addr, sizeof(serv_addr));
portno = 5001;
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = INADDR_ANY;
serv_addr.sin_port = htons(portno);
/* Now bind the host address using bind() call.*/
if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_
addr)) < 0) {
perror("ERROR on binding");
exit(1);
}
/* Now start listening for the clients, here process will
* go in sleep mode and will wait for the incoming connecti
on
*/
listen(sockfd,5);
clilen = sizeof(cli_addr);
/* Accept actual connection from the client */
newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &cli
len);
if (newsockfd < 0) {
perror("ERROR on accept");
exit(1);

394

C Compiler
}
/* If connection is established then start communicating */
bzero(buffer,256);
n = read( newsockfd,buffer,255 );
if (n < 0) {
perror("ERROR reading from socket");
exit(1);
}
printf("I am the Server, here is the message: %s\n",buffer);
/* Write a response to the client */
n = write(newsockfd,"I got your message",18);
if (n < 0) {
perror("ERROR writing to socket");
exit(1);
}
return 0;
}

root@edison:~# gcc socketserver.c -o socketserver

Socket Implementation, Client


#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
int main(int argc, char *argv[]) {
int sockfd, portno, n;

395

C Compiler
struct sockaddr_in serv_addr;
struct hostent *server;
char buffer[256];
if (argc < 3) {
fprintf(stderr,"usage %s hostname port\n", argv[0]);
exit(0);
}
portno = atoi(argv[2]);
/* Create a socket point */
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("ERROR opening socket");
exit(1);
}
server = gethostbyname(argv[1]);
if (server == NULL) {
fprintf(stderr,"ERROR, no such host\n");
exit(0);
}
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_a
ddr, server->h_length);
serv_addr.sin_port = htons(portno);
/* Now connect to the server */
if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv
_addr)) < 0) {
perror("ERROR connecting");
exit(1);
}

396

C Compiler
/* Now ask for a message from the user, this message
* will be read by server
*/
printf("Please enter the message: ");
bzero(buffer,256);
fgets(buffer,255,stdin);
/* Send message to the server */
n = write(sockfd, buffer, strlen(buffer));
if (n < 0) {
perror("ERROR writing to socket");
exit(1);
}
/* Now read server response */
bzero(buffer,256);
n = read(sockfd, buffer, 255);
if (n < 0) {
perror("ERROR reading from socket");
exit(1);
}
printf("I am the Client, message sent: %s\n",buffer);
return 0;
}

root@edison:~# gcc socketclient.c -o socketclient

Socket Implementation, Test


root@edison:~# ./socketserver &
root@edison:~# ./socketclient 192.168.1.74 5001

Native Compilation G++ Compiler, Hello World


397

C Compiler

root@edison:~# g++
g++: fatal error: no input files
compilation terminated.
root@edison:~# vi helloworld.c

#include <stdio.h>
void main (){
printf("Hello World\n");
}

root@edison:~# g++ -o helloworld helloworld.c


root@edison:~# ./helloworld
Hello World
root@edison:~#

398

Cross Compile

Cross Compile
A cross compiler is a compiler capable of creating executable code for a
platform other than the one on which the compiler is running. Wikipedia
Cross Compiling on Linux for the Edison
Cross Platform Development for Intel Edison using CMake and Qt Creator(32
and 64 bits)
Cross compile Libmraa for intel Edison from Linux x86_64

399

Python

Python
Python is a widely used high-level, general-purpose, interpreted, dynamic
programming language. Its design philosophy emphasizes code readability,
and its syntax allows programmers to express concepts in fewer lines of code
than would be possible in languages such as C++ or Java. The language
provides constructs intended to enable clear programs on both a small and
large scale. Wikipedia
Five trivial things every python programmer should work with

Python 3
Flask
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
intentions.
Flask Homepage
root@edison:~# apt-get install python-flask
root@edison:~# pip install Flask
root@edison:~# nano myflask.py

from flask import Flask


app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host='0.0.0.0', port=5000, debug=True, threaded=True
)

400

Python

root@edison:~# python myflask.py


* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
192.168.1.73 - - [18/Oct/2015 16:34:56] "GET / HTTP/1.1" 200
192.168.1.73 - - [18/Oct/2015 16:34:56] "GET /favicon.ico HT
TP/1.1" 404 192.168.1.73 - - [18/Oct/2015 16:34:56] "GET /favicon.ico HT
TP/1.1" 404 -

401

NodeJS

NodeJS
In software development, Node.js is an open-source, cross-platform runtime
environment for developing server-side Web applications. Although Node.js is
not a JavaScript framework, many of its basic modules are written in
JavaScript, and developers can write new modules in JavaScript. The runtime
environment interprets JavaScript using Google's V8 JavaScript engine.
Wikipedia
Principles of Writing Consistent, Idiomatic JavaScript
A set of node-red nodes for connecting to johnny-five IO Plugins
Intel Galileo & Intel Edison IO Plugin for Johnny-Five
Debug Node js remotely on Intel Edison with Jetbrains Idea
Arduino Experimenter's Guide for NodeJS
JavaScript: The Perfect Language for the Internet of Things (IoT)
Node.Js for Embedded Systems
Programming the Internet of Things with Node.Js

Mraa
root@edison:~# nano mr.js

var mraa = require('mraa');


var pinDigital = new mraa.Gpio(13);
console.log('MRAA Version: ' + m.getVersion());
pinDigital.dir(mraa.DIR_OUT);
pinDigital.write(1);

root@edison:~# node mr.js

402

NodeJS

Nodejs, Socket.io and Intel Edison


root@edison:~# npm install -g express socket.io
-\|/-\|/-\|/-\-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/--\|/-\|/-\|/\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\s
escape-html@1.0.3
range-parser@1.0.3
...
socket.io-adapter@0.4.0 (socket.io-parser@2.2.2)
socket.io-client@1.4.5 (to-array@0.1.4, indexof@0.
0.1, component root@edison:~# git clone https://github.com/m2aglabs/socket.
io-demo.git
Cloning into 'socket.io-demo'...
remote: Counting objects: 22, done.
remote: Total 22 (delta 0), reused 0 (delta 0), pack-reused
22
Unpacking objects: 100% (22/22), done.
Checking connectivity... done.
root@edison:~# cd socket.io-demo/
root@edison:~/socket.io-demo# ls
LICENSE.md icon.png package.json
README.md index.html thermo_demo.xdk
app.js js thermo_demo.xdke
root@edison:~/socket.io-demo# node app.js
MRAA Version: v0.8.0

In a web browser go to http://192.168.1.65:8085/

Using a Rotary Encoder on Intel Edison, XDK


Rotary Encoder Demo
Requirements
Grove Rotary Encoders on D2
Grove Button on D4

403

NodeJS

itot@edison:~# git clone https://github.com/m2aglabs/rotary_enco


der_demo.git
Cloning into 'rotary_encoder_demo'...
remote: Counting objects: 25, done.
remote: Total 25 (delta 0), reused 0 (delta 0), pack-reused 25
Unpacking objects: 100% (25/25), done.
Checking connectivity... done.
root@edison:~/trash# cd rotary_encoder_demo/
root@edison:~/trash/rotary_encoder_demo# ls
LICENSE.md index.html rotary_demo.xdk
README.md js rotary_demo.xdke
icon.png package.json server.js
root@edison:~/rotary_encoder_demo# node server.js
MRAA Version: v0.8.0

In a web browser go to http://192.168.1.65:8085/

NodeJS Modules
root@edison:~# ls /usr/lib/node_modules/
iotkit jsupm_grovevdiv jsupm_mpl311
5a2
iotkit-agent jsupm_grovewater jsupm_mpr121
iotkit-comm jsupm_grovewfs jsupm_mpu915
0
jsupm_a110x jsupm_guvas12d jsupm_mq303a
jsupm_ad8232 jsupm_h3lis331dl jsupm_my9221
jsupm_adafruitms1438 jsupm_hcsr04 jsupm_nrf24l
01
jsupm_adafruitss jsupm_hm11 jsupm_nrf800
1
jsupm_adc121c021 jsupm_hmc5883l jsupm_nunchu
ck
jsupm_adis16448 jsupm_hmtrp jsupm_otp538
u
jsupm_adxl335 jsupm_hp20x jsupm_pca968
5
jsupm_adxl345 jsupm_ht9170 jsupm_pn532

404

NodeJS
jsupm_am2315 jsupm_htu21d jsupm_ppd42n
s
jsupm_apds9002 jsupm_hx711 jsupm_pulsen
sor
jsupm_at42qt1070 jsupm_i2clcd jsupm_rfr359
f
jsupm_biss0001 jsupm_ina132 jsupm_rgbrin
gcoder
jsupm_bmpx8x jsupm_isd1820 jsupm_rotary
encoder
jsupm_buzzer jsupm_itg3200 jsupm_rpr220
jsupm_cjq4435 jsupm_joystick12 jsupm_servo
jsupm_ds1307 jsupm_l298 jsupm_si114x
jsupm_ecs1030 jsupm_ldt0028 jsupm_sm130
jsupm_enc03r jsupm_lm35 jsupm_st7735
jsupm_flex jsupm_lol jsupm_stepmo
tor
jsupm_gas jsupm_loudness jsupm_sx6119
jsupm_gp2y0a jsupm_lpd8806 jsupm_ta1220
0
jsupm_grove jsupm_lsm303 jsupm_tcs341
4cs
jsupm_grovecircularled jsupm_lsm9ds0 jsupm_th02
jsupm_grovecollision jsupm_m24lr64e jsupm_tm1637
jsupm_groveehr jsupm_max31723 jsupm_tsl256
1
jsupm_groveeldriver jsupm_max31855 jsupm_ttp223
jsupm_groveelectromagnet jsupm_max44000 jsupm_ublox6
jsupm_groveemg jsupm_max5487 jsupm_uln200
xa
jsupm_grovegprs jsupm_maxds3231m jsupm_waterl
evel
jsupm_grovegsr jsupm_maxsonarez jsupm_wheele
ncoder
jsupm_grovelinefinder jsupm_mg811 jsupm_wt5001
jsupm_grovemd jsupm_mhz16 jsupm_yg1006
jsupm_grovemoisture jsupm_mic jsupm_zfm20
jsupm_groveo2 jsupm_mlx90614 mraa
jsupm_grovescam jsupm_mma7455 npm
jsupm_grovespeaker jsupm_mma7660

405

NodeJS
root@edison:~#

NodeJS Edison-Cli
xe1gyq@jessie:~$ sudo npm install -g edison-cli
npm WARN deprecated graceful-fs@3.0.8: graceful-fs v3.0.0 and be
fore will fail on node releases >= v6.0. Please update to gracef
ul-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to fi
nd it in the tree.
> ws@0.4.32 install /usr/local/lib/node_modules/edison-cli/node_
modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/usr/local/lib/node_modules/edison-cli
/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Fini
shed
COPY Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
SOLINK_MODULE(target) Release/obj.target/validation.node: Fini
shed
COPY Release/validation.node
make: Leaving directory '/usr/local/lib/node_modules/edison-cli/
node_modules/ws/build'
/usr/local/bin/edison-cli -> /usr/local/lib/node_modules/edisoncli/bin/edison-cli
edison-cli@2.0.0 /usr/local/lib/node_modules/edison-cli
commander@2.9.0 (graceful-readlink@1.0.1)
temporary@0.0.8 (package@1.0.1)
mdns-js@0.1.5 (debug@0.8.1)
fstream@1.0.8 (inherits@2.0.1, graceful-fs@4.1.3, mkdirp@0.5
.1, rimraf@2.5.2)
tar-edison@0.1.16 (inherits@1.0.2, block-stream@0.0.8, fstre
am@0.1.31)

406

NodeJS
ws@0.4.32 (tinycolor@0.0.1, options@0.0.6, commander@2.1.0,
nan@1.0.0)
xe1gyq@jessie:~$ edison-cli list
Edison Devices Found: 2
1 - 192.168.1.70
2 - 192.168.1.70
xe1gyq@jessie:~$

407

Cloud9

Cloud9
Your development environment, in the cloud. Cloud9 combines a powerful
online code editor with a full Ubuntu workspace in the cloud. c9.io
This is your Workspace. We maintain it, you control it
Fast. Scalable. Easily handle hundreds of thousands of files in your
workspace and hundreds of thousands of lines of code in the editor
Wind River saw the potential of Cloud9 and built Cloud9 into their Helix
Device Cloud to create a next generation development platform for their
embedded developer community.
Cloud9 Homepage

408

Cloud9

root@edison:~# npm version -g


{ http_parser: '1.0',
node: '0.10.38',
v8: '3.14.5.9',
ares: '1.9.0-DEV',
uv: '0.10.36',
zlib: '1.2.8',
modules: '11',
openssl: '1.0.1m',
npm: '1.4.28' }
root@edison:~# git clone https://github.com/c9/core.git c9sdk
Cloning into 'c9sdk'...
remote: Counting objects: 26633, done.
remote: Compressing objects: 100% (636/636), done.
remote: Total 26633 (delta 406), reused 0 (delta 0), pack-re
used 25996
Receiving objects: 100% (26633/26633), 16.41 MiB | 1.03 MiB/
s, done.
Resolving deltas: 100% (17324/17324), done.
Checking connectivity... done.
Checking out files: 100% (3010/3010), done.

root@edison:~# cd c9sdk
root@edison:~/c9sdk# ls
LICENSE build local plugins sett
ings
README.md configs node_modules scripts test
bin docs package.json server.js
root@edison:~/c9sdk# ./scripts/install-sdk.sh
...
checking for LIBEVENT... yes
checking for library containing setupterm... no
configure: error: "curses not found"
...

Cloud 9 IDE on Intel Edison by NavinB

409

Cloud9

root@edison:~# git clone https://github.com/navin-bhaskar/Cl


oud9-on-Intel-Edison.git c9
root@edison:~# cd c9
root@edison:~# sh Setup_Cloud9_On_Edison.sh install
<Install a Ps specific version>
root@edison:~# sh Setup_Cloud9_On_Edison.sh

410

Data

Data
The Things Network
Unleashing the Internet of Things. We are on a mission to build a global open
crowdsourced Internet of Things data network. Homepage
The Things Network Github

Thing Speak
Billions and Billions. The open data platform for the Internet of Things
Homepage

SpaceAPI
The purpose of the Space API is to define a unified specification across the
hackerspaces that can be used to expose information to web apps or any
other application Homepage

411

Drone Code

Drone Code
Dronecode encompasses projects that control flight, enable mission planning,
and otherwise make drone flight and advanced functionality possible.
Dronecode development is done at the project level with coordinating and
resource allocation performed by the TSC and the Board.
From improving agriculture to improving search and rescue, from tracking
endangered species to tracking hurricanes, drones can change our world for
good. Join the community that is helping to shape the world of drones through
a common, shared open source platform for Unmanned Aerial Vehicles
(UAVs). Drone Code Homepage
Drone Code Homepage
Intel Edison Takes Flight
Intel Edison as a Companion Computer
ELC 2015 - Intel Edison to Fuse Embedded Linux & Drone Flight Controllers Mark Brown
BPI-M3 compile Opencv 3.1.0 source code

Ardupilot Project
Github Ardupilot
ROS/Gazebo Simulator with SITL

DroneKit
DroneKit Homepage

DroneKit-Python
DroneKit-Python allows developers to create apps that run on an onboard
companion computer and communicate with the ArduPilot flight controller
using a low-latency link.

412

Drone Code
Python Drone Kit
root@edison:~# opkg install python-pip python-dev
root@edison:~# pip install dronekit dronekit-sitl
root@edison:~# git clone http://github.com/dronekit/dronekit-pyt
hon.git
Cloning into 'dronekit-python'...
remote: Counting objects: 5226, done.
remote: Total 5226 (delta 0), reused 0 (delta 0), pack-reused 52
26
Receiving objects: 100% (5226/5226), 5.20 MiB | 1.07 MiB/s, done
.
Resolving deltas: 100% (3143/3143), done.
Checking connectivity... done.
root@edison:~#

Drones on Intel Architecture


Drones on IA
Aero Platform
The First UAV with Intel RealSense Technology
AT&T and Intel Showcase LTE Connected Drones

Intel Aero Platform for UAV


Powered by the latest Intel Atom quad core processor, this ready-to-fly,
drone-specific development kit features out-of-the-box, plug-and-play
modules with communications, storage, depth, and vision capabilities
including Intel RealSense Technology. Intel Aero Platform for UAV

MavRos
MavRos Github

CI40 Drone
413

Drone Code
CI40 Drone

Links
libiio
libiio
Compass calibration progress with geodesic sections in Ardupilot

Gazebo
Gazebo SITL (gzsitl) Plugin

Equipment
BMI160 IMU
BMI160 Code Review
BMI160 Github

414

Speech

Speech
Alexa AWS Raspberry Pi
How to get Edison to speak
Gewtting Started with Intel Edison
PyAudio
SR Lists
Digital signal processing through speech, hearing, and Python

eSpeak
eSpeak is a compact open source software speech synthesizer for English
and other languages, for Linux and Windows Homepage

VoiceRss
The Voice RSS Text-to-Speech (TTS) API allows conversion of textual
content to speech easier than ever. Just connect to our Text-to-Speech (TTS)
API with a few lines of code and get verbal representation of a textual content.
For converting text to speech you dont need special hardware to care about
intensive use of CPU and memory during conversion operations. Homepage

OpenSST
An Open Source Speech To Text Project
The OpenSTT project is aimed at creating an open source speech-to-text
model that can be used by individuals and company to allow for high
accuracy, low-latency conversion of speech into text. OpenSST
Mycroft Adapt
Mycroft Mimic

Google Cloud Speech API Alpha


415

Speech
Speech to text conversion powered by machine learning Homepage
Android Speech API
Web Speech aPI
Cloud Speech API
REST API
gRPC API
Python Google Text to Speech

gRPC
A high performance, open source, general RPC framework that puts mobile
and HTTP/2 first. Homepage

Pyttsx
Text-to-Speech X-Platform Homepage

Jasper
Control anything with your voice Homepage
Jasper Hackaday
Jasper Github

Lab
root@edison:~# pip install SpeechRecognition
Downloading/unpacking SpeechRecognition
...
root@edison:~#

416

Speech

>>> import speech_recognition as sr


>>> list = sr.Microphone.list_microphone_names()
>>> for element in list:
... print element
...
Loopback: Loopback PCM (hw:0,0)
Loopback: Loopback PCM (hw:0,1)
dummy-audio: (hw:1,0)
USB PnP Sound Device: USB Audio (hw:3,0)
sysdefault
front
surround21
surround40
surround41
surround50
surround51
surround71
dmix
default
>>>

root@edison:~# opkg install libjack



root@edison:~# opkg install --nodeps jack-dev

root@edison:~# opkg install libportaudio-dev
root@edison:~# opkg install flac-dev

417

Speech

import speech_recognition as sr
from os import path
AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "h
ello.wav")
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio = r.record(source) # read the entire audio file
print("Google Speech Recognition thinks you said " + r.recognize
_google(audio, key=""))
WIT_AI_KEY = ""
print("Wit.ai thinks you said " + r.recognize_wit(audio, key=WIT
_AI_KEY))

418

Speech

import speech_recognition as sr
import pyaudio
import wit

r = sr.Recognizer()
with sr.Microphone() as source:
r.adjust_for_ambient_noise(source) # listen for 1 second to
calibrate the energy threshold for ambient noise levels
print("Say something!")
audio = r.listen(source)

WIT_AI_KEY = "32-character uppercase alphanumeric strings"


try:
print("Wit.ai thinks you said " + r.recognize_wit(audio, key
=WIT_AI_KEY))
except sr.UnknownValueError:
print("Wit.ai could not understand audio")
except sr.RequestError:
print("Could not request results from Wit.ai service")

import audioop
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
audio = pyaudio.PyAudio()
# start Recording
stream = audio.open(format=FORMAT, channels=CHANNELS,

419

Speech
rate=RATE, input=True,
frames_per_buffer=CHUNK)
print "recording..."
frames = []
threshold = 1000
for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK)
rms = audioop.rms(data,2)
if rms > threshold:
print "I am hearing you now"
frames.append(data)
print "finished recording"

# stop Recording
stream.stop_stream()
stream.close()
audio.terminate()
waveFile = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
waveFile.setnchannels(CHANNELS)
waveFile.setsampwidth(audio.get_sample_size(FORMAT))
waveFile.setframerate(RATE)
waveFile.writeframes(b''.join(frames))
waveFile.close()

420

Radio Frequency

Radio
ZigBee
Case Study Smart Conference System with Zigbee on Intel Edison
Configuring modules using Gateways based on Intel Quark Processors
Setup Gateway ZigBee

421

Bots

Bots
The 5 Most Inspiring Chatbots On Facebook Messenger

Telegram Bot
A new era of messaging. Telegram is a cloud-based mobile and desktop
messaging app with a focus on security and speed. Homepage
Telegram Web Version 0.5.4 Homepage

Everything you need is here

Bot Revolution
Bots are simply Telegram accounts operated by software not people and
they'll often have AI features. They can do anything teach, play, search,
broadcast, remind, connect, integrate with other services, or even pass
commands to the Internet of Things Bot Revolution
Sample Slack bot built with Botkit
A customizable life embetterment robot
Cisco brings some (real) friends to the chat-bot party

Bots: An introduction for developers


422

Bots
Bots are third-party applications that run inside Telegram. Users can interact with
bots by sending them messages, commands and inline requests. You control your
bots using HTTPS requests to our bot API. Bots: An introduction for developers
1. What can I do with bots?
2. How do bots work?
3. How do I create a bot?
4. How are bots different from humans?
5. Bot perks

Bot Code Examples


Many members of our community are building bots and publishing the source
code. We collect these examples here. Ping us on BotSupport if you've built a
bot and would like to share its code with others Bot Code Examples

BotFather
Go to Web Telegram Org and sign up
Search for BotFather and add it, click on it

423

Bots

BotFather:
They call me the Botfather, I can help you create and set up Tel
egram bots. Please read this manual before we begin:
https://core.telegram.org/bots
You can control me by sending these commands:
/newbot - create a new bot
/token - generate authorization token
/revoke - revoke bot access token
/setname - change a bot's name
/setdescription - change bot description
/setabouttext - change bot about info
/setuserpic - change bot profile photo
/setinline - change inline settings
/setinlinegeo - toggle inline location requests
/setinlinefeedback - change inline feedback settings
/setcommands - change bot commands list
/setjoingroups - can your bot be added to groups?
/setprivacy - what messages does your bot see in groups?
/deletebot - delete a bot
/cancel - cancel the current operation

Bot Creation

424

Bots

Abraham:
/newbot
[7:31:40 PM] BotFather:
Alright, a new bot. How are we going to call it? Please choose a
name for your bot.
[7:31:57 PM] Abraham:
Xe1GyqExample
[7:31:58 PM] BotFather:
Good. Now let's choose a username for your bot. It must end in `
bot`. Like this, for example: TetrisBot or tetris_bot.
[7:32:06 PM] Abraham:
Xe1GyqExampleBot
[7:32:08 PM] BotFather:
Done! Congratulations on your new bot. You will find it at teleg
ram.me/Xe1GyqExampleBot. You can now add a description, about se
ction and profile picture for your bot, see /help for a list of
commands. By the way, when you've finished creating your cool bo
t, ping our Bot Support if you want a better username for it. Ju
st make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
231219005:BBFq9seF0LfVuUvjifc8cBYfCngGcbcGdYs
For a description of the Bot API, see this page: https://core.te
legram.org/bots/api
CANCELFORWARD 1 DELETE 1 REPLY

Search for the Bot already created and add it to your contacts

Python Telegram Bot Library Installation


Not just a Python Wrapper around the Telegram Bot API Homepage Github

425

Bots

root@edison:~# opkg install python-pip python-dev


root@edison:~# pip install setuptools
root@edison:~# pip install requests --upgrade
root@edison:~# pip install future --upgrade
root@edison:~# pip install python-telegram-bot --upgrade

root@edison:~# cd
root@edison:~# git clone https://github.com/python-telegram-bot/
python-telegram-bot.git
Cloning into 'python-telegram-bot'...
remote: Counting objects: 5289, done.
remote: Total 5289 (delta 0), reused 0 (delta 0), pack-reused 52
89
Receiving objects: 100% (5289/5289), 1.52 MiB | 772.00 KiB/s, do
ne.
Resolving deltas: 100% (3876/3876), done.
Checking connectivity... done.
root@edison:~# cd python-telegram-bot
root@edison:~/python-telegram-bot# python setup.py install
...
...
root@edison:~# cd

Bot Example

426

Bots

root@edison:~# vi telegrambot.py

#!/usr/bin/python
import time
import pyupm_grove as grove
import pyupm_i2clcd as lcd
from telegram.ext import Updater, CommandHandler, MessageHandler
, Filters
light = grove.GroveLight(1)
temperature = grove.GroveTemp(0)
display = lcd.Jhd1313m1(0, 0x3E, 0x62)
def functionLight(bot, update):
luxes = light.value()
bot.sendMessage(update.message.chat_id, text='Light ' + str(
luxes))
def functionTemperature(bot, update):
degrees = temperature.value()
bot.sendMessage(update.message.chat_id, text='Temperature '
+ str(degrees))
def functionEcho(bot, update):
bot.sendMessage(update.message.chat_id, text=update.message.
text)
if __name__ == '__main__':
updater = Updater("219701132:AAEBn3_9ZBN-Lk8l8kRnkLKegmjA-S5
iPaQ")
dp = updater.dispatcher
dp.add_handler(CommandHandler("light", functionLight))
dp.add_handler(CommandHandler("temperature", functionTempera

427

Bots
ture))
dp.add_handler(MessageHandler([Filters.text], functionEcho))
updater.start_polling()
while True:
degrees = temperature.value()
luxes = light.value()
display.setColor(255, 0, 0)
display.setCursor(0,0)
display.write('Light ' + str(luxes))
display.setCursor(1,0)
display.write('Temperature ' + str(degrees))
time.sleep(1)
updater.idle()
del temperatura

root@edison:~# python telegrambot.py

Interact with your Bot using the Web Telegram Org Application

BeepBoop
Beep Boop is a ridiculously simple hosting platform for your Slack and
Messenger bots Homepage
Coding a Weather Slackbot for Beep Boop with Wit.ai

428

Artificial Intelligence

Artificial Intelligence
Open Source Alternatives
Techs Biggest Names Are Giving Millions to Crisis Text Line
Hanging out with Anki's Cozmo, the toy robot putting AI at our fingertips

Wit.Ai
Natural Language for Developers. Homepage
Today, thanks to companies like Wit.ai, even kids at hackathons are showing
off weekend projects that are voice-controlled. Venturebeat
Alex Lebrun, Wit Ai

Components
Bots
Mobile apps
Home automation
Wearable devices
Robots

Laboratory
Go to wit.ai
Sign up / Log in
Create a New App (+)
Name: TheIoTLearningInitiative
Description: The IoT Learning Initiative
Language: Spanish
Open Your data will be open to the community
Create App

429

Artificial Intelligence
Bot says...
If your bot is ready to send a direct response (like "Hello!") to the user,
click on Bot Says.
Bot executes...
If your bot needs to perform an action on the context ...
root@edison:~# pip install wit

root@edison:~# cd
root@edison:~# git clone https://github.com/wit-ai/pywit.git
Cloning into 'pywit'...
remote: Counting objects: 230, done.
remote: Total 230 (delta 0), reused 0 (delta 0), pack-reused 230
Receiving objects: 100% (230/230), 45.47 KiB | 0 bytes/s, done.
Resolving deltas: 100% (109/109), done.
Checking connectivity... done.
root@edison:~# cd pywit/
root@edison:~/pywit# ls
CHANGES.md LICENSE README.md examples setup.py wit
root@edison:~/pywit#

Mycroft AI
A.I. for everyone. Connecting the Internet of things has never been easier.
Mycroft has a lot of native skills and abilities baked in and, since it is open
source, it allows outside developers to add more features over time. Mycroft
Always Learning
Always Changing
Always Listening
For the Office: Increase Productivity!
For the Maker: Encourage Creativity!
For the Home: Integrated Artificial Intelligence!
Kickstarter Mycroft: An Open Source Artificial Intelligence For Everyone

430

Artificial Intelligence
Indiegogo Mycroft: Open Source Artificial Intelligence
Update #28 from Mycroft: An Open Source Artificial Intelligence For Everyone
Mycroft Community
Gnome Shell GUI Extension for Mycroft Ai

Components
Adapt Intent Parser
The Adapt Intent Parser is an open source software library for converting
natural language into machine readable data structures. Adapt is lightweight
and streamlined and is designed to run on devices with limited computing
resources. Adapt takes in natural language and outputs a data structure that
includes the intent, a match probability, a tagged list of entities.

Mycroft Core
Mycroft is the technology that ties natural language processing, text-tospeech, speech-to-text, and powerful APIs together to create a powerful
experience allowing users to manipulate their smart devices and the Internet
of Things through voice control.
xe1gyq@jessie:~$ git clone https://github.com/MycroftAI/mycroftcore.git
Cloning into 'mycroft-core'...
remote: Counting objects: 1623, done.
remote: Compressing objects: 100% (155/155), done.
remote: Total 1623 (delta 64), reused 0 (delta 0), pack-reused 1
452
Receiving objects: 100% (1623/1623), 9.45 MiB | 687.00 KiB/s, do
ne.
Resolving deltas: 100% (751/751), done.
Checking connectivity... done.
xe1gyq@jessie:~$ cd mycroft-core/
xe1gyq@jessie:~/mycroft-core$

431

Artificial Intelligence

xe1gyq@jessie:~/mycroft-core$ ./build_host_setup.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version.
bison is already the newest version.
curl is already the newest version.
git is already the newest version.
libglib2.0-dev is already the newest version.
libffi-dev is already the newest version.
libtool is already the newest version.
mpg123 is already the newest version.
libssl-dev is already the newest version.
portaudio19-dev is already the newest version.
python-gobject-dev is already the newest version.
python is already the newest version.
python-dev is already the newest version.
python-setuptools is already the newest version.
python-virtualenv is already the newest version.
s3cmd is already the newest version.
swig is already the newest version.
virtualenvwrapper is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 168 not upgraded.
Searching for virtualenv
Reading https://pypi.python.org/simple/virtualenv/
Best match: virtualenv 15.0.2
Processing virtualenv-15.0.2-py2.7.egg
virtualenv 15.0.2 is already the active version in easy-install.
pth
Installing virtualenv script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages/virtualenv-15.0.2-p
y2.7.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
xe1gyq@jessie:~/mycroft-core$

xe1gyq@jessie:~/mycroft-core$ ./dev_setup.sh

432

Artificial Intelligence

Mimic Text to Speech


Mimic is a fast, lightweight Text-to-speech engine developed by Mycroft A.I.
and VocaliD, based on Carnegie Mellon Universitys FLITE software. Mimic
takes in text and reads it out loud to create a high quality voice. Mimics lowlatency, small resource footprint, and good quality voices set it apart from
other open source text-to-speech projects.

Open Speech to Text


OpenSTT is being led by members of the Mycroft A.I. team as they strive to
create a powerful voice interface and artificial intelligence platform. Our goal
is to make this technology available to as many people as possible. We do
this by leading development of open source projects, OpenSTT is one of
these initiatives.

Mycroft Core 0.6 Alpha


We are pleased to announce that Mycroft Core 0.6 Alpha is available for
download today. Mycroft Core is a lightweight, portable piece of software
written in Python. You can run it on anything from a Raspberry Pi to a gaming
rig. Mycroft Core includes Adapt, Mimic, OpenSTT, and multiple open APIs to
create an experience that allows users to interact with their technology using
the most natural form of human communication speech.
Mycroft Core, the Mycroft Artificial Intelligence Platform Github
Mycroft Alpha v0.6 Software Demo

Viv.Ai
Viv is an artificial intelligence platform that enables developers to distribute
their products through an intelligent, conversational interface. Its the simplest
way for the world to interact with devices, services and things everywhere. Viv
is taught by the world, knows more than it is taught, and learns every day.
Homepage

433

Artificial Intelligence

Api.Ai
Homepage
root@edison:~# pip install apiai

Moni.Ai
Homepage

HeyAthena
HeyAthena

Others
Virtual Assistants Startups
2016 Artificial Intelligence

434

Games

Games
Doom
EdiDoom Intel Edison

Pico-8
PICO-8 is a fantasy console for making, sharing and playing tiny games and
other computer programs. When you turn it on, the machine greets you with a
shell for typing in Lua commands and provides simple built-in tools for
creating your own cartridges. Homepage

Temp
Wiimote
PS3
abraham@aarcemor-desk:~$ sudo rfkill block bluetooth
abraham@aarcemor-desk:~$ dmesg | tail -5
[341098.027225] usb 3-11: New USB device strings: Mfr=0, Product
=0, SerialNumber=0
[341098.041129] Bluetooth: hci0: read Intel version: 37071001800
2030d00
[341098.041186] Bluetooth: hci0: Intel Bluetooth firmware file:
intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
[341098.221297] Bluetooth: hci0: Intel Bluetooth firmware patch
completed and activated
[341113.327102] usb 3-11: USB disconnect, device number 21
abraham@aarcemor-desk:~$ sudo rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no

435

Games
Hard blocked: no
abraham@aarcemor-desk:~$ sudo hciconfig -a
abraham@aarcemor-desk:~$ sudo rfkill unblock bluetooth
abraham@aarcemor-desk:~$ sudo hciconfig -a
hci0: Type: BR/EDR Bus: USB
BD Address: E8:B1:FC:09:6A:FE ACL MTU: 1021:5 SCO MTU: 96:
5
UP RUNNING PSCAN ISCAN
RX bytes:1183 acl:0 sco:0 events:131 errors:0
TX bytes:21230 acl:0 sco:0 commands:130 errors:0
Features: 0xff 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF
Link mode: SLAVE ACCEPT
Name: 'ubuntu-gnome-0'
Class: 0x600100
Service Classes: Audio, Telephony
Device Class: Computer, Uncategorized
HCI Version: 4.0 (0x6) Revision: 0x500
LMP Version: 4.0 (0x6) Subversion: 0x500
Manufacturer: Intel Corp. (2)
abraham@aarcemor-desk:~$ sudo rfkill list
abraham@aarcemor-desk:~$ dmesg | tail -5
[341153.123617] usb 3-11: New USB device found, idVendor=8087, i
dProduct=07dc
[341153.123624] usb 3-11: New USB device strings: Mfr=0, Product
=0, SerialNumber=0
[341153.137572] Bluetooth: hci0: read Intel version: 37071001800
2030d00
[341153.137624] Bluetooth: hci0: Intel Bluetooth firmware file:
intel/ibt-hw-37.7.10-fw-1.80.2.3.d.bseq
[341153.317738] Bluetooth: hci0: Intel Bluetooth firmware patch
completed and activated
abraham@aarcemor-desk:~$

Pair BT

436

Games

437

Vision

Vision
GRIP Computer Vision Engine

Neural Networks
Google Cloud Vision API
Derive insight from images with our powerful Cloud Vision API. Image
analysis with pretrained models. Homepage
Integrates Google Vision features, including image labeling, face, logo, and
landmark detection, optical character recognition (OCR), and detection of
explicit content, into applications.
How it works? Youll get $300 credit to use for up to 60 days. You wont be
charged until you upgrade your account, and you can cancel at any time.
Tutorial
Github Sample code for Google Cloud Vision

Google Cloud Platform Dashboard


Go to Cloud Vision API
Try it for Free
Google Cloud Platform
Thanks for signing up for the 60-day free trial. We have given your $300
in free trial credit to spend. If you run out of credit, do not worry, you will
not be billed until you give permission.
New Project
Project Name: The IoT Learning Initiative

438

Vision
You've set up a Cloud Vision API project in the Google Cloud Platform
Console.
Search
Vision -> Enable
You've set up your environment for using Application Default Credentials.
Authenticating to a Cloud API Service
Go to Google APIs
Select or create a project: The IoT Learning Initiative
Continue

Laboratory
root@edison:~# mkdir vision
root@edison:~# cd vision
ion.gitison:~/vision# git clone https://github.com/GoogleCloudPl
atform/cloud-vision.git
Cloning into 'cloud-vision'...
remote: Counting objects: 1237, done.
remote: Total 1237 (delta 0), reused 0 (delta 0), pack-reused 12
37
Receiving objects: 100% (1237/1237), 3.92 MiB | 322.00 KiB/s, do
ne.
Resolving deltas: 100% (451/451), done.
Checking connectivity... done.
root@edison:~/vision# ls cloud-vision/
CONTRIBUTING.md android data java php
LICENSE chrome-extension go js python
README.md client-secret.json.enc ios nodejs travis.sh
root@edison:~/vision# cd cloud-vision/python/face_detection/
root@edison:~/vision/cloud-vision/python/face_detection#

root@edison:~/vision/cloud-vision/python/face_detection# opkg in
stall libjpeg-dev

439

Vision

root@edison:~/vision/cloud-vision/python/face_detection# pip ins


tall -r requirements.txt --target /home/root
Downloading/unpacking google-api-python-client==1.5.0 (from -r r
equirements.txt (line 1))
Downloading/unpacking Pillow==3.1.1 (from -r requirements.txt (l
ine 2))
...
Installing collected packages: google-api-python-client Pillow,
httplib2, oauth2client, uritemplate, pyasn1, pyasn1-modules, rsa
...

root@edison:~/vision/cloud-vision/python/face_detection# scp xe1


gyq@192.168.1.72:/home/xe1gyq/cred.json .
xe1gyq@192.168.1.72's password:
cred.json 100% 2355 2.3K
B/s 00:00
root@edison:~/vision/cloud-vision/python/face_detection# export
GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_file>

440

Vision

root@edison:~/vision/cloud-vision/python/face_detection# wget ht
tps://upload.wikimedia.org/wikipedia/commons/5/5d/Barack_Obama_f
amily_portrait_2011.jpg
--2016-03-20 00:24:03-- https://upload.wikimedia.org/wikipe
dia/commons/5/5d/Barack_Obama_family_portrait_2011.jpg
Resolving upload.wikimedia.org... 208.80.153.240, 2620:0:860
:ed1a::2:b
Connecting to upload.wikimedia.org|208.80.153.240|:443... co
nnected.
HTTP request sent, awaiting response... 200 OK
Length: 1972894 (1.9M) [image/jpeg]
Saving to: 'Barack_Obama_family_portrait_2011.jpg'
100%[======================================>] 1,972,894 2
64KB/s in 16s
2016-03-20 00:24:20 (122 KB/s) - 'Barack_Obama_family_portra
it_2011.jpg' saved [1972894/1972894]
root@edison:~/vision/cloud-vision/python/face_detection# mv Bara
ck_Obama_family_portrait_2011.jpg face-input.jpeg
root@edison:~/vision/cloud-vision/python/face_detection# time py
thon faces.py face-input.jpeg
Found 4 faces
Writing to file out.jpg
real 0m56.898s
user 0m11.820s
sys 0m0.490s
root@edison:~/vision/cloud-vision/python/face_detection#

Errors

441

Vision

root@edison:~/vision/cloud-vision/python/face_detection# python
faces.py face-input.jpeg
Found 1 face
Writing to file out.jpg
root@edison:~/vision/cloud-vision/python/face_detection#

root@edison:~/vision/cloud-vision/python/face_detection# pip ins


tall six

root@edison:~# git clone https://github.com/google/google-api-py


thon-client.git
Cloning into 'google-api-python-client'...
remote: Counting objects: 13396, done.
remote: Compressing objects: 100% (405/405), done.
remote: Total 13396 (delta 196), reused 0 (delta 0), pack-reused
12991
Receiving objects: 100% (13396/13396), 23.18 MiB | 2.05 MiB/s, d
one.
Resolving deltas: 100% (10115/10115), done.
Checking connectivity... done.
Checking out files: 100% (1495/1495), done.
root@edison:~# cd google-api-python-client/
root@edison:~/google-api-python-client# python setup.py install
--user

442

Messaging

Messaging
Slack
A messaging app for teams who are changing the world Homepage

Trello
Trusted by millions, Trello is the visual collaboration tool that creates a shared
perspective on any project. Trello

443

Entertainment

Entertainment
Running Doom on the tiny Intel Edison computer
Library for Python 2 and 3 to communicate with the Google Chromecast
Mednafen
xe1gyq@jessie:~/mycroft-core$ sudo pip install pychromecast

444

Home Assistants

Home Assistants
Home Assistant Io
root@edison:~# source activate homeassistant

prepending /home/root/miniconda3/envs/homeassistant/bin to PATH

(homeassistant) root@edison:~#

(homeassistant) root@edison:~# pip install homeassistant


Collecting homeassistant

Using cached homeassistant-0.22.1-py2.py3-none-any.whl

Collecting pyyaml<4,>=3.11 (from homeassistant)

Using cached PyYAML-3.11.zip

Collecting eventlet==0.19.0 (from homeassistant)

Using cached eventlet-0.19.0-py2.py3-none-any.whl

Collecting pytz>=2016.4 (from homeassistant)

Using cached pytz-2016.4-py2.py3-none-any.whl

Collecting voluptuous==0.8.9 (from homeassistant)

Using cached voluptuous-0.8.9.tar.gz

Collecting requests<3,>=2 (from homeassistant)

Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)

100% |################################| 512kB 106kB/s

445

Home Assistants

Requirement already satisfied (use --upgrade to upgrade): pip>=7
.0.0 in ./minic)
Collecting jinja2>=2.8 (from homeassistant)

Using cached Jinja2-2.8-py2.py3-none-any.whl

Collecting greenlet>=0.3 (from eventlet==0.19.0->homeassistant)

Using cached greenlet-0.4.10.zip

Requirement already satisfied (use --upgrade to upgrade): setupt
ools>=0.6b1 in )
Collecting MarkupSafe (from jinja2>=2.8->homeassistant)

Using cached MarkupSafe-0.23.tar.gz

Building wheels for collected packages: pyyaml, voluptuous, gree
nlet, MarkupSafe
Running setup.py bdist_wheel for pyyaml ... done

Stored in directory: /home/root/.cache/pip/wheels/4a/bf/14/d79
994d19a59d4f73e6
Running setup.py bdist_wheel for voluptuous ... done

Stored in directory: /home/root/.cache/pip/wheels/7b/11/c5/b48
3b7bf53ce439854c
Running setup.py bdist_wheel for greenlet ... done

Stored in directory: /home/root/.cache/pip/wheels/e0/f2/33/6e4
a562e7497e939311
Running setup.py bdist_wheel for MarkupSafe ... done

Stored in directory: /home/root/.cache/pip/wheels/a3/fa/dc/019
8eed9ad95489b8a8
Successfully built pyyaml voluptuous greenlet MarkupSafe

Installing collected packages: pyyaml, greenlet, eventlet, pytz,
voluptuous, ret
Successfully installed MarkupSafe-0.23 eventlet-0.19.0 greenlet-

446

Home Assistants
0.4.10 homeassi9

root@edison:~# hass
Home Assistant requires at least Python 3.4

root@edison:~# hass
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~
Hello, and welcome to Home Assistant!
We'll hope that we can make all your dreams come true.
Here are some resources to get started:
- Configuring Home Assistant:
https://home-assistant.io/getting-started/configurati
on/
- Available components:
https://home-assistant.io/components/
- Troubleshooting your configuration:
https://home-assistant.io/getting-started/troubleshoo
ting-configuration/
- Getting help:
https://home-assistant.io/help/
This message is generated by the introduction component.
You can
disable it in configuration.yaml.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~

447

Home Assistants

448

Dashboards

Dashboards
Start Bootstrap

449

IRC

IRC
Python IRC Library
The Python ITC Bot

450

Location

Location
Location Aware Sensing System (LASS)

451

Facial Recognition

Facial Recognition
Facial Recognition Door

452

Software Defined Radio

Software Defined Radio


This is a DIY article on how to build a FM Radio Receiver (Supports AM too)
using a Software Defined Radio and an Intel Edison FM Radio Receiver on
Intel Edison

453

Online Training

Online Training
Summer Short Course on Embedded
Systems Programming
The course was taught in Zhejiang University, Summer 2014. It provided the
opportunities for students to learn various fundamental issues as well as
practical development skill in the area of embedded systems programming.
The goals of the course were to let student
Understand the design issues of embedded software and gain an indepth knowledge of development and execution environment on target
processors.
Understand the functions and the internal structure of device interfaces,
drivers, and real-time operating systems.
Acquire the skill to develop multi-threaded embedded software in target
environment, including good quality and coding style for embedded
programming, and testing and debugging approaches to verify embedded
software operations.
Develop feasible task scheduling and carry out system performance and
task schedulability analyses.
The target development environment used in the course was Intel's Galileo
board. The board, with it rich architectural features, was used to investigate
embedded software characteristics and IO operations, and to experience
system design and development practices.
Summer Short Course on Embedded Systems Programming
Instruction Complete all "Summer Short Course on Embedded Systems
Programming"

454

Challenge

Challenge
With this step by step challenge you will maximize the capacity of your
Development Board by writing functionality both in User Space and Kernel Space
from the topics you have learned during the workshop.
1. Build Systems, Yocto Board Support Package, Compilation, Make
2. Build Systems, Yocto Board Support Package, Compilation, Make, Kernel
Version
3. Build Systems, Yocto Board Support Package, Modules, Simulated Sensor
Kernel Module
4. Build Systems, Yocto Board Support Package, Modules, Simulated Sensor
Kernel Module, Load Automatically At Boot Time
5. Build Systems, Yocto Board Support Package, Modules, Simulated Sensor
Kernel Module, InternetOfThings101/main.py
6. Initialization, Dual Boot
7. User Space, Virtual Network Computing
8. User Space, Services
9. Libraries, Temboo
10. Subsystems LED
11. Application Development, Bots, Telegram Bot
12. Application Development, Artificial Intelligence, Wit.Ai
13. Software Version Control System Pushing Code

00 Build Systems, Yocto Board Support


Package, Compilation, Make
Section Build Systems Yocto Board Support Package Compilation
Instruction
Under your Linux Host Development, install the required dependencies,
download and decompress the Intel Edison Linux Sources and compile your
own Intel Edison Board Support Package

455

Challenge

01 Build Systems, Yocto Board Support


Package, Compilation, Make, Kernel
Version
Section Build Systems Yocto Board Support Package Compilation
Instruction
Choose another version / branch and compile
01 Org Intel Edison Linux Kernel
edison-3.19.5
edison-3.10.98
edison-3.10.17
meta-intel-edison-bsp/recipes-kernel/linux/linux-externalsrc.bb log
meta-intel-edison-bsp/recipes-kernel/linux/linux-externalsrc.bb log

02 Build Systems, Yocto Board Support


Package, Modules, Simulated Sensor
Kernel Module
Section Build Systems Yocto Board Support Package Modules
Instruction
Write a Linux Kernel module under that gets registered under
/sys/kernel/sensor using Native Compilation, Simulated Sensor Kernel
Module will generate a random number
Look at Linux Kernel Sysfs Documentation
root@edison:~# ls /sys/kernel/sensor
status
root@edison:~# cat /sys/kernel/sensor/status
456
root@edison:~#

456

Challenge

03 Build Systems, Yocto Board Support


Package, Modules, Simulated Sensor
Kernel Module, Load Automatically At
Boot Time
Section Build Systems Yocto Board Support Package Modules
Instruction
Make your Simulated Sensor Module load automatically at boot time by
incorporating your Linux Kernel module into your Yocto Board Support
Package Compilation

04 Build Systems, Yocto Board Support


Package, Modules, Simulated Sensor
Kernel Module,
InternetOfThings101/main.py
Section Build Systems Yocto Board Support Package Modules
Instruction
Under EmbeddedLinux/main.py replace existing functionality/logic under
functionDataSensor to use now the random number generated by the
Simulated Sensor Kernel Module

05 Initialization, Dual Boot


Section Initialization Dual Boot
Instruction
Allow Intel Edison to boot Ubilinux from uSD, Yocto shall be maintained under
main flash partition

457

Challenge

06 User Space, Virtual Network Computing


Section User Space Virtual Network Computing
Instruction
Enable Virtual Network Computing server from Ubilinux under uSD, access
Intel Edison from your Development Host using Virtual Network Computing
client

07 User Space, Services


Section User Space Services
Instruction
Configure SystemD to run your script EmbeddedLinux/main.py on startup

08 Libraries, Temboo
Section Libraries Temboo
Instruction
Implement 1 CHOREOS under EmbeddedLinux/main.py

09 Subsystems, LED
Section Subsystems LED
Instruction
Enable under your Yocto Board Support Package Compilation the macros
LEDS_TRIGGERS and LEDS_TRIGGER_HEARTBEAT so you can control a
Led from the Grove Indoor Environment Kit attached to one of the GPIOs

10 Application Development, Bots,


458

Challenge

Telegram Bot
Section Application Development Bots
Instruction
Create a new Bot and implement under your script EmbeddedLinux/main.py 2
commands, to report data from functionDataSensor and to execute the action
under functionDataActuator from any Telegram client

11 Application Development, Artificial


Intelligence, Wit.Ai
Section Application Development Artificial Intelligence Wit.Ai
Instruction
Implement under your script EmbeddedLinux/main.py 2 commands, to report
data from functionDataSensor and to execute the action under
functionDataActuator from from the Wit.Ai bot

12 Software Version Control System


Pushing Code
Section Software Version Control System
Instruction
Confirm every code under your local "TheIoTLearningInitiative" git repository,
"EmbeddedLinux" directory is uploaded to your remote
"TheIoTLearningInitiative" github repository
ToDo Diretory Structure

459

SandBox

SandBox
http://www.kdnuggets.com/2015/05/r-vs-python-data-science.html
https://community.arm.com/groups/processors/blog/2016/06/27/isc16-recapfujitsu-takes-the-stage?
utm_source=SocialMedia&utm_medium=Organic&utm_campaign=Enterpise

ToDo
ToDo Important Topics To Cover
Example Project
Adding Recipes to the Build System
Adding New Recipes to the Build System
Build an Example Package based on a Git Repository Commit
Build an example package based on a Remote Source Archive
Build an example package based on a Local Source Archive
ToDo Explain Linux Kernel Version, do we have this under Operating System?,
Explain how we give support ot Linux Kernel

Kernel Interfaces
SFI Simple Firmware Interface
How does SFI relate to ACPI? While some modern platforms can used SFI
instead of using ACPI, SFI is not intended to replace ACPI on general
purpose systems. If a platform were to export both SFI and ACPI booted an
OS that also supports both, the OS should use the platform's ACPI support
and ignore SFI.

460

SandBox

User Linux Next


git clone git://git.kernel.org/pub/scm/linux/kernel/git/next
/linux-next.git
v4.1-rc6 tag, mrproper'd and rebuilt,

Links
http://www.h-online.com/open/news/item/Intel-develops-simpler-alternative-toACPI-for-Linux-742161.html
https://en.wikipedia.org/wiki/Simple_Firmware_Interface
https://simplefirmware.org/
https://www.kernel.org/doc/ols/2009/ols2009-pages-55-60.pdf
https://lwn.net/Articles/406228/
https://simplefirmware.org/faq
http://geektimes.ru/post/255136/
https://communities.intel.com/message/273743
https://edison.internet-share.com/w/index.php?
title=Using_a_stock_Linux_kernel_with_Intel_Edison&redirect=no

Blkuetooth
Links
Intel Edison Boards Bluetooth User Guide
http://alextgalileo.altervista.org/blog/install-kernel-from-repo-onto-edisonofficial-image/
https://software.intel.com/en-us/articles/intel-edison-board-getting-startedwith-bluetooth
http://rexstjohn.com/lets-turn-intel-edison-into-an-ibeacon/
http://unix.stackexchange.com/questions/53546/debian-squeeze-connect-toa2dp-bluetooth-through-command-line
https://software.intel.com/en-us/articles/using-the-generic-attribute-profilegatt-in-bluetooth-low-energy-with-your-intel-edison
https://software.intel.com/en-us/articles/connecting-the-intel-edison-board-to-

461

SandBox
your-android-phone-with-serial-port-profile-spp
Profiles
https://learn.sparkfun.com/tutorials/bluetooth-basics
PyBluez API Ddoc
PIP package manager
http://shawnhymel.com/665/using-python-and-ble-to-receive-data-from-therfduino/
http://shawnhymel.com/703/bluetooth-low-energy-peripherals-with-javascript/
http://stephaniemoyerman.com/?p=100
https://github.com/w4ilun/edison-guides/wiki/Configure-Intel-Edison-for-BLE--Bluetooth-Smart-Development
https://software.intel.com/en-us/articles/connecting-to-intel-edison-fromandroid-with-bluetooth-le-ble
http://stephaniemoyerman.com/?p=100
https://software.intel.com/en-us/articles/connecting-the-intel-edison-board-toyour-android-phone-with-serial-port-profile-spp
https://github.com/smoyerman/edison-ibeacon

SandBox
Intel Edison to a Bluetooth Network
Intel Edison from a peer device
Raspberry Pi & Bluetooth LE part 1 with Tony D! @adafruit #LIVE
Bluetooth on the Intel Edison
root@edison:~# rfcomm bind - 40:78:6A:26:4A:C2 1
root@edison:~# ls /dev/rfcomm0

PCI

Links
https://communities.intel.com/thread/61150?wapkw=intel+edison+mpcie
https://communities.intel.com/thread/89971?start=0&tstart=0

462

SandBox
https://www.aisler.net/projects/7252
http://pinball-mods.com/blogs/?p=580
https://hackaday.io/project/4571-intel-edison-usb-storage-sled
https://wiki.archlinux.org/index.php/Huawei_E220
https://techship.se/products/mpcie-usb-adapt-9-pin/
https://techship.se/products/pci-express-mini-card-to-usb-adapter/
https://techship.se/products/pci-express-mini-card-to-usb-adapter-withexternal-voltage/
http://www.amazon.com/Mini-PCIe-mSATA-Micro-Adapter/dp/B00KZIANT0
http://www.newegg.com/Product/Product.aspx?Item=N82E16815158354

Modems
https://boundarydevices.com/cellular-modems-on-i-mx6-boards/
https://answers.launchpad.net/ubuntu/+source/gnomenettool/+question/211095
http://www.monblocnotes.com/node/1943
http://www.paoli.cz/en/lte-modules-1/huawei-me909u-521-mini-pcie.html?
cur=1&lang=1&&redirected=1
http://www.paoli.cz/out/media/Guide_to_Kernel_Driver_Integration_in_Linux_f
or_Huawei_Modules(1).pdf

Compilation
Others
root@edison:~# journalctl
root@edison:~# cat /etc/modprobe.d/bcm4334x.conf
options bcm4334x firmware_path=/etc/firmware/fw_bcmdhd.bin n
vram_path=/etc/firmware/bcmdhd.cal op_mode=4
root@edison:~# cat /etc/modprobe.d/g_multi.conf
options g_multi file=/dev/mmcblk0p9 stall=0 idVendor=0x8087
idProduct=0x0A9E iProduct=Edison iManufacturer=Intel

463

SandBox

Links
Intel Edison Native Application Guide
http://dev.ardupilot.com/wiki/edison-for-drones/
https://github.com/catmaker/chippy
https://github.com/MakersTeam/Edison
https://github.com/tokoro10g/galileo-makefile
https://software.intel.com/en-us/articles/opencv-300-ipp-tbb-enabled-onyocto-with-intel-edison
http://flask.pocoo.org/

Audio
Links
http://repo.opkg.net/edison/repo/edison/kernel-module-snd-usbaudio_3.10.17+git0+6ad20f049a_c03195ed6e-r0_edison.ipk
http://www.tektyte.com/docs/docpages/edison-reference/ALSA.html
http://blog.niise.idv.tw/2015/01/intel-edison-mini-breakout-board-w-mpd.html?
m=1
http://hackaday.com/2015/12/02/audio-effects-on-the-intel-edison/

Tbd
sh sudo modprobe -v snd_usb_audio sudo modprobe --force-vermagic
snd-usb-audio.ko sudo depmod -a sudo alsactl init sudo alsa-utils
stop/start sudo dpkg-reconfigure alsa-base cat /dev/sndstat cat
/proc/asound/cards sh

Links
Under investigation?

464

SandBox

- What is it create-debian-image.sh
user@host:~$ edison-src/meta-intel-edison/utils

https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-onyocto-with-intel-edison
http://download.intel.com/support/edison/sb/edisonbsp_ug_331188007.pdf
https://hayestech.files.wordpress.com/2015/01/intel-edison-bsd.pdf
http://www.instructables.com/id/Securing-IoT-applications-built-on-IntelGalileo-a/
http://www.embarcados.com.br/intel-edison-yocto-como-construir-suapropria-distribuicao-linux-embarcado/
http://www.embarcados.com.br/raspberry-pi-qt5-yocto-parte-1/
https://communities.intel.com/docs/DOC-23391
https://software.intel.com/en-us/articles/intel-edison-developer-resources
http://download.intel.com/support/edison/sb/edisonbsp_ug_331188007.pdf
http://drejkim.com/blog/2014/11/22/building-an-edison-image-and-changingthe-root-partition-size/
https://hayestech.wordpress.com/2015/01/26/building-custom-intel-edisonimages/ http://www.yoctoproject.org/docs/1.1/yocto-project-qs/yocto-projectqs.html http://edplay.weebly.com/how-to/building-linux-for-intel-edison
https://wiki.debian.org/EmDebian/CrossDebootstrap
https://communities.intel.com/message/273743
http://layers.openembedded.org/layerindex/branch/master/layer/meta-inteledison-bsp/
http://shawnhymel.com/724/creating-a-custom-linux-kernel-for-the-edisonyocto-2-1/
http://events.linuxfoundation.org/sites/events/files/slides/LinuxCon2015_meta
-debian_r7.pdf
user@host:~$ tar xvf edison-src-weekly-68.tgz
user@host:~$ ls edison-src
arduino broadcom_cws device-software mw

user@host:~$ ./device-software/setup.sh
File name: edison-src-weekly-68.tgz @

465

SandBox
https://downloadcenter.intel.com/download/24357
https://scratchbuffer.wordpress.com/2015/09/01/yocto-linux-image-build-forintel-edison-simple-and-easy/
https://wiki.lsr.ei.tum.de/nst/documentation/inteledison
https://hayestech.wordpress.com/2015/01/26/building-custom-intel-edisonimages/
https://github.com/waf-project/waf

Tbd
user@host:~$ cd edison-src/meta-intel-edison/
user@host:~$ git clone https://github.com/openembedded/meta-open
embedded.git
user@host:~$ cd meta-openembedded/
user@host:~$ git checkout fido
user@host:~$ cd ../../
user@host:~$ nano out/current/build/conf/bblayers.conf
/home/xe1gyq/Projects/edison-src/meta-intel-edison/meta-openembe
dded \
user@host:~$ nano meta-intel-edison/meta-intel-edison-distro/rec
ipes-core/images/edison-image.bb
IMAGE_INSTALL += opencv
PACKAGECONFIG_pn-opencv="eigen jpeg libav png tiff v4l
user@host:~$ cd out/current
user@host:~$ source poky/oe-init-build-env
user@host:~$ bitbake edison-image

466

You might also like