Build your BLE IoT Application with cloud control and cellular connectivity!
In this repo, an example ble plugin is provided which connects to Arduino 101 boards and allows you to turn on/off the LED through the Droplit.io Rest API. This plugin is intened to be a starting ponint for a BLE device plugin integration.
There are two test applications provides in the noble-test
folder which allow you to confirm that node can interface with BLE devices.
- Software Platform: Droplit.io
- Hardware Platform: Raspberry Pi Zero W
- Gateway Software: Droplit.io Edge
- Downstream Devices: Arduino BLE devices (Arduino 101)
- Connectivity: Hologram Nova
Other hardware devices that Noble and Droplit.io Edge supports are also acceptable, such as other Raspberry Pi devices with BLE radios.
Before you fire up your Raspberry Pi and Arduino's, get familiar with the Droplit.io Platform by looking through the documentation and create a free developer account on the droplit.io developer portal. In the portal, there a few guides/tutorials to get you started.
You can use any BLE device as a downstream device, including the Arduino 101.
Arduino provides a getting started guide here.
After installing the board support package through the Arduino IDE and selecting Arduino 101 as your board target.
Upload the LED
example to the Arduino 101.
You can test the Arduino 101 by sending 0x00
and 0x01
data through the nRF Connect mobile app to turn on and off the Arduino 101's user accessible LED .
Before using a cellular connection, you may want to test the Raspberry Pi on a local network connection.
On the Raspberry Pi Zero W, you may encounter connectivity issues when using both WiFi and Bluetooth at the same time.
First make sure your Raspberry Pi has NodeJs installed. You can install node by following this guide here. You will need the arm-v6
release of node.
After installing node, make sure you configure the npm global install directory.
There are two test applications provides in the noble-test
folder.
To run the tests, from your gateway device run
cd noble-test
npm install
node test
This first test will simply scan for ble devices and log the output to the console.
The second test will connect the Raspberry Pi Zero to an Arduino 101 that is running the BLE
example from above.
Once you have node installed, get the Droplit.io Edge by following its documentation in the repo's readme.
Once you have a running instance of the Droplit.io Edge. First teardown the project by running:
gulp teardown
Then replace the {droplit-edge}/projects.json
and {droplit-edge}/projects/droplit-edge/localsettings.json
with the files proviced in /droplit-ble-plugin
.
You will need to enter your Droplit.io Ecosystem Id in localsettings.json
.
Next copy the /droplit-ble-plugin/droplit-edge-sample-ble-plugin
into {droplit-edge}/projects/
. Then rebuild the project.
gulp setup
gulp build
gulp debug
In the droplit.io portal, when your Arudino 101 connects, you should be able to controll its led by setting the BinarySwitch.switch
value or calling BinarySwitch.switchOn()
/ BinarySwitch.switchOff()
.