The DeviceHive team has released a new version of their gateway for Android N. DeviceHive Android Gateway for Bluetooth Low Energy devices makes it possible to connect multiple Bluetooth Low Energy devices to DeviceHive IoT clouds through a single Android device. Now it’s possible to connect sensors, buttons, indicators, wearables, and any other BLE devices to prototype solutions even faster.
All that’s needed is to start the gateway, connect it to the device, and send a command (or subscribe to sensor data notifications).
This quick tutorial will help to start prototyping the solutions faster.
DeviceHive Android BLE Gateway v2.0 on GitHub is the first up-to-date version that supports Android versions starting from Jelly Bean MR 2 (the first Android version that supported Bluetooth Low Energy) and up to Android N Beta.
Now, the DeviceHive Android BLE Gateway v2.0 has a modern Material Theme look.
It supports the multi-window mode introduced in Android N.
However, the most important update in v2.0 is support for the new runtime permissions introduced in Android Marshmallow. This includes the latest change in the BLE device discovery rules, which depends on the Location service. This means that if the Android device is updated to Android Marshmallow, DeviceHive Android BLE Gateway v2.0 will automatically detect the system requirements and ask to enable Bluetooth and Location permissions from the start. And if the Location service will be accidentally disabled on the device, the Gateway will ask to automatically turn Location on.
The location requirement was not documented for a long time - Google unveiled it as a part of the new Proximity and Awareness API update only at the I/O 2016. But without Location enabled, BLE scanning simply doesn’t return any results. The latest update to the Gateway makes scanning work.
These changes mean that v2.0 supports the latest security requirements and that BLE discovery preconditions activate in the most natural and seamless way
This is news only for experienced users who know what the DeviceHive Android BLE Gateway is. For those who are new to the Gateway or DeviceHive, we recommend watching the Official DeviceHive Video that shows common use cases for the Gateway. Read the Readme on GitHub or view the presentation with examples of how to use it with the Texas Instruments SensorTag CC2450 and CC2650.
So briefly, what is DeviceHive?
It’s a way of building an IoT/Smart Home from scratch, easily configurable and extensible, for almost any platform in the world that exists today. Actually, it’s free and open-source.
Android is one of the platforms supported by DeviceHive. Using the DeviceHive Android BLE Gateway installed on an Android device (phone, tablet or other device) user can connect many different Bluetooth LE devices to the world via the DeviceHive Admin Panel. Now it’s available in the cloud without any installation procedures right on the DeviceHive Playground.
The following basic Bluetooth commands (can be sent directly from DeviceHive Admin cloud) are supported from the admin panel:
Scan, scan/start, scan/stop - for automatic and manual device discovery
gatt/connect, gatt/disconnect - for connecting to devices (but usually Gateway can connect to your device automatically if it was already discovered by one of the ‘scan’ commands)
gatt/primary - for listing the available services of a device
gatt/characteristics - for listing the characteristics of the selected service
gatt/read, gatt/write - for reading data from a device or controlling the device remotely using the write command
gatt/notifications, gatt/notifications/stop - control the subscription to data update notifications from devices (for example, temperature or motion sensors).
And of course, receiving data notifications has become easy and more visual with the introduction of the Dashboard, which is now available directly from the DeviceHive Playground.