Thursday, June 08, 2017

TJBot Talks! #4



TJBot is Talking! See the video below!


 (Note: I posted a newer post with a new recipe and some pointers, tips, hints: http://henrywill4.blogspot.com/2017/07/tjbot-new-recipe-post-5-about-tjbot.html )

 I continued the work (see prior posts:  #1 order parts,  #2 test the hardware, and #3 assemble the cardboard ) by following this instructable starting at step 4 at the following link:

http://www.instructables.com/id/Build-a-Talking-Robot-With-Watson-and-Raspberry-Pi/

I used terminal on the Mac to ssh into the pi 2 in the TJBot (I think you can use putty on the pc which I understand can be downloaded )

I used the browser my mac (or you can use the pc) to get the credentials from each of the 3 services

To edit the config file I used "sudo nano config.js" you can then move your cursor around with keyboard keys and copy the credentials from the mac (or PC) browser and paste it into the config.js file (using control-C for copy and control-V for paste).

IMPORTANT NOTE: for the service credentials, they may not be presented in the same order, be careful to copy the password to the password entry in the config.js (i messed up because mine were in opposite order, so I was getting errors that Speech to Text STT wasn't working)

For step 6, if you're using ssh, you need the conversation file on your mac (or pc). You can get it from the zip at:
https://github.com/ibmtjbot/tjbot/archive/master.zip

For the workspace ID, I somehow copied the wrong information and pasted it there in the config.js file at first. TJBot was not returning anything to pass to Text to Speech (TTS). I was getting an error that nothing was sent for TJBot to speak. So, I had to go pull that workspace ID again from the conversation tool and put it into the config file. I restarted the conversion.js and TJBot was talking!

Here's a copy of the verbose output to the console that I see when starting up TJBot Conversation:

sudo node conversation.js
verbose: TJBot initializing microphone
verbose: TJBot initializing conversation service
verbose: TJBot initializing speech_to_text service
verbose: TJBot initializing text_to_speech service
info: Hello from TJBot! My name is Watson.
verbose: TJBot library version v1.3.0
You can ask me to introduce myself or tell you a joke.
Try saying, “Watson, please introduce yourself” or “Watson, who are you?”
You can also say, “Watson, tell me a joke!”
verbose: TJBot initializing microphone
info: TJBot heard: Watson who are you
verbose: TJBot response from conversation id xyz Hi, I’m TJBot! :
verbose: TJBot speaking with voice en-US_MichaelVoice
verbose: TJBot speaking: Hi, I’m TJBot!
{ filename: ‘/tmp/tjbot11756-2013-811zkh’,
  gain: 100,
  debug: true,
  player: ‘aplay’,
  device: ‘plughw:0,0’ }

I then went in and modified the conversation training to add information about the local high school where I'm going to demonstrate it today. I added intents for the school and answers (in the dialog) that I pulled from information I found about the school.

It's so great to hear TJBot talk! I hope to set up to move it's arm and change the color of the LED for a Church Vacation Bible School coming up soon. I will probably use the Dashboard recipe for that. So, maybe you'll see another post here about that soon!

(A special tip-of-the-hat and word of thanks to the folks at IBM Research for their help, especially Victor Dibia for his many answers to my questions).

Please comment with your thoughts!