SlideShare a Scribd company logo
Hacktime for ADK
SeongJae Park <sj38.park@gmail.com>
Great to meet you
SeongJae Park <sj38.park@gmail.com>
A member of GDG Suwon
Newbie to Arduino
Let's enjoy hacking
Just do it - 1:Let's hack Arduino
Download and install IDE, Arduino 1.0
If Mac, install FTDI USB driver(Link)
Just do it - 1:How to hack Arduino
Let's blink led on Arduino board
Just do it - 1:How to hack Arduino
Let's blink led on breadboard
Just do it - 1:How to hack Arduino
Let's blink led on breadboard
Just do it - 1:How to hack Arduino
5V
Ground 300 Ohm
LED
Ground
300 Ohm
5V
Background & Concepts
Android accessories
Background & Concepts
Android accessories
Background & Concepts
● No standard protocol / API
● Only selected devices
● Only selected developers
● Android Open Accessory(AOA) support
○ From 3.1, Back-ported to 2.3.4
○ USB api
○ AOA protocol
○ ADK
Background & Concepts
● Android Open Accessory(AOA) support
○ Standard
○ Any developer can develop
○ Works on every AOA supporting Android device
Background & Concepts
● AOA 2.0 protocol & ADK 2012
○ Announced from Google IO 2012
○ Connection via Bluetooth
○ Audio output
○ HID accessory support
○ From JellyBean(4.1)
Background & Concepts
AOA support structure overview
AOA protocol USB api
Application
AOA protocol
Is in accessory mode?
(show vendor id, product id)
Support AOA?
(GET_PROTOCOL)
Start accessory mode
(ACCESSORY_START)
Establish connection
Bad
ending
:'(
YES
NO
YES
NO
USB API
App can communicate with USB devices
● Host mode
○ From 3.1
● Accessory mode
○ Back ported to 2.3.4(Google APIs add-on library)
USB API
● Notify connected device using intent
● Can enumerates connected devices
● Request permission to user
● Can interact using I/O Stream like file
ADK - components
● Sample USB api using application(DemoKit)
● Sample sketch for ADK using AOA(demokit)
● AOA protocol implementation library
● Arduino-USB control library
● ADK H/W design
ADK - impl of AOA protocol
AndroidAccessory class
ADK - impl of AOA protocol
isConnected : start point
ADK - impl of AOA protocol
Is in accessory mode?
ADK - impl of AOA protocol
Do you support AOA?
ADK - impl of AOA protocol
I am...; Start accessory mode.
Establish connection
Find end points, set configuration 1
ADK - impl of AOA protocol
End points usage
Sample sketch using ADK
adkminihack
Sample sketch using ADK
New AndroidAccessory
Sample sketch using ADK
init and power on
Sample sketch using ADK
Connect, listen, echo
Sample app using USB api
ADKMiniHack
Sample app using USB api
Feature, Library, Intent filter
Sample app using USB api
accessory_filter.xml
Sample app using USB api
● "com.android.future.usb" for gingerbread
● "android.hardware.usb" for only 3.1 or upper
Sample app using USB api
Get UsbManager and Enumerate accessories
Request Permission
Sample app using USB api
Open accessory
Sample app using USB api
File-like interface
Sample app using USB api
Listening, too.
Sample app using USB api
Clean up when accessory detached.
Sample source codes
● Downloadable from github
Just do it - 2. Let's make simple AOA
Just do it - 2. Let's make simple AOA
ADK Install
● Download ADK and extract
Just do it - 2. Let's make simple AOA
ADK Install
On Windows:
1. Copy the arduino_libs/AndroidAccessory and
arduino_libs/USB_Host_Shield directories (the
complete directories, not just the files within) to the
<arduino_installation_root>/libraries/
directory.
Just do it - 2. Let's make simple AOA
ADK Install
On Mac:
1. Create, if it does not already exist, an Arduino directory
inside your user account's Documents directory, and
within that, a libraries directory.
2. Copy the arduino_libs/AndroidAccessory and
arduino_libs/USB_Host_Shield directories (the
complete directories, not just the files within) to your
Documents/Arduino/libraries/ directory.
Just do it - 2. Let's make simple AOA
ADK Install
On Linux (Ubuntu):
1. Copy the firmware/arduino_libs/AndroidAccessory
and
firmware/arduino_libs/USB_Host_Shielddirectories
(the complete directories, not just the files within) to
the<arduino_installation_root>/libraries/
directory.
2. Install the avr-libc library by entering sudo apt-get
install avr-libc from a shell prompt.
Just do it - 2. Let's make simple AOA
To debug Arduino
1. Serial.begin(<baud-rate>)
2. Serial.println("This is debug message.")
Just do it - 2. Let's make simple AOA
To debug Android device without USB
1. $ adb tcpip 5555
2. $ adb connect <device-ip>:5555
3. $ adb logcat
4. $ adb usb
But, looks doesn't works well...
Just do it - 2. Let's make simple AOA
● For IP Confirm,
○ Wifi settings > Option menu > Advanced
Just do it - 2. Let's make simple AOA
● example code
○ example/ADKMiniHack
■ Change project build target to Google APIs 10
○ example/Sketch
Just do it - 2. Let's make simple AOA
● OSCOKIRQ failed to assert
○ Problem occurs from ADK USB library's Max3421e.
○ Below is workaround for this from discussion
Let the hacking begin
: Suggested misson
● Clavier that Input from phone screen, Output
to Arduino
○ Turn on/off LED for each keys
○ Blink RGB led for each keys
○ Turn off when it's too dark(night)
○ Make tones higher with analog dialer
Let the hacking begin
: Sample
This work by SeongJae Park is licensed under the
Creative Commons Attribution-ShareAlike 3.0 Unported
License. To view a copy of this license, visit http:
//creativecommons.org/licenses/by-sa/3.0/.

