-
Notifications
You must be signed in to change notification settings - Fork 28
Assembly
- Unboxing
- Pre-Assembly Setup
- Assemble Peeqo
- Setup Wakeword
- Setup Dialogflow
- Setup Weather API
- Setup GIF API
- Software Setup
- Debugging
- Shutdown
Click on the image above to view the video
- Download & unzip Peeqo Image here (~2GB download)
- Download Etcher https://www.balena.io/etcher/
- Insert included micro SD card into your computer (minimum 8GB)
- Launch BalenaEtcher
- Select
peeqo.img
from your computer - Flash to micro SD card using BalenaEtcher
Click on each image to view the video of that step
-
Attaching servo brackets to the base
Note: In the video I use only 6 8mm screws to bolt the brackets to the base, even though the video states 12 screws. I found 2 screws per bracket to be sufficient(for a total of 6 screws) but feel free to use all 12 screws if you like(4 per bracket)
-
Assembling the circuit
Note: Remember to remove the screen protector film from the LCD screen. -
Adding the top half of the head
Note: At this stage you should have atleast 9 hex nuts (you might have a few more since I added some spares). Incase you have less than 9, skip adding the two hex nuts on the circuit screws I mention at the 15 second mark in the video to act as standoffs.
Watch video or follow instructions below
Peeqo uses snowboy for offline on-device wakeword detection. Follow these steps on your computer/dev machine to get him to respond to you saying Peeqo.
- Go to https://snowboy.kitt.ai/dashboard
- Login using Google/Github/Facebook
- Type “Peeqo” in the “Search Hotwords” text box & hit enter. Only one result should turn up
- Click on the microphone icon near the Peeqo search result
- Click “Record my voice” in the popup that opens
- Follow the instructions and record yourself saying Peeqo three times. You will need to allow the browser microphone access
- Click on “Test the model”
- Enter the details on the left and say “Peeqo” a couple of times till it says “Test Successful”
- The model is now trained to respond to only you saying Peeqo
- Click on “Save and download”.
- This will create a file called
Peeqo.pmdl
. - You will use this file later
Peeqo uses Google's dialogflow for Speech-to-text. You can replace this with another service of your choice later. Follow these steps on your computer/dev machine
- Go to dialogflow.com
- Click on “Go to console” in top right and login using your google id
- Grant permissions, select Country and accept terms & conditions
- Click “Create Agent”
- Enter “Peeqo” in agent name and click “Create”. Change language and time zone if required. Make sure to leave the default option of “Create a new Google project” selected
- Once created, click on the cog icon near the agent name in the left hand menu to open agent settings
- Click on Export and Import > Import from Zip
- Drag and drop
/electron/app/config/dialogflow-agent.zip
from this repo. Type IMPORT in the text box and click Import to upload this agent - In the General settings of your agent, make a note of the “Project ID”. You will need this in a later step.
- Click on the link labeled Service Account. This will take you to your google cloud console page
- In the cloud console page, click on the three vertical dots in the Action column of this Service Account and select “Create Key”
- Make sure JSON is selected and click create.
- This will download a JSON file to your computer. Keep it safe and never share it. Rename this file
dialogflow.json
. You will need this later - This agent should give you a good starting of some existing responses. You can now add your own responses and intents to it on dialogflow to add functionality. Go to https://dialogflow.com/docs/getting-started to learn more.
- Peeqo uses openweather api for current weather updates
- You can get a free api key by going to https://openweathermap.org/appid and signing up. A key will be emailed to you.
- Copy/make note of this key. You will need this key in a later step
NOTE It seems Giphy has cut off access to its public api key, so you will need to get a free api key by following these steps
- Go to https://developers.giphy.com/
- Click on 'Create An App' and signup
- Enter any name for 'Your App Name' and a short description under 'App Description' and click 'Create New App'
- This will generate an API key and display it to you. You will use this key in a following step.
- Plug in 12V DC adapter and power up Peeqo
- Connect to Peeqo network:
-
MAC/LINUX USERS
- From your computer, search for 'Peeqo' wifi network
- Connect to this network
- This network might take a few minutes to show up
-
WINDOWS USERS
- In windows 8.1 and windows 10, they have removed the ability to connect to ad hoc networks. You can try the steps at this link to see if it works for you, but results have been mixed.
- Alternative: Pop peeqo's head and plug in a USB keyboard and mouse into the two vertical USB ports and enter the commands into the terminal on the pi directly instead of through ssh
- For copying files over, plug a USB drive into one of the vertical ports on Peeqo and use a mouse and the GUI to copy the required files to their location
- Complete Initial Setup from your computer:
- Copy over wakeword file named
Peeqo.pmdl
from Step 3: Setup Wakewordscp path/to/file/on/your/computer/Peeqo.pmdl [email protected]:~/peeqo/electron/app/config/
- When prompted, enter password:
peeqo
- If you have a thumb drive with
Peeqo.pmdl
plugged in, pastePeeqo.pmdl
in/home/pi/peeqo/electron/app/config/
- Copy over dialogflow key file from Step 4: Setup Dialogflow
scp path/to/file/on/your/computer/dialogflow.json [email protected]:~/peeqo/electron/app/config/
- When prompted, enter password:
peeqo
- Thumb drive users, see note above and repeat for this file
-
Complete setup on Peeqo:
NOTE If you are using a keyboard plugged directly in, run all the steps (except the ssh ones) directly in the terminal on the pi
- SSH into Peeqo:
ssh -lpi 192.168.1.1
- Enter password:
peeqo
- Expand Filesystem:
sudo raspi-config
- Advanced Options -> Expand Filesystem -> Yes
-
sudo reboot -h now
or Select Yes when asked to reboot
- SSH into Peeqo:
ssh -lpi 192.168.1.1
- Enter password:
peeqo
- Duplicate
config-dev.js
file toconfig.js
cp ~/peeqo/electron/app/config/config-dev.js ~/peeqo/electron/app/config/config.js
- Edit
config.js
file in~/peeqo/electron/app/config/
nano ~/peeqo/electron/app/config/config.js
- Enter/edit dialogflow Project id in
speech.projectId
(from Step 4: Setup Dialogflow) - Enter/edit dialogflow key file name in
speech.dialogflowKey
. It should be nameddialogflow.json
(from Step 4: Setup Dialogflow) - Enter openweather api key in
openweather.key
(from Step 5: Setup Openweather API) - Edit
openweather.city
to your city - Enter Giphy api key in
giphy.key
(from Step 6: Setup Giphy API)
- Setup wifi:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
- Add in your wifi network SSID
- Add in your wifi network password
- You can add multiple wifi networks like this
- Replace Peeqo adhoc network with wifi network
sudo cp /etc/network/interfaces-wifi /etc/network/interfaces
- Following this, the pi will no longer broadcast an ad-hoc network but will connect to the defined wifi network instead
- Pull latest changes from github
sudo reboot -h now
- SSH into the pi or use the terminal on the pi (if you have a keyboard/mouse plugged in directly):
-
NOTE to find the IP address of the pi, the easiest way would be to plug in a keyboard/mouse, open the terminal on the pi and enter
ifconfig wlan0
. The displayedinet
address is your pi's IP which you can use to SSH into the pi from a computer connected to the same network - You can also see the IP address of your computer. The IP address assigned to the PI by your router is likely in the neighbourhood of your computer. Try incrementing your computer's IP by one till you find your PI's IP
ssh pi@<ip_address>
-
NOTE to find the IP address of the pi, the easiest way would be to plug in a keyboard/mouse, open the terminal on the pi and enter
cd ~/peeqo/
git pull
- Start app on startup:
-
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
- Add the following to end of file:
@/home/pi/peeqo/scripts/launch.sh
- Add the following to end of file:
- Reboot peeqo:
sudo reboot -h now
- Try some commands:
- Add your own commands:
- Tutorial coming soon
- The best way to see what is wrong is to open the javascript console in the peeqo application to see the errors
- There are a few ways you can do this:
-
Hit F12
- Plug a keyboard into Peeqo. While the peeqo application is open, hit F12. This should open the console window. This will not work if the error has occurred before the F12 code could run such as errors caused by missing files or imports
-
Launch the application in debug mode with keyboard:
- Plug in a keyboard/mouse into Peeqo. Hit Alt+F4 to kill the current application (if its open).
- Open the terminal on the pi:
cd ~/peeqo/electron/
npm run debug
-
Launch application in debug mode with SSH:
ssh pi@<ip_address>
- Kill existing peeqo application (if it is running)
ps aux | grep electron
- This will return a list of electron processes.
- Find the process number of the one with
node /home/pi/peeqo/electron/node_modules/.bin/electron .
. It is usually the second one in the list kill <process_number>
cd ~/peeqo/electron/
DISPLAY=:0 npm run debug
- This will open the application on the pi. Hit Ctrl+c in ssh terminal to kill the application.
- IMPORTANT It's important to shut down the pi gracefully to prevent any potential SD card corruption issues
- You can shut down Peeqo in a few ways:
- Long pressing the button on the rear right side (when Peeqo is facing you). This will work only if the Peeqo app is running.
- SSH into peeqo or plug a keyboard in and run:
sudo shutdown -h now
Add your own custom commands
I strongly suggest having a look at the videos to add your own custom commands to better understand all the parts.
It covers everything from setting up your own project version, folder structure, understanding dialogflow, writing code, creating custom servo movements and much more.