Introduction
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 your solutions even faster.
All you need to do is start the gateway, connect it to your device, and send a command (or subscribe to sensor data notifications).
Here is a presentation showing common use-cases for the DeviceHive Gateway on Android.
This quick tutorial will help you start prototyping your solutions faster.
What’s new?
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 your Android device is updated to Android Marshmallow, DeviceHive Android BLE Gateway v2.0 will automatically detect the system requirements and ask you to enable Bluetooth and Location permissions from the start. And if you accidentally disable the Location service on your device, the Gateway will ask you (if you accept) 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 the scanning work.
These changes make v2.0 support both the latest security requirements and makes the BLE discovery preconditions activate in the most natural and seamless way.
Get Started
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 your Android device (phone, tablet or other device) you 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.
IoT Made Easy. With DeviceHive 🙂