Skip to content

Assembly

Abhishek Singh edited this page Jun 10, 2019 · 29 revisions

Getting your Peeqo up and running

  1. Unboxing
  2. Pre-Assembly Setup
  3. Assemble Peeqo
  4. Setup Wakeword
  5. Setup Dialogflow
  6. Setup Weather API
  7. Setup GIF API
  8. Software Setup
  9. Debugging
  10. Shutdown

Step 0: Unboxing

IMAGE ALT TEXT
Click on the image above to view the video

Step 1: Pre-Assembly Setup

  1. Download & unzip Peeqo Image here (~2GB download)
  2. Download Etcher https://www.balena.io/etcher/
  3. Insert included micro SD card into your computer (minimum 8GB)
  4. Launch BalenaEtcher
  5. Select peeqo.img from your computer
  6. Flash to micro SD card using BalenaEtcher

Step 2: Assemble Peeqo

Click on each image to view the video of that step

  1. Preparing the Base
    IMAGE ALT TEXT

  2. Attaching the cloth to the base
    IMAGE ALT TEXT

  3. Adding the circuit to the base
    IMAGE ALT TEXT

  4. Preparing the Servos
    IMAGE ALT TEXT

  5. 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)
    IMAGE ALT TEXT

  6. Attaching the servos to the base
    IMAGE ALT TEXT

  7. Attaching the servo arms
    IMAGE ALT TEXT

  8. Assembling the top platform
    IMAGE ALT TEXT

  9. Attaching speakers to the top platform
    IMAGE ALT TEXT

  10. Attaching top platform to the base
    IMAGE ALT TEXT

  11. Completing the cloth covering
    IMAGE ALT TEXT

  12. Attaching the bottom half of the head
    IMAGE ALT TEXT

  13. Assembling the circuit

    Note: Remember to remove the screen protector film from the LCD screen. IMAGE ALT TEXT

  14. Placing the circuit in the head
    IMAGE ALT TEXT

  15. 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.
    IMAGE ALT TEXT

  16. Adding the LED ring
    IMAGE ALT TEXT

  17. Assembling the top head and button
    IMAGE ALT TEXT

  18. Completing the build
    IMAGE ALT TEXT

Step 3: Setup Wakeword

IMAGE ALT TEXT

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.

  1. Go to https://snowboy.kitt.ai/dashboard
  2. Login using Google/Github/Facebook
  3. Type “Peeqo” in the “Search Hotwords” text box & hit enter. Only one result should turn up
  4. Click on the microphone icon near the Peeqo search result
  5. Click “Record my voice” in the popup that opens
  6. Follow the instructions and record yourself saying Peeqo three times. You will need to allow the browser microphone access
  7. Click on “Test the model”
  8. Enter the details on the left and say “Peeqo” a couple of times till it says “Test Successful”
  9. The model is now trained to respond to only you saying Peeqo
  10. Click on “Save and download”.
  11. This will create a file called Peeqo.pmdl.
  12. You will use this file later

Step 4: Setup Dialogflow

IMAGE ALT TEXT

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

  1. Go to dialogflow.com
  2. Click on “Go to console” in top right and login using your google id
  3. Grant permissions, select Country and accept terms & conditions
  4. Click “Create Agent”
  5. 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
  6. Once created, click on the cog icon near the agent name in the left hand menu to open agent settings
  7. Click on Export and Import > Import from Zip
  8. 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
  9. In the General settings of your agent, make a note of the “Project ID”. You will need this in a later step.
  10. Click on the link labeled Service Account. This will take you to your google cloud console page
  11. In the cloud console page, click on the three vertical dots in the Action column of this Service Account and select “Create Key”
  12. Make sure JSON is selected and click create.
  13. 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
  14. 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.

Step 5: Setup Openweather API

  1. Peeqo uses openweather api for current weather updates
  2. You can get a free api key by going to https://openweathermap.org/appid and signing up. A key will be emailed to you.
  3. Copy/make note of this key. You will need this key in a later step

Step 6: Setup Giphy API:

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

  1. Go to https://developers.giphy.com/
  2. Click on 'Create An App' and signup
  3. Enter any name for 'Your App Name' and a short description under 'App Description' and click 'Create New App'
  4. This will generate an API key and display it to you. You will use this key in a following step.

Step 7: Software Setup

IMAGE ALT TEXT

  1. Plug in 12V DC adapter and power up Peeqo
  2. 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
  1. Complete Initial Setup from your computer:
  • Copy over wakeword file named Peeqo.pmdl from Step 3: Setup Wakeword
    • scp 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, paste Peeqo.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
  1. 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 to config.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 named dialogflow.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
  1. 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 displayed inet 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>
  • cd ~/peeqo/
  • git pull
  1. 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
  1. Reboot peeqo:
  • sudo reboot -h now
  1. Try some commands:
  1. Add your own commands:
  • Tutorial coming soon

Step 8: Debugging:

IMAGE ALT TEXT

  1. The best way to see what is wrong is to open the javascript console in the peeqo application to see the errors
  2. 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.

Step 9: Shutdown:

  • 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

Step 10: Next Steps:

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.