When you are ready to use the bear, open the flap on the bottom and just give it a final check to make sure the battery is charged and you have all of the cables connected. Make sure the battery and Pi are powered on.
Connect to the bear over WiFi using SSH. Once you are logged in, type the following:
cd ~ python3 assistant.py
The bear should start talking and prompt you to squeeze its foot. Squeeze the foot and then ask it a question or request something.
Here are a few examples of requests to try:
- Tell me a joke
- Tell me a story about a robotic bear
- Tell me a poem about video game characters
- Tell me about CircuitPython
When you are finished. Just press Control+C a couple of times. Because of the multi-threading, sometimes it takes a moment to stop.
Troubleshooting
No Keys
Make sure you have specified your API keys before running the script. It should let you know if it wasn't able to find those values. Save your values in keys.txt, which should reside in your home directory.
No Audio
If you hear no sound when you run the script, it could be caused by a few things. To begin with, run through the tests specific to the way you set up device.
You can also try running the following command to test the audio:
speaker-test
If you have verified that sound comes through with speaker-test, you may need to set the DEVICE_ID
. To determine the Device ID, just run the following command:
aplay -L | grep plughw:
You should get a list of IDs. that begin with plughw
like this:
For instance, if you have the USB Speaker, you should see a device like plughw:CARD=UACDemoV10,DEV=0. Set the DEVICE_ID
variable to that value and it should use that.
DEVICE_ID = "plughw:CARD=UACDemoV10,DEV=0"
Page last edited April 15, 2024
Text editor powered by tinymce.