More Related Content

PPSX
Controlling and monitoring external embedded device using android frameworks ...
PPT
Development, debug and deploy hardware/software solutions based on Android an...
PDF
Leveraging the Android Open Accessory Protocol
PPTX
Android Open Accessory APIs
PDF
Android Open Accessory Protocol - Turn Your Linux machine as ADK
PDF
Go Green - Save Power
PDF
Android + arduino = love @ Droidcon Bucharest 2012
PDF
Connecting outsideworld with Android and Arduino
Controlling and monitoring external embedded device using android frameworks ...
Development, debug and deploy hardware/software solutions based on Android an...
Leveraging the Android Open Accessory Protocol
Android Open Accessory APIs
Android Open Accessory Protocol - Turn Your Linux machine as ADK
Go Green - Save Power
Android + arduino = love @ Droidcon Bucharest 2012
Connecting outsideworld with Android and Arduino

What's hot (20)

KEY
I/O 2011 報告会 ADKで遊んでみた
PPTX
Controlling an Arduino with Android
PPTX
Introduction to Arduino
PDF
Connecting Arduino and Android
PDF
IoTino - Arduino for Internet of Things
PPTX
Arduino day
DOCX
PPTX
PPTX
Arduino Programming Software Development
PPTX
Android meets Arduino
PPTX
PPTX
Introduction to Internet of Things Hardware
PDF
Introducing the Arduino
PPTX
Developing a NodeBot using Intel XDK IoT Edition
PDF
lesson1 - Getting Started with ESP8266
PDF
MicroEJ OS for IoT devices
PDF
Edje Project: The Software Foundation for IoT Devices
PDF
Introduction of Arduino Uno
PPTX
My arduino presentation
PDF
Internet of things and arduino
I/O 2011 報告会 ADKで遊んでみた
Controlling an Arduino with Android
Introduction to Arduino
Connecting Arduino and Android
IoTino - Arduino for Internet of Things
Arduino day
Arduino Programming Software Development
Android meets Arduino
Introduction to Internet of Things Hardware
Introducing the Arduino
Developing a NodeBot using Intel XDK IoT Edition
lesson1 - Getting Started with ESP8266
MicroEJ OS for IoT devices
Edje Project: The Software Foundation for IoT Devices
Introduction of Arduino Uno
My arduino presentation
Internet of things and arduino

Similar to Hacktime for adk (20)

PDF
From Arduino to ADK
PDF
Arduino Development For Beginners
PDF
Smart Projects With Arduino And Esp32 Integrating Artificial Intelligence Abd...
PPTX
pcDuino Presentation at SparkFun
PDF
Smartphone++
PPTX
Up and running with Arduino
PPTX
Arduino : how to get started
PDF
Let's begin io t with $10
DOCX
notes about Arduino
PPTX
Lab Handson: Power your Creations with Intel Edison!
PPTX
Getting started with Intel IoT Developer Kit
PPTX
Arduino1.0 RC
PPT
PPTX
Kotlin Basics & Introduction to Jetpack Compose.pptx
PPTX
DSC Android Study Jam
PDF
PPTX
ESP8266 Wifi Nodemcu
PPTX
Android Study Jams - Session 1
PPTX
Wi-Fi Esp8266 nodemcu
PPT
Intro to Arduino
From Arduino to ADK
Arduino Development For Beginners
Smart Projects With Arduino And Esp32 Integrating Artificial Intelligence Abd...
pcDuino Presentation at SparkFun
Smartphone++
Up and running with Arduino
Arduino : how to get started
Let's begin io t with $10
notes about Arduino
Lab Handson: Power your Creations with Intel Edison!
Getting started with Intel IoT Developer Kit
Arduino1.0 RC
Kotlin Basics & Introduction to Jetpack Compose.pptx
DSC Android Study Jam
ESP8266 Wifi Nodemcu
Android Study Jams - Session 1
Wi-Fi Esp8266 nodemcu
Intro to Arduino

