2. Outline
2
I. Context
II. Problem statement
III. The Brillo & Weave solution
IV. Brillo Hello World
V. Brillo Starter Boards from Intel
VI. Next steps
5. • Embedded OS
• Core services
• Developer kit
What is Brillo?
Source: Google
6. • Open Source
• Maintained
• Supports devices with a small footprint
• Customizable
Hardware
Linux Kernel
Android HAL
Device
Admin
System
Services
OTA
updates
…Connectivity
The Brillo Operating System
Source: Google
7. • Weave
• Metrics
• Crash reporting
• OTAs
The Brillo Core Services
Source: Google
8. • Based on the Android.mk architecture
• Standard testing
• Android debug bridge (adb)
The Brillo Developer Kit
Source: Google
9. • Protocol for device discovery, provisioning,
authentication, and interaction
• Schema Driven (JSON)
• OAuth 2.0 Authentication
Weave
Source: Google
13. • View Device Status
• Rename Devices
• Share Devices with apps, friends
• Send commands to Devices
Graphic Source: Google
Google Cloud Administration
Source: Google
14. Connect to the Brillo’s WiFi AP via a Mobile Device
Provide information to the Device:
• OAuth* 2.0 identity
• WiFI Access Point
• PIN Code
Device contacts the Cloud
− Downloads updates
The Device is Ready
Registering (provisioning) a Brillo device
15. Brillo Yocto
Kernel Linux Linux
libc bionic eglibc
Init init.rc init.d
IPC Mechanism Binder D-BUS, Linux IPC
Build system Android.mk BitBake
Compatibility with Android
Source Packages
Yes No
Open Source Yes (AOSP) Yes (github)
Brillo vs Yocto
16. • Download the BDK
• Build a product
• Flash the device
• Execute.... and watch the blinky lights
Brillo Hello World
https://codelabs.developers.google.com/codelabs/brillo-hello-leds-edison
17. $ TOP=/build
$ export BDK_PATH=$TOP/bdk
$ cd $TOP
$ curl https://dl.google.com/dl/brillo/bdk/latest/bdk-latest.tar.gz
$ tar xf bdk-latest.tar.gz
$ cd $TOP/bdk
$ tools/bdk/brunch/brunch bsp download edison
$ mkdir $TOP/products && cd $TOP/products
$ ${BDK_PATH}/tools/bdk/brunch/brunch product create helloLEDs
edison
$ cd $TOP/products/helloLEDs
$ echo hello_led_service >> config/packages
$ cd $TOP/products/helloLEDs/src
$ mkdir hello_led_service
Project setup
18. hello_led_service/hello_led_service.cpp
#include <unistd.h>
#include <stdio.h>
#include <mraa.h>
int main(__unused int argc, __unused char* argv[]) {
const unsigned gpio[] = {0, 1, 2};
const int gpio_count = sizeof(gpio)/sizeof(*gpio);
mraa_gpio_context m_gpio[] = {NULL, NULL, NULL};
mraa_init();
for (int i = 0; i < gpio_count; i++) {
m_gpio[i] = mraa_gpio_init(gpio[i]);
if (!m_gpio[i])
return 1;
mraa_gpio_dir(m_gpio[i], MRAA_GPIO_OUT);
}
for (int iterations=0; iterations < 3; iterations++)
{
for (int i = 0; i < gpio_count; i++) {
mraa_gpio_write(m_gpio[i], 1);
sleep(1);
}
for (int i = gpio_count-1; i >= 0; i--) {
mraa_gpio_write(m_gpio[i], 0);
sleep(1);
}
}
for (int i = 0; i < gpio_count; i++)
mraa_gpio_close(m_gpio[i]);
return 0;
}
Write your App, Build and Flash
19. hello_led_service/Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello_led_service
LOCAL_SRC_FILES := hello_led_service.cpp
LOCAL_SHARED_LIBRARIES := libc libbase libmraa
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE)
$ cd ~/products/helloLEDs
$ source envsetup.sh
$ m –j 20
$ provision
$ adb shell hello_led_service
$ du -s -h .
13G .
$
Write your App, Build and Flash
20. $ cd src/hello_led_service/
$ touch hello_led_service.cpp
$ mm -j20
Building submodule only . . .
Output will be placed in /spare/PROD/helloLEDs/out
...
[ 14% 1/7] target C++: hello_led_service <= /spare/PROD/helloLEDs/src/hello_led_service/hello_led_service.cpp
...
#### make completed successfully (1 seconds) ####
$ adb root
restarting adbd as root
$ adb remount
remount succeeded
$ adb sync
/system/: 1 file pushed. 706 files skipped. 0.0 MB/s (5516 bytes in 0.225s)K
/data/: 0 files pushed. 7 files skipped.
$ adb shell hello_led_service
$
Time Saver – Submodule Build and “adb sync”
22. The Intel® Edison Kit for Brillo
• The Intel® Edison kit with the Arduino
Expansion Board was the first Brillo Starter
Board
• Intel is providing the board support package
• MANY sensors and devices are available for
prototyping with this board
• Brillo Starter Board
• Supported in AOSP since Nov ‘15.
23. Intel® Edison Board for SparkFun
Compare to the Intel® Edison kit with Arduino:
• Same Edison CPU Module
• Simpler GPIO/Bus structure
• Stack on boards
• Smaller form factor
• Battery power available
• Many sensors available
• Brillo Starter Board
• Supported in AOSP since February
24. Intel® Expansion Kit with MinnowBoard
• Similar Bus availability to Intel® Edison kits
• More powerful processor, Graphics and GPU enabled
• Larger RAM
• Additional storage options
• Add “lures” to expand to additional busses, sensors
• Brillo Starter Board
• Supported in AOSP since February
25. Next Steps
Likely futures for Brillo:
• Camera Support
• Display via Surface Flinger
• Bluetooth*
• Other connectivity options
Intel Exploring:
• JavaScript
• Node.js
• NW.js (for display)