• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
In touch with smart devices
 

In touch with smart devices

on

  • 692 views

 

Statistics

Views

Total Views
692
Views on SlideShare
622
Embed Views
70

Actions

Likes
0
Downloads
9
Comments
0

1 Embed 70

http://de.droidcon.com 70

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    In touch with smart devices In touch with smart devices Presentation Transcript

    • In Touch with Smart DevicesThe future is connected.Masanori FujitaZühlke Engineering GmbH Slide 1 March 2012 Masanori Fujita © Zühlke 2012
    • What about Android@Home? • Android@Home announced at Google I/O in May 2011 • Vision: “think of your entire home as an accessory” – Control lighting – Collect sensor data – Play media • new wireless protocol to communicate with accessories • so far, no updates on thisIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 2 © Zühlke 2012
    • • Lighting• Heating system• Washing Machine• Dish washer• Weather sensors• Door bell• Audio & Video
    • Supported interfaces types GSM/3G USB WiFi NFC BluetoothIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 4 © Zühlke 2012
    • Traditional Roles Accessory Master Device Accessory • PCs • Input Devices • Mass Storage • Printer • Camera • MP3 Players • SmartphonesIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 6 © Zühlke 2012
    • New Roles Accessory Master Device Accessory • PCs • Input Devices • Smartphones • Mass Storage • Printer • Camera • MP3 Players • SmartphonesIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 7 © Zühlke 2012
    • USB Host Mode • USB host is required to provide 500mA current • USB On-the-Go is used to act as limited USB host • USB Host Mode is optional Accessory AccessoryIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 8 © Zühlke 2012
    • Open AccessoryDevelopment Kit USB Host USB Slave
    • Android PhoneDev. Machine
    • ADK Initialization Process Wait for Android Request USB device to connect device descriptor Accessory Power On Android device connected Request accessory support Android Device Send no OEM’s vendor and product ID Wait for accessory to connect Power On Device in accessory mode? Send yes Google’s vendor and product IDIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 11 © Zühlke 2012
    • Android: Many form-factors Samsung Galaxy S II HTC Velocity 4G Motorola Pro+In Touch with Smart Devices | Masanori Fujita March 2012 Slide 12 © Zühlke 2012
    • USB Support in Android Oct-11 4.0 Feb-11 May-11 Jul-11 3.0 3.1 3.2 Oct 09 Jan 10 May 10 Dec-10 2.0 2.1 2.2 2.3 Sep-08 Feb-09 Apr 09 Sep-09 1.0 1.1 1.5 1.6 Sep 2008 Mar 2012 ADK (since 3.1 + 2.3.4) USB Host Mode (since 3.1)In Touch with Smart Devices | Masanori Fujita March 2012 Slide 13 © Zühlke 2012
    • • Reliable and high speed connection• Easy handling for user and developer• Power supply and form- factors might be an issue for accessory designers
    • Which Bluetooth profiles does your phonesupport? SPP HDP DUN SIM HID FAX HFP OPP OPP HSPIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 16 © Zühlke 2012
    • The built-in Bluetooth Stack Android API Socket (android.bluetooth.*) Serial Port Profile (SPP) Virtual serial port Service Discovery RFCOMM Protocol L2CAP Link Manager Layer Bluetooth Baseband Controller Radio LayerIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 17 © Zühlke 2012
    • What the API offers…• Scan for devices• Listen for incoming RFCOMM connections• Establish RFCOMM connections• Communicate with HFP, HSP, HDP, A2DP devices• Implement new Bluetooth profilesIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 18 © Zühlke 2012
    • Not all profiles use RFCOMMExample: HID Human Interface Device Profile Service Discovery Protocol L2CAP Link Manager Layer Bluetooth Baseband Controller Radio LayerIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 19 © Zühlke 2012
    • You should only rely on serialcommunication, unless…• you can implement a profile in Java that solely builds upon RFCOMM and SDP.• you have a defined set of target devices – accessing the native BT driver – create native extensions – add profiles to API – compile custom ROM• Google defines other profiles to be mandatory for Android devices and offer them as APIIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 20 © Zühlke 2012
    • • Supported by most devices• Handling might be tricky for user• Only serial communication is guaranteed
    • Borrowed from nfc-forum.org
    • Reading and writing tags• Support for different types of tags – NFC Forum Type 1-4 – Mifare *• API features – Reacting on tag discovery – Reading and writing passive tag with serial NDEF messages passive number, deployment – Sector level I/O access date, date of last inspection etc. active Card emulation providing live status information, allow device settingsIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 24 © Zühlke 2012
    • Beaming to and from your smart device• Android Beam™ is technically an NDEF push in peer-to-peer mode – Google’s own NDEF Push Protocol (NPP) – NFC Forum’s new Simple NDEF Exchange Protocol (SNEP)• No bi-directional data exchange using lower layers active Realtime status information, allow device settingsIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 25 © Zühlke 2012
    • Android as a Card• Card emulation is not exposed in Android API• Would add many valuable scenarios• Also consider discussion around secure elements – in a SIM card – embedded in a chip – on stickersIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 26 © Zühlke 2012
    • • Future Android devices will probably have support for NFC• Easy handling for user and developer• Need to find workaround for missing card emulation mode
    • What is the best way to connect to yourdevices and accessories? Which UX do you desire? ? What about security? How does the device’s environment look like? Can you define the How much data will deployment targets? you produce?In Touch with Smart Devices | Masanori Fujita March 2012 Slide 29 © Zühlke 2012
    • TCP / UDPover WiFi and Mobile Network
    • Home Automation made easypowered by ELVELV pluggable sensors and actorsIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 31 © Zühlke 2012
    • Home Automation made easypowered by ELVELV pluggable sensors and actors UARTIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 32 © Zühlke 2012
    • Introducing Arduino• Open Source prototyping board• ATmega328 @ 16 MHz• 14 digital and 6 analog I/O pins• USB• UART• I2C• SPI• Many many shieldsIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 33 © Zühlke 2012
    • Home Automation made easypowered by ELV + Arduino + AndroidELV pluggable sensors and actors 3G Internet DSL WiFi UART EthernetIn Touch with Smart Devices | Masanori Fujita March 2012 Slide 34 © Zühlke 2012
    • Udp.begin(localPort); server.begin(); Serial.begin(9600); while(timeStatus() == timeNotSet) { unsigned long t = getNtpTime(); if (t > 0) { setTime(t); } } setSyncProvider(getNtpTime); setSyncInterval(60);}bool event_1_triggered = false;bool event_2_triggered = false;void loop(){ time_t t = now(); for(int i = 0; i < EVENT_COUNT; i = i + 1) { // check whether On-Event was not fired and On-Time has beenreached if (!triggered_events[i*2] && hour(t) == time_table[i*FIELDS] &&minute(t) == time_table[i*FIELDS+1]) { fs20.send_cmd(time_table[i*FIELDS+4], CMD_ON, 0xFF); triggered_events[i*2] = true; triggered_events[i*2+1] = false; } // check whether Off-Event was not fired and Off-Time has beenreached if (!triggered_events[i*2+1] && hour(t) == time_table[i*FIELDS+2]&& minute(t) == time_table[i*FIELDS+3]) { fs20.send_cmd(time_table[i*FIELDS+4], CMD_OFF, 0xFF); triggered_events[i*2] = false; triggered_events[i*2+1] = true; } } // wait for a new client: Client client = server.available(); // when the client sends the first byte, say hello: if (client) { if (client.connected() && client.available()) { // read the bytes incoming from the client: char c1 = client.read(); char c2 = client.read(); char c3 = client.read(); fs20.send_cmd(c1, c2, c3); } }
    • SMA Solar Inverter Bluetooth
    • Stiebel-Eltron Heating System RS232
    • Internet ofThings
    • Build upon small and open components
    •  Thermometer Accelerometer External Sensors WiFi  Twitter  Email  Text Messaging
    • We can make it happen. Today.
    • Masanori Fujitamfu@zuehlke.com@matterlobby