More from SeongJae Park (20)

PDF
Biscuit: an operating system written in go
PDF
GCMA: Guaranteed Contiguous Memory Allocator
PDF
Linux Kernel Memory Model
PDF
An Introduction to the Formalised Memory Model for Linux Kernel
PDF
Design choices of golang for high scalability
PDF
Brief introduction to kselftest
PDF
Understanding of linux kernel memory model
PDF
Let the contribution begin (EST futures)
PDF
Porting golang development environment developed with golang
PDF
gcma: guaranteed contiguous memory allocator
PDF
An introduction to_golang.avi
PDF
Develop Android/iOS app using golang
PDF
Develop Android app using Golang
PDF
Sw install with_without_docker
PDF
Git inter-snapshot public
PDF
(Live) build and run golang web server on android.avi
PDF
Deep dark-side of git: How git works internally
PDF
Deep dark side of git - prologue
PDF
DO YOU WANT TO USE A VCS
PDF
Experimental android hacking using reflection
Biscuit: an operating system written in go
GCMA: Guaranteed Contiguous Memory Allocator
Linux Kernel Memory Model
An Introduction to the Formalised Memory Model for Linux Kernel
Design choices of golang for high scalability
Brief introduction to kselftest
Understanding of linux kernel memory model
Let the contribution begin (EST futures)
Porting golang development environment developed with golang
gcma: guaranteed contiguous memory allocator
An introduction to_golang.avi
Develop Android/iOS app using golang
Develop Android app using Golang
Sw install with_without_docker
Git inter-snapshot public
(Live) build and run golang web server on android.avi
Deep dark-side of git: How git works internally
Deep dark side of git - prologue
DO YOU WANT TO USE A VCS
Experimental android hacking using reflection

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
A Presentation on Artificial Intelligence
PPTX
Tartificialntelligence_presentation.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Mushroom cultivation and it's methods.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
August Patch Tuesday
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Unlocking AI with Model Context Protocol (MCP)
Enhancing emotion recognition model for a student engagement use case through...
A Presentation on Artificial Intelligence
Tartificialntelligence_presentation.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Mushroom cultivation and it's methods.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
A novel scalable deep ensemble learning framework for big data classification...
August Patch Tuesday
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
A comparative study of natural language inference in Swahili using monolingua...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 5: Probability Theory and Statistics
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
1. Introduction to Computer Programming.pptx
Digital-Transformation-Roadmap-for-Companies.pptx

