Chat with Alma!
Alma bot is a German speaking variation of TJBot. This recipe is based on IBM TJBot and uses the Watson Assistant and other Watson services to turn Alma into a chatting robot.
Some possible things to tell her:
- "Alma, wie geht es dir?" - To get to know about her feelings.
- "Hallo Alma!" - Alma will say hello and waves her arm.
- "Alma, ändere das Licht auf Blau!" - Switch the LED to the given color.
- "Alma, lass uns Disco machen!" - Rotate through all LED colors.
- "Wie viel Uhr ist es, Alma?" - Alma tells you the time.
- "Alma, welcher Tag ist heute?" - Alma tells you the date.
- "Alma, was siehst du gerade?" - Alma takes a photo and tries to guess what she sees.
- "Alma, erzähle mir einen Witz!" - Alma tells a joke.
- "Gute Nacht, Alma!" - Ends the conversation.
This recipe requires a TJBot with a microphone, a speaker, a LED, a servo arm and a camera.
First, make sure you have configured your Raspberry Pi for TJBot by following the bootstrap instructions.
To use the LED and Audio in paralled I use an external USB sound card.
To get this up and running the Audio must be blacklisted, but not all modules. E.g. do not blacklist the Headjack, otherwise USB Audio does notwork any more!
After bootstrap script has been run enter
$ sudo vi /etc/modprobe.d/tjbot-blacklist-snd.conf
and delete the last line:
$ blacklist snd
Save the changes and restart the system.
Next, go to the almabot
folder and install the dependencies.
$ cd almabot
$ npm install
Import the skill-Alma-Bot.json
file into the Watson Assistant service and note the workspace ID.
Create instances of all the required Watson services in Frankfurt data center and note the authentication credentials.
Make a copy the default configuration file and update it with the Watson service credentials and the conversation workspace ID.
$ cp config.default.js config.js
$ nano config.js
<update your service API keys and the Assistant workspace ID in the specified places>
Make sure PulseAudio is started:
pulseaudio --start
Start the bot:
sudo node almabot.js
Note the
sudo
command. Root user access is required to run TJBot recipes.
When you use an external USB sound card you may have to change the speaker device id.
For me I had to change the option 'speakerDeviceId' in file 'config.js' to 'plughw:1,0'.
This project is licensed under Apache 2.0. Full license text is available in LICENSE.