Git Product home page Git Product logo

Comments (19)

eduncan911 avatar eduncan911 commented on April 28, 2024 2

For the record, I have a blog post I am posting today to simplify how to update.

Needs a bit more proof reading first... I'll come back to post it here.

from aiyprojects-raspbian.

drigz avatar drigz commented on April 28, 2024 2

@eduncan911

I didn't think activating the virtualenv would be an issue before running install_deps.sh

The problematic command is virtualenv ..., which doesn't like being called inside a virtualenv. If we protect this with:

if [[ ! -d env ]] ; then
  virtualenv ...
fi

then it should be safe in both cases.

What about a Makefile?

I'd lean towards not to adding an "official" update procedure (eg Makefile) until we have a plugin system, as it'll lead to merge conflicts that are hard for beginners to deal with. However, maybe it would be safe if fails early early in "non-vanilla" situations (ie you've made your own commits, so master != origin/master) rather than breaking your files with merge conflicts.

from aiyprojects-raspbian.

ensonic avatar ensonic commented on April 28, 2024

The steps would be:

git add -m "<describe your change> src/action.py
git pull --rebase

Now due to the nature of having everything in one file, one most likely get merge conflicts :/ See #45 for the plan forward.

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

@sheridat Published.

http://eduncan911.com/stem/embedded/aiy-google-assistant-upgrades-may-2017.html

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

@eduncan911 Please tell your kids that your a gentleman and a scholar. Thank You so much for this - I've posted a link to it from the Raspberrypi.org forum for AIY.

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

@sheridat np. i've been meaning to this for a while, and this was an opportunity to sit down and kick it off.

i've tried registering at raspberrypi.org last week to help those with issues upgrading. but alas, their registration system never sent me an email.

FAQs says "contact an Administrator for help during registration."

Help page says, "contact an Administrator for help."

Forum software developers says, "contact an Administrator for help."

Problem is, the only way to view the Team or admins - is with an account.

If you could drop them a line, give them my username "eduncan911", that would help.

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

Hi, I followed the guidance in your blog.
At the step /scripts/install-deps.sh I got and error - the trace is below - in desperation I changed that line to sudo /scripts/install-deps.sh - it chucked out a message that it has to be run in pi - but it carried on and worked.

Running virtualenv with interpreter /home/pi/voice-recognizer-raspi/env/bin/python3
Please use the system python to run this script
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/virtualenv.py", line 2328, in
main()
File "/usr/local/lib/python3.4/dist-packages/virtualenv.py", line 713, in main
symlink=options.symlink)
File "/usr/local/lib/python3.4/dist-packages/virtualenv.py", line 925, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/home/pi/voice-recognizer-raspi/env/lib/python3.4/posixpath.py", line 357, in abspath
if not isabs(path):
File "/home/pi/voice-recognizer-raspi/env/lib/python3.4/posixpath.py", line 63, in isabs
return s.startswith(sep)
AttributeError: 'NoneType' object has no attribute 'startswith'

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

First, don't use sudo. That may install the python dependencies as system packages, which is not what you want here because the voice-recognizer project runs under its own version of packages (the env/bin directory has its own version of the packages). It didn't hurt anything. Just run it again without thesudo.

I am not sure where you are seeing this error. It's a python error, but the only python command in that shell script is:

env/bin/pip install -r requirements.txt

Try this:

cd ~/voice-recognizer-raspi
env/bin/pip install -r requirements.txt

And see if that completes. If so, run scripts/install-deps.sh again. If it still errors:

cd ~/voice-recognizer-raspi/scripts
install_deps.sh

Shouldn't have to though.

from aiyprojects-raspbian.

drigz avatar drigz commented on April 28, 2024

@sheridat, @eduncan911: I got that error when I ran install-deps.sh from inside the "dev terminal". Currently it's designed to be run just once from a normal terminal.

Possible fix:

  • adjust install-deps.sh to avoid recreating the virtualenv if it already exists
  • on your page, move install-deps.sh before activate

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

