IoT with Google's Android Things


I was asking myself what google is doing in IoT other than providing a Cloud service for IoT on their Google Cloud Platform. Recently, i learned during a meeting that they have a lot of activity on the IoT and i decided to dig into it. This article aims to introduce one aspect of Google's effort in IoT which is an operating system based on Android for the IoT devices called Android Things.

A bit of history

Since the announcement of the Project Brillo on 2015, which received a lot of criticism from the community. Google decided to steer their effort to build an IoT device operating system to a safe bet which is Android. Indeed, as Android SDK have a clear success in the mobile devices, Google emphasis the fact that developers can leverage their knowledge on development on mobile devices to build solutions for IoT.

System and provisioning architectures

You have probably guessed from the name of the project, Android Things operating system reuses both architectural structure and components from the Android stack. However, it shares only the lower layers of the stack as the application model differs starting from the libraries layers.
Android Things architectural modifications with regard to the original Android architecture enables Android Things to extend the core Android framework to provide additional API to support hardware component that are not supported by mobile devices running on Android. The extended "Java API framework" and the "Things support" under the Runtime layer offers the possibility to the IoT applications to interact with GPIO and communicate with sensors and actuators.
Android Things reuses also the secure provisioning method used currently by Google to update the Android operating system on the mobile devices for both updating the Android Things operating system and the applications over the air from Google's Cloud ( Android Things console ). That enables some interesting features like background updates of the operating system on the IoT devices without service interruption, boot fail over, automatic security updates and application management in bundles.

Supported hardware

Android Things is an operating system, it requires a minimum hardware configuration to run. As illustrated in the cover image of this article, ArduinoParticleTrinket and other ATmega based devices are not supported. Moreover, my dental prosthesis are not yet supported :) . By looking at the supported devices, they are a mixture of 32-bits and 64-bits Intel and ARM based CPUs. It seems that the operating system requires a minimum amount of 512MB RAM (initially designed to support 64MB RAM) in addition to Wi-Fi and Bluetooth.
The official list of supported device is available on the project's website. The figure on the left shows the names of the IoT devices or System On a Module (SOM) supported as the time when i am writing this article.
The device support is mainly constrained by the use of Linux kerneland virtual memory for multi-tasking support. That restraint the deployment of this operating system only on processors with full support of Paged Memory Management Unit (PMMU) such as Intel and ARM. That mean that Android Things operating system will unlikely support constrained IoT devices that are based on other micro-controllers.

First-hand experience

Once I learned about Android Things operating system, i had some itching on my hands to deploy it on one of my devices to see how it looks like and to compare it with the other solutions that i had the chance to play with. As i have always a Pi to hands, i decided to use it for my experiment.
Steps for getting started are well described on the official website. I will just describe them in a nutshell for the lazy people that are too lazy to visit the official website :)

Configure the Pi

  1. login, create a product, build and download the correct Android Things image from the console.
  2. write the image to the SD card that you will yse on the Pi.
  3. Plug your Pi to Ethernet, HDMI, and the power. That should initiate the boot sequence. Note that it may take a little more than a minute to start. Moreover, it takes a dozen of seconds to show the boot screen as illustrated in the figure below.

Connect to the console

Once the boot sequence completed, some information about the connectivity will show up on the screen as illustrated on the figure below.
you need to use ADB to connect to the Pi. it is available with Android Studio ( that you will need to develop applications) or as a standalone.
  1. you can use the multicasted the hostname “Android.local” or the IP from your screen to connect to the Pi using the command below (change the https://www.linkedin.com/redir/invalid-link-page?url=10%2e0%2e0%2e180 with the IP from your screen):
adb connect YOUR_IP
  1. Then connect to Wifi using the command below:
adb shell am startservice -n com.google.wifisetup/.WifiSetupService  -a WifiSetupService.Connect -e ssidYOUR_SSID -e passphrase YOUR_PWD

Building your first application

Please refer to this guide as I already did my good deed by taking many pictures and screenshots ;)

Conclusion

Android Things uses technology that is to the evidence established for the mobile devices. That allows this solution to leverage all the knowledge for both the operating system and the application development. However, for the reasons that we discussed on the hardware support section of this article, This operating system is limited in term of supported devices at it is unlikely that we see Android Things on constrained devices.

Comments

Post a Comment

Popular posts from this blog

Software-Defined Networking and Cloud: Hands on OpenStack integration with OpenDayLight

Publicity plan for a workshop or conference