This project is a simple sample that shows how to use the Watson Speech to Text service in IBM Bluemix to steer a Sphero ball. The web application in this project is an extension to the projects sphero-bluemix-android and sphero-bluemix-ios which contain the mobile apps that communicate with the ball.
The Watson Speech to Text Node.js sample has been extended to send the spoken words as text via the MQTT protocol to the IBM Internet of Things service. A Node-RED flow is used to receive the spoken words and to trigger the specific flows.
Authors: Mark VanderWiele, Bryan Boyd
In order to send commands to the mobile app a Node-RED flow in IBM Bluemix is used in combination with the IBM Internet of Things Foundation.
Log in to Bluemix and create a new application, e.g. MySphero, based on the Internet of Things Foundation Starter. Additionally add the Internet of Things service to it.
In the next step you have to register your own device. Open the dashboard of the Internet of Things service and navigate to 'Add Device'. As device type choose 'Watson' and an unique device id - screenshot. As result you'll get an org id and password - screenshot.
In order to import the flow open your newly created Bluemix application and open the Node-RED editor, e.g. http://mysphero.mybluemix.net/red, and choose import from clipboard. You find the flow in the sub-directory 'noderedflow'.
If you want to actually steer a Sphero ball you have to also set up the Android or iOS app. Alternatively you can modify the flow to do whatever you like to do based on the received spoken words.
-
Create a Bluemix Account. Sign up in Bluemix, or use an existing account.
-
Download and install the Cloud-foundry CLI tool
-
Download the application and change to that directory. Run "npm install".
-
Modify the file demo.js. Replace the text in the screenshot with your org id, device id and auth-token that you received when you registered the device. Note that in a real production application you should not put the password in the JavaScript file.
-
Edit the manifest.yml file and change the application name and service name to something unique. The name you use will determinate your application url initially, e.g. sphero-watson-nik.mybluemix.net.
-
Connect to Bluemix in the command line tool.
$ cf api https://api.ng.bluemix.net
$ cf login -u <your user ID>
- Create the Speech to Text service in Bluemix.
$ cf create-service speech_to_text free speech-to-text-service-nik
- Push it live!
$ cf push
These steps created the application in Bluemix including the service.