Install Raspberry Pi OS 64-bit Lite
For the bear, you will need the 64-bit version of Bookworm Raspberry Pi OS Lite because the OpenAI libraries will only install on that version. Since the project uses a voice interface, a desktop isn't required. You can refer to the CircuitPython Libraries on Linux and Raspberry Pi guide for more help setting it up.
Once you have everything set up, you will need to open a terminal and install Blinka. Refer to the Installing CircuitPython Libraries on Raspberry Pi page to quickly get up and running.
Audio System and Drivers
Before you can configure the audio devices, you will need to install some additional audio libraries:
sudo apt install libpulse-dev pulseaudio apulse
Sometimes these installations create default incompatible configuration files that cause errors. These configuration files are not necessary for the audio system to run. Run the following to remove any existing sound configuration files:
rm ~/.asoundrc sudo rm /etc/asound.conf
I2S Audio Setup for Compact Build Option
If you installed the MAX98357, you will need to install some software to use it. Follow the Raspberry Pi Setup instructions from the Adafruit MAX98357 guide.
Afterwards follow the Raspberry Pi Test procedure to make sure sound is playing.
USB Audio Selection for Easier Build Option
If you went with the easier build option, most likely it will just work without any changes. If not, you can tell the system which audio device to use by typing:
sudo raspi-config
Select System Options→Audio. Make sure USB Audio is selected and then tab over to Ok to select it. After that, you can exit to the command line and that's it.
The volume can be adjusted by running:
alsamixer
You can just adjust the Master Volume or if you want to adjust for the speaker only, you can press F6 and choose UACDemoV1.0 from the device list.
Install Required Libraries
You will need to have a few libraries installed before the script will run on your computer. Make sure your venv is active and start with some prerequisite libraries:
sudo apt install python3-pyaudio build-essential libssl-dev libasound2 wget libssl1.1 pip3 install SpeechRecognition
Next install the MotorKit CircuitPython library:
pip3 install adafruit-circuitpython-motorkit
Next install the OpenAI library:
pip3 install --upgrade openai
Install the Azure Speech Services library:
pip3 install --upgrade azure-cognitiveservices-speech
Finally, download the keys.txt file for adding your keys to:
cd ~ wget https://github.com/adafruit/Adafruit_Learning_System_Guides/raw/main/ChatGPT_Bear/keys.txt
Text editor powered by tinymce.