Assembly and trouble shooting
Building the AIY Voice Kit
Pay particular attention to the orientation of the ribbon cables, make sure they face the right way and are pushed in all the way before closing the clamp. Do not do step 38 and insert the microSD card that is in the set.
WiFi Setup
We need to provide the Raspberry Pi in the voice kit with the name and the password for the WiFi connection. Use the same WiFi you computer or laptop is connected to. Here are the steps
Find the microSD card in the small box. It is inside a bag with an ORCSGirls Sticker
Use the microSD card adapter and insert the microSD card
Insert the adapter in a USB port on your computer or laptop (you might need an adapter is you do not have a 'big' USB-A port)
The card should show up as a drive called Boot on you computer
Visit the webpage https://play.orcsgirls.org/Pi/wifi.php and enter your WiFi network name (SSID) and password. Make sure everything is spelled correct. Click Download.
Copy the download file wpa_supplicant.conf to the microSD card (Drive Boot)
Eject the microSD card drive
Remove the adapter and the microSD card
Insert the microSD card into the Raspberry Pi (similar to step 66 we skipped earlier)
Powering up
Follow these instructions to power up the voice kit and let it boot. Make sure you see the green light blinking after a few seconds indicating activity. If it successfully starts up, you will hear a beep and the green LED in the front lights up - be patient, the first boot might take a minute or two.
Connecting to the voice kit
For those who cannot wait, the link http://orcspi-voice.local:5555 will connect you to Jupyter 😎
You can also connect to the voice kit using ssh. On Mac and Window you should have a terminal program. Open is and enter this command ssh pi@orcspi-voice.local - answer yes to the first finger print question, then enter the password (same as last class, Slack me if you need it). You should see a command prompt for your Raspberry Pi where you can enter commands.
Creating Google Assistant Credentials
Follow the setup steps below until slide 28.
Now we have the needed file with credentials on the computer and need to transfer it to the Raspberry Pi and and rename it.to assistant.json. In the following steps you need to replace <secret_file> with the name of the file you downloaded above (is starts with client_secret_ and is really long 😎)
Method 1
Connect to https://orcspi-voice.local:5555 (or use IP address if .local does not work)
Upload <secret_file> to the Raspberry Pi
Open a terminal on the Raspberry Pi
In the terminal type mv <secret_file> ../assistant.json
Method 2
Open a terminal on your computer (where you downloaded <secret_file>
Change the directory to where <secret_file> is (e.g. cd Downloads)
Enter scp <secret_file> pi@orcspi-voice.local:/home/pi/assistant.json
Open terminal on Pi.
Testing sound
Open a terminal on the Raspberry Pi (see above) . First we adjust the volume of the speaker. Enter the command alsamixer. Use the left/right arrow keys until Speaker is selected (red arrow). Then use the up/down keys to set the volume to 40 or so. Press ESC key to exit.
Then use the command below to test the sound
/home/pi/AIY-projects-python/checkpoints/check_audio.py
Starting the assistant
You need to start the Google Assistant manually using the command below in a terminal on the Raspberry Pi (we will use a Notebook later)
./examples/assistant_grpc_demo.py
This requires you uploaded the credentials file. The first time it will show a link in the terminal. Open that link in your web browser and you see a Google login. Sign in with the same Google account you used to setup and added as test user. It will show a warning. Allow and copy the password code it shows at the end. The paste that code in the terminal window. The assistant should complete the start up. This step is only needed the first time you run the assistant.
If all went well the button on the voice box turns red. Press the button, wait a second or so (button turns brighter red) and then say for example 'Sing me a song' 🎶
Shutting down
The Raspberry Pi is a 'real' computer and just like a laptop or computer it needs to be shutdown before turning off power. Many times just turning it off will be ok, but it has the (small) danger of damaging the file system on the microSD card and not booting again. The proper way to shutdown is
Open a terming and connect to the Raspberry Pi (using ssh)
Enter the command sudo shutdown now
Wait for the green light on the Pi to stop blinking and turn off
Turn off power
Trouble shooting
WiFi connectivity
If the link above does not connect you to your voice kit, here are a few trouble shooting steps. Try them in order and check after every step if connecting starts working.
Make sure the Pi and your computer are on the same WiFi network.
Make sure you copied the file wpa_supplicant.conf with the correct WiFi credentials on the microSD card before inserting it into the Pi. If you are not sure, turn the Pi off and remove the card. Use the adapter and insert it in to the laptop or computer. Note the file will not be on there, since the Pi removes it after booting. Create a new wpa_supplicant.conf using https://play.orcsgirls.org/Pi/wifi.php and copy it on the microSD card. Open the drive (Boot) on your computer and verify the file is there. Eject and remove the microSD card and re-insert it into the Raspberry Pi. Boot up - wait a few minutes and try to connect.
Some networks do not recognize '.local' internet addresses. In this case we need to find the IP address of the Raspberry Pi. Since if does not have a display, we need to look for it. Ask a parent if they have a tool to show all the computers on your home WiFi (many times logging into the WiFi router will show that) - find orcspi-voice and note the IP address (often something like 192.168.0.xxx). Alternatively you can use the Angry IP Scanner (with parents permission) to scan your home network for connected devices and look for orcspi-voice. Then try using that address e.g. 192.168.0.xxx:5555 to connect.
If you have an Android phone, you can also download the AIY app and use it to connect to your WiFi (follow the instructions in the app) and it will tell you the IP address. There is no such app for the iPhone. If you cannot find you IP address, there are other methods to scan for it - contact me 🙂
If all else fails, you can connect a monitor and keyboard to the Raspberry Pi. You will see a login (username Pi, password like before - ask me if you do not know). A desktop will come up and you can go to settings and connect to the WiFi. Note you will need a HDMI adapter and a USB adapter - both were included in the Pi Environment box for those who participated before. More details on how to connect can be found here.
Voice Kit / Raspberry Pi does not turn on
So you built the voice kit, insert the microSD card and powered it up, but there is no green light blinking on the Raspberry Pi (see photo where to look). Here are some trouble shooting tips. Note if the voice kit gets too hot to touch or you notice a 'burned smell', unplug it immediately - you have some wiring issue. Here are things you can try, easiest first 🙂
Make sure you have power. Try another outlet or plug something else (like a lamp) into the one you are using and make sure there is power. Next find another device you can power by USB (e.g. if you have another Raspberry Pi or a MicroBit or anything else that uses this type of USB power plug) and see if that powers up. If not, the power supply or cable might be broken. If another device works, we know we get power to the voice kit ✅
Another common reason for the Raspberry Pi not to start is a missing or corrupted microSD card. Here is what to check:
First check it is inserted correctly and all the way in (see photo).
If it is in correct you might have a corrupted card and need to reflash it using the adapter and a computer. You need this program https://www.balena.io/etcher/ and the image which you can download here. Make sure to copy wpa_supplicant.conf back on the card after flashing is done.