Hacktime for adk

  • 1. Hacktime for ADK SeongJae Park <sj38.park@gmail.com>
  • 2. Great to meet you SeongJae Park <sj38.park@gmail.com> A member of GDG Suwon Newbie to Arduino Let's enjoy hacking
  • 3. Just do it - 1:Let's hack Arduino Download and install IDE, Arduino 1.0 If Mac, install FTDI USB driver(Link)
  • 4. Just do it - 1:How to hack Arduino Let's blink led on Arduino board
  • 5. Just do it - 1:How to hack Arduino Let's blink led on breadboard
  • 6. Just do it - 1:How to hack Arduino Let's blink led on breadboard
  • 7. Just do it - 1:How to hack Arduino 5V Ground 300 Ohm LED Ground 300 Ohm 5V
  • 10. Background & Concepts ● No standard protocol / API ● Only selected devices ● Only selected developers
  • 11. ● Android Open Accessory(AOA) support ○ From 3.1, Back-ported to 2.3.4 ○ USB api ○ AOA protocol ○ ADK Background & Concepts
  • 12. ● Android Open Accessory(AOA) support ○ Standard ○ Any developer can develop ○ Works on every AOA supporting Android device Background & Concepts
  • 13. ● AOA 2.0 protocol & ADK 2012 ○ Announced from Google IO 2012 ○ Connection via Bluetooth ○ Audio output ○ HID accessory support ○ From JellyBean(4.1) Background & Concepts
  • 14. AOA support structure overview AOA protocol USB api Application
  • 15. AOA protocol Is in accessory mode? (show vendor id, product id) Support AOA? (GET_PROTOCOL) Start accessory mode (ACCESSORY_START) Establish connection Bad ending :'( YES NO YES NO
  • 16. USB API App can communicate with USB devices ● Host mode ○ From 3.1 ● Accessory mode ○ Back ported to 2.3.4(Google APIs add-on library)
  • 17. USB API ● Notify connected device using intent ● Can enumerates connected devices ● Request permission to user ● Can interact using I/O Stream like file
  • 18. ADK - components ● Sample USB api using application(DemoKit) ● Sample sketch for ADK using AOA(demokit) ● AOA protocol implementation library ● Arduino-USB control library ● ADK H/W design
  • 19. ADK - impl of AOA protocol AndroidAccessory class
  • 20. ADK - impl of AOA protocol isConnected : start point
  • 21. ADK - impl of AOA protocol Is in accessory mode?
  • 22. ADK - impl of AOA protocol Do you support AOA?
  • 23. ADK - impl of AOA protocol I am...; Start accessory mode.
  • 24. Establish connection Find end points, set configuration 1
  • 25. ADK - impl of AOA protocol End points usage
  • 26. Sample sketch using ADK adkminihack
  • 27. Sample sketch using ADK New AndroidAccessory
  • 28. Sample sketch using ADK init and power on
  • 29. Sample sketch using ADK Connect, listen, echo
  • 30. Sample app using USB api ADKMiniHack
  • 31. Sample app using USB api Feature, Library, Intent filter
  • 32. Sample app using USB api accessory_filter.xml
  • 33. Sample app using USB api ● "com.android.future.usb" for gingerbread ● "android.hardware.usb" for only 3.1 or upper
  • 34. Sample app using USB api Get UsbManager and Enumerate accessories Request Permission
  • 35. Sample app using USB api Open accessory
  • 36. Sample app using USB api File-like interface
  • 37. Sample app using USB api Listening, too.
  • 38. Sample app using USB api Clean up when accessory detached.
  • 39. Sample source codes ● Downloadable from github
  • 40. Just do it - 2. Let's make simple AOA
  • 41. Just do it - 2. Let's make simple AOA ADK Install ● Download ADK and extract
  • 42. Just do it - 2. Let's make simple AOA ADK Install On Windows: 1. Copy the arduino_libs/AndroidAccessory and arduino_libs/USB_Host_Shield directories (the complete directories, not just the files within) to the <arduino_installation_root>/libraries/ directory.
  • 43. Just do it - 2. Let's make simple AOA ADK Install On Mac: 1. Create, if it does not already exist, an Arduino directory inside your user account's Documents directory, and within that, a libraries directory. 2. Copy the arduino_libs/AndroidAccessory and arduino_libs/USB_Host_Shield directories (the complete directories, not just the files within) to your Documents/Arduino/libraries/ directory.
  • 44. Just do it - 2. Let's make simple AOA ADK Install On Linux (Ubuntu): 1. Copy the firmware/arduino_libs/AndroidAccessory and firmware/arduino_libs/USB_Host_Shielddirectories (the complete directories, not just the files within) to the<arduino_installation_root>/libraries/ directory. 2. Install the avr-libc library by entering sudo apt-get install avr-libc from a shell prompt.
  • 45. Just do it - 2. Let's make simple AOA To debug Arduino 1. Serial.begin(<baud-rate>) 2. Serial.println("This is debug message.")
  • 46. Just do it - 2. Let's make simple AOA To debug Android device without USB 1. $ adb tcpip 5555 2. $ adb connect <device-ip>:5555 3. $ adb logcat 4. $ adb usb But, looks doesn't works well...
  • 47. Just do it - 2. Let's make simple AOA ● For IP Confirm, ○ Wifi settings > Option menu > Advanced
  • 48. Just do it - 2. Let's make simple AOA ● example code ○ example/ADKMiniHack ■ Change project build target to Google APIs 10 ○ example/Sketch
  • 49. Just do it - 2. Let's make simple AOA ● OSCOKIRQ failed to assert ○ Problem occurs from ADK USB library's Max3421e. ○ Below is workaround for this from discussion
  • 50. Let the hacking begin : Suggested misson ● Clavier that Input from phone screen, Output to Arduino ○ Turn on/off LED for each keys ○ Blink RGB led for each keys ○ Turn off when it's too dark(night) ○ Make tones higher with analog dialer
  • 51. Let the hacking begin : Sample
  • 52. This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http: //creativecommons.org/licenses/by-sa/3.0/.