element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Orange Pi PC - Google Home Project.
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: gam3t3ch
  • Date Created: 9 Nov 2017 11:07 PM Date Created
  • Views 1250 views
  • Likes 0 likes
  • Comments 0 comments
  • google home
  • orange pi
  • demo
Related
Recommended

Orange Pi PC - Google Home Project.

gam3t3ch
gam3t3ch
9 Nov 2017

So I have a few Orange Pi boards kicking around and needed to do a project with them so decided I would give a go at it and create a Google Home on my older Orange Pi PC, since these boards run like garbage just off the usb 5v you have to use a wall wart to get it to actually function correctly this was something I wasn't expecting when I bought them originally as I had already had Raspberry Pi and it was so easy to setup.

 

First thing I needed to do was to go to https://www.armbian.com/orange-pi-pc/    and download the Legacy Ubuntu Server Kernel. 

 

image

 

After flashing that on to a 8GB micro sd card with Etecher. 

 

image

It was time to give it a go and fire it up.

 

image

Perfect its working but I have had no luck getting the HDMI to work correctly on this board so had to sign in with Putty as root.   Most Orange Pi's login is  

login as:   root

Password: 1234

Then it will ask you to change all your passwords but if using another version Orange Pi make sure to check the documentation on your board for the default login.   These are cheap boards and great for just messing about that I will give it.

 

Now it was on to the  updating  you know the

sudo apt-get update

sudo apt-get upgrade

Well seems the update worked with no issues but then right after I get this on the upgrade.

image

Well guess its time to fix that.... seems like a reboot and  apt upgrade was all I needed to enter after signing in as root... works for me let the updates being.

 

I want to make it completely know I really dislike the Orange Pi's older ones anyways since the images are so hit and miss of whats working and not. Gets frustrating getting a iso to work correctly with the board sometimes let alone the image itself.

 

Now onto getting things setup first off.

 

sudo apt-get install python3-dev python3-venv

python3 -m venv env

env/bin/python -m pip install --upgrade pip setuptools

source env/bin/activate

 

Then I setup and tested the audio to make sure the mic and speaker were working

 

arecord -M -f S16_LE -r 16000 -c 1 --buffer-size=204800 -v /tmp/sample.wav  
Ctrl+C to stop then
aplay -M /tmp/sample.wav --buffer-size=204800 -v
Sounds good so now to create the .asoundrc file.  setting this with nano in terminal making a new file.  so I ran aplay -l  arecord -l to get the information for the file

 

pcm.!default {

 

type asym

capture.pcm "mic"

playback.pcm "speaker"

}

 

pcm.mic {

 

type plug

slave {

pcm "hw:0,0"

format S16_LE

}

}

pcm.speaker {

type plug

slave {

pcm "hw:0,0"

}

}

 

Then save and close that (in the home directory)

 

image

 

 

At this stage to need to make sure “Web & App Activity” with “Include Chrome browsing history and activity from websites and apps that use Google services” checked, Device Information and Voice & Audio Activity are enabled in the Activity Controls page. All options were already enabled for me by default.

 

I needed to configure a Google Developer Project. I started with https://console.cloud.google.com/project setup my project and got my OAuth information and downloaded the JSON file and opened filezilla ftp and transfered it over to my new profile on the Orange pi with ssh into the home directory.

 

After this you should be in env

So then its time to now install  the library.

python -m pip install --upgrade google-assistant-library

python -m pip install --upgrade google-auth-oauthlib[tool]

 

Then I ran the authorization tool this was quite a chore. took me a lot longer then I expected but it was working right I just wasn't reading it correctly  from my ssh window I copied the url it gave me into my web browser and then authorized the app and it gave me a code to enter when I re-ran the code

google-oauthlib-tool --client-secrets ~/client_secret_[xxxxx].apps.googleusercontent.com --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

image

And then entered the code that they gave me to enter in and then ran the demo.

 

image

 

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

on reboot all I have to do to start it is sign in and enter

 

source env/bin/activate

 

google-assistant-demo

 

I think I might make a startup file for it as well to boot directly into it but will get that done along the way when I get it to the point where its working the way I want it to.

 

Now my next steps will be to start my project but was fun this morning getting this going only took me a hour and a half and a cup of coffee.  once again I will state I don't enjoy these boards at all but I am not going to put them to waste either so mine as well put them to work.

Will update more after once I start tinkering with my own project as this was a good starting to get use to the process of working with the google cloud platform.

 

 

I am currently running it with Ethernet still have to hookup WiFi on it and also have put in a Bluetooth adapter as well.  If I have missed anything I will update later tonight.

 

 

 

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube