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. 

 

 

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

 

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

 

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.

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)

 

 

 

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

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

 

 

 

 

 

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.