Android ThingsでIoT/AIなデバイス開発しよう

7507885e7de2f5fa2a3e80a445236d89?s=47 masato-ka
August 20, 2018
620

Android ThingsでIoT/AIなデバイス開発しよう

7507885e7de2f5fa2a3e80a445236d89?s=128

masato-ka

August 20, 2018
Tweet

Transcript

  1. Android ThingsͰIoT/AIͳ σόΠε։ൃ͠·͠ΐ͏ɻ 2018/08/20 @masato_ka(·͞ͱ͔)

  2. ࠓ೔ͷLTͷ಺༰͸ Android ThingsΛ࢖͏ͱخ͜͠ ͱͰ͢ɻ

  3. Android Thingsͬͯͳʹʁ • Android(Android O)ϕʔεʹIoTσόΠε޲͚ʹΧελϚ Πζͨ͠OS • ̎̌̍̔೥ 5݄ʹVer 1.0.0ʢ8݄Ͱ

    Ver1.0.3ʣ • Things Support LibraryͰσόΠεͷपล I/OʹΞΫηεͰ͖Δɻ • ΠϯετʔϧͰ͖ΔΞϓϦ͸1ͭͰΞϓϦέʔγϣϯ͕ࣗಈىಈ͢Δɻ • Raspberry Pi 3BͳͲෳ਺ͷϘʔυʹରԠ͍ͯ͠Δɻ • LenovoͷSmart Display͕Android Things 1.0.0ൃͷϓϩμΫτ ༻్: Raspberry PiͰ࡞ΕΔσόΠε͸େମ࡞ΕΔɻ
  4. AndroidThings࢖ͬͯΔਓ͋Μ·Γฉ͔ͳ͍ɻ •Android Thingsɻɻɻ ※Arduino͸ѹ౗త͗͢ΔͨΊআ֎

  5. ʲࠓ೔ͷϞνϕʔγϣϯʳ ̍ɽAndroid Thingsͷ͍͍ͱ͜Λ΋ͬͱ஌ͬͯʂ ̎ɽAndroid ThingsΛ࢖͏ਓΛ૿΍͍ͨ͠

  6. ͰɺAndroid ThingsΛ࢖͏ͱԿ͕خ͍͠ͷʁ

  7. Android Things ͷ࠷ߴͳ3ͭͷϙΠϯτ 1. User-space driver •ಠࣗͷσόΠεΛAndroidͷAPIʹ౷߹ 2. σόΠε΁ͷAIͷ૊ΈࠐΈ •ΠϯελϯτʹAIػೳΛσόΠεʹ෇Ճ

    3. Ϋϥ΢υͱͷ࿈ܞ •σόΠεϚωδϝϯτؚΊͨΫϥ΢υ࿈ܞ
  8. पลI/OΛAndroidͷAPIͰѻ͑ΔΑ͏ʹ͢Δɻ Android Things OS UART I2C/SPI PWM I/O 1.User-space driver

    GPSϞδϡʔϧ ηϯα/LED/OLED ϥδίϯαʔϘ SW/LED ※I2S͸Audio APIͰΞΫηε͢Δɻ Things Support Library Location HID Sensor LoWPAN Location API View Sensor LoWPAN User-space driver AndroidAPI User application
  9. SPI઀ଓλονεΫϦʔϯͷHIDυϥΠόΛ࣮૷ • SPIͷೖྗͰ͋ͬͯ΋Androidͷը໘࣮૷ͱͯ͠ѻ͑Δɻ

  10. User-space driverͷ࠷ߴͳϙΠϯτ • ΞϓϦέʔγϣϯͷϙʔλϏϦςΟΛߴΊΔɻ खࠒͳσόΠε͕ͳ͍ʂ AndroidͰཁ݅ݕ౼ Android ThingsͰ ϓϩτλΠϐϯά ηϯαͰԿΛܭଌʁ

    Ϋϥ΢υଆͱ ͷػೳ෼୲ ௨৴ํࣜʁ ϢʔβώΞͷ ϞοΫ ΞϓϦ͸ྲྀ༻ͯ͠ཁ݅ʹ͋ͬ ͨϋʔυ΢ΣΞΛ࡞Δɻ ͋Γ΋ͷͰσόΠε։ൃΛޮ཰తʹਐΊΒΕΔɻ
  11. • Android ThingsͷAI͸Tensorflow-Lite͔FirebaseML Kit Λར༻Ͱ͖Δɻ 2.σόΠε΁ͷAIͷ૊ΈࠐΈ Android Things DNN Model

    User Application ɾInception-v3 ɾmobilenet ɾmobilenet-ssd ɾFirebase (Mobile޲͚ͷBaaS) ɾAndroid Things͔Β΋ར༻Մೳ TensorFlow LiteΛ࢖͏͚ͩͳΒ RaspbianͰ΋Ͱ͖Δɻ
  12. AIػೳͷ࠷ߴͳϙΠϯτ • Firebase ML KitͰΤοδAIΛ؆୯࣮ݱ&ӡ༻·ͰΧόʔ 1. ̑छྨͷೝࣝػೳͱΧελϜϞσϧ(tfliteܗࣜ) • ςΩετೝࣝɺإ/ಛ௃ࣝผɺQRίʔυ2࣍ݩόʔίʔυɺը૾ͷϥϕ Ϧϯά(γʔϯೝࣝ)ɺϥϯυϚʔΫൃݟ(౦ژλϫʔͱ͔)ɺΧελϜϞσ

    ϧ(tflite) 2. DNNϞσϧͷ؅ཧ΍഑৴͕ߦ͑Δɻ • Ϟσϧ͚ͩΛωοτϫʔΫӽ͠ʹߋ৽Ͱ͖Δɻ ※ TPU(GoogleͷAI޲͚ASIC)ʹ΋ରԠ༧ఆ
  13. 3. Ϋϥ΢υͱͷ࿈ܞ •Cloud IoT CoreͷΫϥΠΞϯτϥΠϒϥϦ • Cloud IoT CoreΛى఺ʹGCPͱ઀ଓͰ͖Δɻ •Android

    Things Console • Android ThingsͷOSΞϓϦͷ؅ཧΛ͢ΔαʔϏε Ҿ༻ɿhttps://developers-jp.googleblog.com/2018/07/android-things-client-library-for.html
  14. Ϋϥ΢υ࿈ܞͷ࠷ߴͳϙΠϯτ •GCP΁ͷ઀ଓ͕؆୯ •Cloud IoT CoreϥΠϒϥϦ •σόΠεϚωδϝϯτػೳ͕σϑΥϧτ •OSΞοϓσʔτʢOTAʣ •ΞϓϦέʔγϣϯͷ഑৴ʢOTAʣ σόΠεͷσʔλૹ৴ͱσόΠεϚωδϝϯτ

  15. ͦ͏͸ݴͬͯ΋ਏ͍ͱ͜Ζ΋͋ΔΜͰ͠ΐʁ

  16. Android Thingsͷਏ͍ϙΠϯτ

  17. Android Thingsͷਏ͍ϙΠϯτ • Androidʹؔ͢Δ஌ࣝΛڧཁͯ͘͠Δɻ • ޾͍ʹ΋AndroidͷάάϥϏϦςΟ͸ߴ͍ɻάάΕ͹ͳΜͱ͔ͳΔɻ • JavaͰ։ൃ͢ΔͷͩΔ͍ʢࢲ͸Java޷͖Ͱ͢ʣ • Android

    Studio(InteliJ IDEA)ͷ࢖͍ํΛ֮͑Δͱָ͘͠ͳΔɻ • Ͳ͏ͯ͠΋ݏͳΒKotolin • ରԠϋʔυ΢ΣΞ • ݸਓͰ͸࣮࣭Rspberry Pi 3B Ұ୒ɺ3B+ૣ͘དྷͯ͘Εɻ • ηΩϡϦςΟ • ϓϩμΫτʹ͢Δʹ͸ϙʔτดͨ͡ΓϢʔβݖݶઃఆͨ͠Γɻ • ଞͷϘʔυ΋ಉͩ͡ͱࢥ͏ɻ • Thingsࣗ਎ͷ৘ใ͕·ͩ·ͩগͳ͍ɻ • ΈΜͳͰ࢖ͬͯΤίγεςϜ࡞͍͖ͬͯ·ͤΜʁ • ύΠΦχΞਫ਼ਆͰऔΓ૊ΊΔɻ
  18. Android Things CAMP #2 (2018/08/26) • গ͠Ͱ΋ڵຯΛ࣋ͬͨΒੋඇࢀՃ͍ͩ͘͞ʂ(΋͘΋͘ձͰ͢) • νϡʔτϦΞϧ·Ͱ͓෇͖߹͍͠·͢ɻ •

    Android ΤϯδχΞ΋͓଴ͪͯ͠·͢ɻ(੾࣮)
  19. ͓͠·͍ ※ৄࡉ͸http://masato-ka.hatenablog.com/entry/2018/07/22/202525