@drigz @eduncan911
HI could you hold my hand a bit more - do you mean from inside the dev terminal rather than running this sequence

UPDATE GOOGLE ASSISTANT SDK

cd ~/assistant-sdk-python
git checkout master
git pull origin master

UPDATE VOICE RECOGNIZER (AKA: AIY PROJECTS)

cd ~/voice-recognizer-raspi
git checkout master
git pull origin master

UPDATE DEPENDENCIES

cd ~/voice-recognizer-raspi
source env/bin/activate
scripts/install-deps.sh

I should run the first two updates as is - and the

UPDATE DEPENDENCIES as follows

cd ~/voice-recognizer-raspi
scripts/install-deps.sh
source env/bin/activate

Thank You both for your help

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

@drigz thanks for the input!

Thinking back, yeah I did delete the env virtualenv a few times as I was upgrading and moving things around. I'll submit a PR tweak for that here as the open PRs and other commits seem to be modifying this install_deps.sh file for the primary source of dependencies going forward (think system packages installs, as well as pip installs). Makes sense to keep it all here, though I would think it belongs in the root directory.

I do everything via ssh remotely, no Dev Console.

I didn't think activating the virtualenv would be an issue before running install_deps.sh (just good practice to keep someone always in a virtualenv - especially if they don't know Python and opening/closing terminals). Within install_deps.sh it runs sudo pip3 for system wide packages, and then purposely runs env/bin/pip for install in that location. But you may be right that it is conflicting.

What if I modified the install_deps.sh to activate the virtualenv, instead of running env/bin/pip?

That way, it continues with best practices and doesn't confuse newcomers trying to read what that script does (I actually didn't know you could run env/bin/pip install like that without a virtualenv until I saw that script in this repo - always thought you had to activate the virtualenv).

What about a Makefile?

I could throw one together as well, that would also include git pull and such.

make install
make upgrade
make run

Kind of thing.


@sheridat

Sorry you having so much trouble as the upgrade process was a summation of my, troubles, getting things upgraded. Yes, I think @drigz is correct that the directory already exists.

This will work (close your terminal and start over).

I see the "OK Google" hotwording has been merged in! I just ran through these scripts and it worked:

(yes, git pull the latest always - this is especially important for the voice-recognizer-raspi directory to do very very often)

cd ~/assistant-sdk-python
git checkout master
git pull origin master

cd ~/voice-recognizer-raspi
git checkout master
git pull origin master

cd ~/voice-recognizer-raspi 
rm -rf env
scripts/install-deps.sh

And follow the rest of my blog post to enable hot wording and so on.

Also, I noticed the install script doesn't copy the new config files. This is preferred, yes, so it doesn't override your existing config files.

But, if you want the latest config, you may want to:

cp ~/.config/status-led.ini ~/.config/status-led.ini~
cp config/status-led.ini.default ~/.config/status-led.ini
cp ~/.config/voice-recognizer.ini ~/.config/voice-recognizer.ini~
cp config/voice-recognizer.ini.default ~/.config/voice-recognizer.ini

And then open the config files and edit them again to your liking (e.g. ok-google option).

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

i don't think it would hurt anything. env/ is just the local packages installed for the python app to use. It gets built from the original scripts/install-deps.sh execution you did a while ago.

I've deleted mine several times (just did it again before posting my last comment, to ensure it works). and then rebuilt it with scripts/install-deps.sh.

I do everything from a non-Dev terminal (actually, remotely as I ssh in). So if you run into any issues, yeah close the Dev terminal and run a normal one.

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

Btw, I updated the blog post...

Added everything we talked about here.

Also added a new section on the latest Config File changes, and how to update them.

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

from aiyprojects-raspbian.

eduncan911 avatar eduncan911 commented on April 28, 2024

nah, it's the guys actually doing the work here. (they just merged the OK Google hot wording! updated my post to reflect it's live!)

from aiyprojects-raspbian.

sheridat avatar sheridat commented on April 28, 2024

Just had my first game of trivia - fantastic!!!
Thank You everyone for all this help.

from aiyprojects-raspbian.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.