Radio Button Groupを使うと簡単にXPage...
Control BB-8 by XPages on bluemix and IBM IoT Foundation
I’ve had the session to contorl the drone by IoT and XPages on 11/18/2015 at the Notes Consortium Partner Solution Seminar event in Japan
This time I succeeded to control the BB-8 droid of Star Wars instead of Drone by XPages and IoT. So I would like to share how I made.
Presentaion slide is below:
Difference between Drone and BB-8
In the drone project, the central device(PC) connected to the drone by the drone Wifi connection so that the device can receive the drone data and publish to IoT on bluemix or vise versa. In the BB-8 project, the most different thing is BB-8 and PC are connected by bluetooth.
I got this BB-8 as the eye-catch item at the booth in the IBM Connect Japan 2016. Normally you download the designated smartphone application and manipulate BB-8 via the app.
When I searched BB-8 by Amazon.co.jp, the “Force Band” seems to be sold as BB-8 option item on 9/30/2016. “Force Band” and my technical approach is maybe totally different, but I am happy to blog this before people purchase the “Force Band”.
- Node.js has been installed on Windows OS
- Bluemix account has been created.
- CF command line interface has been installed.
- Bluemix command line interface has been installed.
- Bluemix Tool has been installed to the IBM Domino Designer (For more detail Go this link)
- Bluetooth 4.0 USB adapter
This BB-8 is simpler than Drone.
1. To control BLE on Windows
In my environment, the embedded Bluetooth device could not be used for BLE connection. So I purchased Bluetooth 4.0 USB adapter and then, I needed to setup the device to the WinUSB driver by using Zadig
Below is the Bluetooth 4.0 USB adapter I purchased.
Below is the instruction to setup WinUSB driver so that node.js can use your Bluetooth device.
*If you are using Mac OS, your are lucky since you don’t need to worry about this step. This step requires installation of Visual Studio, Python etc.
2. Get UUID of Bluetooth
After complete the step above, install(global install) “cylon-ble” package by npm.
npm i -g cylon-ble
A the next step, install “cylon-sphero-ble“.
npm i cylon-sphero-ble
Finally you can use “cylon-ble-scan” command to refer the Bluetooth UUID of you BB-8.
Below is a example of my Windows command prompt, please find the line that Name start from BB-, then get the corresponding UUID.
bb8-bluemix>cylon-ble-scan noble warning: unknown handle 70 disconnected! Starting scan. Peripheral discovered! Name: BB-B4XX UUID: cXXX89XXXXXX rssi: -39 Peripheral discovered! Name: ed3XXX-bt UUID: cXXXa2934XXX rssi: -71
Go to part 2
I divided the blog to part 1 and 2 since it became longer.
Please jump to Control BB-8 by XPages on bluemix and IBM IoT Foundation (2/2)