Snips Installation

So, with the hardware set up, we can now go to installing the Snips Assistant application…

If you have not already done so, go to the Snips site and setup an account…they will want you to go through the brief introductory tutorial to set up an app, but you can just click your way out for now – we’ll make your first app in a bit…

Install Sam.

  1. install a utility called NPM – you can get the download here
  2. once installed, you will have a Node.js Command Prompt terminal in your program icons – use that whenever I call for a command prompt…
  3. open the Node.js terminal and type node -v …it should indicate that you have it installed and the version number…
  4. Note – all of the following entries are to be made in the PC’s terminal, not on the RPi…
  5. at the prompt, run:
    1. npm install -g snips-sam
  6. once installed, run:
    1. sam connect nnn.nnn.nnn.nnn (whatever your static RPI IP address is, e.g., 192.168.152.22)
      1. you will be prompted to enter your RPi username, type pi<enter>
      2. then, you will be prompted to enter the password, type: raspberry<enter>
    2. it will then indicate that Sam is connected…
  7. once connected, run:
    1. sam init<enter> (this will install the snips Application onto the RPi)
  8. the system will re-boot, then run:
    1. sam status<enter>
      1. you should see a report stating some services are running and some are not
  9. now we will install the support for the Respeaker 2-Mics Pi Hat, run:
    1. sam setup audio<enter>
    2. when this runs, it will first ask you Is it a Snips Makers Kit?, answer: Y<enter> – it will begin installing the drivers
    3. it will ask you which sound output you want to use – cursor down so the seeed2micvoicec line is high-lighted, and hit <enter>
    4. it will re-start some services, once complete and the prompt is back, type: sam test speaker<enter>
      1. after a slight pause, it will play “Front, right…” and repeat that until you hit the <enter> key
    5. type: sam test microphone<enter>
      1. it will display a message asking you to say something, and then to hit <enter> – it should play back what you said…
    6. you can close your Node.js window for now…

At the RPi terminal (either directly on the RPi, or via ssh from your PC), enter this line:

sudo usermod -a -G i2c,spi,gpio,audio,dialout _snips-skills

it adds our snips user to the necessary groups to allow certain app required services to run, including some for the bioloid-premium-voicekit app we will need later for the Jarvis robot…

Once you have tested your Pi Hat installation and found things to be working, it would be best to delete the the Respeaker LED-animation snips app that is installed during the above audio setup process – the app seems to conflict with some of the resources of other apps causing conflicts and unreliability…it’s a shame, because the animation app uses the three smart LEDs on the board to indicate the different conditions or states that the snips assistant is in (listening, wake-word detected, etc.), but at this point it is a problem, so, at the RPi terminal $ prompt, type:

  1. cd /var/lib/snips/skills (changes directories – you should see a new prompt: pi@raspberrypi:/var/lib/snips/skills $
  2. ls (you should see the sub-directory snips-skill-respeaker listed)
  3. sudo rm -rf snips-skill-respeaker (deletes the directory including all its files)

Create a Test App.

Note: For this test app, you will need a Grove Relay module or a Grove LED module to confirm operation; additionally, you may want to purchase the Grove Temp and Humidity sensor if you think you may want to add it to the robot later on during its assembly/setup…

  1. Login to the snips Console here
  2. Click on the My Assistants tab
  3. Click on Create New button
  4. Name your app – First Test
  5. Use appropriate language, e.g., English
  6. Click Create
  7. Click Add an App
  8. Scroll through the apps and find the app: Voice Interaction Dev Kit (EN) by SNIPS
    1. Click that app’s Add App button
    2. Click the Add 1 App button in the lower right-hand corner of the screen
  9. Close out of the snips Console

Install your First Test assistant.

  1. Using your Node.js terminal, type:
    1. sam connect nnn.nnn.nnn.nnn (whatever your static RPI IP address is, e.g., 192.168.152.22)you will be prompted to enter your RPi username, type pi<enter>
      1. then, you will be prompted to enter the password, type: raspberry<enter>
      2. it will then indicate that Sam is connected…
    2. sam status<enter>
      1. you should see a report stating some services are running and some are not
    3. sam login<enter>
      1. it will ask you for your snips Console login credentials (the ones you used to create your snips account) – enter them, and it will confirm you are logged in
    4. sam install assistant<enter>
    5. it will ask you to select your assistant – scroll to First Test and hit <enter>
      1. it will download and install the assistant, and then prompt your for some parameters – just hit <enter> for each line presented…
      2. Once it returns to the terminal prompt, say “Hey snips”
        1. you will hear a tone
          1. say “relay on”
          2. it will turn your module’s LED on and say “Relay has been turned on…”
          3. say “Hey snips”, then say “relay off”
          4. it will turn your module’s LED off and say “Relay has been turned off…”

Troubleshooting. If you have problems getting the snips assistant to run, there are a couple of tools you can use to help determine the source of the issue(s):

  • at your PC’s terminal, after the assistant is installed and running on the RPi, you can run:
    • sam status – once an assistant is installed, all services should be running except for the snips-analytics service
    • sam watch – it will show you the built-in feedback from the assistant’s real-time status and events
  • at the RPi terminal (note: expand the terminal window out so it is wide and tall in order to see the messages without word-wrapping), you can type:
    • sudo -u _snips-skills snips-skill-server -vvv – this will show you a detailed log (running in real-time) of the events going on with your skill…if there are issues, it will usually indicate where the problem is and help you resolve