Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Add instructions for setting up on Raspbian in voicekit branch. #149

Merged
merged 3 commits into from
Oct 18, 2017

Conversation

t1m0thyj
Copy link
Contributor

@t1m0thyj t1m0thyj commented Oct 12, 2017

This PR is my attempt to fix #148. I've added back the files HACKING.md and systemd/voice-recognizer.service which were in the master branch. I also updated the instructions in HACKING.md to work with the voicekit branch.

IMO these files are too useful to not be present in the new branch, and having them there doesn't change the way that this project behaves for anyone who doesn't want to use them.

The way the install-services.sh script is currently written, it will automatically add any services in the systemd folder to the /lib/systemd/system folder on the Pi, including voice-recognizer.service if it is present. It will also replace any references to /home/pi in the service file, updating them to the correct installation folder. However, the service will never run unless it is explicitly enabled by the user.

@t1m0thyj
Copy link
Contributor Author

t1m0thyj commented Oct 13, 2017

I intended to create a second pull request for adding the IP address action, but that commit got combined with this one. (Sorry, I'm fairly new to using GitHub.)

@drigz commented on #138 that a PR to add this action would be welcome. There was a PR to add this a few days ago that was killed by the submitter, so I thought I would try to revive it. I initially had issues getting the "ip address" command to work, but capitalizing "IP" made Assistant recognize it.

I also added "raspberry" in front of the "power off" and "reboot" commands, and fixed the indentation of the power_off_pi() and reboot_pi() functions (changed it from tabs to spaces to be consistent and follow PEP8).

@divx118
Copy link
Contributor

divx118 commented Oct 14, 2017

@t1m0thyj FYI to make separate pull requests and also in general before working on a forked repo it is better to make your own working branches. You can do this very easily through the website of github. See https://github.com/blog/1377-create-and-delete-branches.
Note that before you type in the new name of your branch switch to the branch that you want to duplicate. Then make the changes and create a pull request. Like in your case you could have better make 2 duplicates of the voicekit branch. Use one for the files to add for setting up AIY on raspbian. The second one to make the changes to the demo. So you can make 2 separate pull requests.
BTW when string checking you could use str.lower() this would avoid problems when the assistent server returns capital letters. So text.lower() == 'ip address'

@t1m0thyj
Copy link
Contributor Author

t1m0thyj commented Oct 16, 2017

@divx118 Should I just do that in the future, or do you want me to close this PR and create new ones in the way you described?

Copy link
Member

@drigz drigz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, @t1m0thyj!

HACKING.md Outdated

## Installing the Voice HAT driver and config

To use the Voice HAT, you'll need to upgrade your kernel to 4.9, then adjust the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer true as Raspbian ships with 4.9 since 2017-07-05. Please remove the apt-get commands and add to the text something like "Your kernel needs to be 4.9 or later. This is available on Raspbian 2017-07-05 and later."

HACKING.md Outdated
sudo systemctl enable voice-recognizer.service
```

# I18N
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the I18N section, since the samples don't contain internationalized code.

@@ -50,6 +50,11 @@ def reboot_pi():
subprocess.call('sudo reboot', shell=True)


def say_ip():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split the addition of this command out into a separate PR. As @divx118 says, it's much better to split changes up - then one can be merged even if the other is still being reviewed.

HACKING.md Outdated
[setup instructions](https://aiyprojects.withgoogle.com/voice#users-guide-1-1--connect-to-google-cloud-platform) on the
webpage.

# Making code changes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This heading doesn't make sense - not all of the following text should be under "Making code changes". Maybe just add "## Running automatically" before the service bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure whether there should be 1 or two hash signs before "Making code changes" to make it either a level 1 or a level 2 header. I changed it to two, because I didn't think "Running automatically" belonged under it.

assistant.stop_conversation()
power_off_pi()
elif text == 'reboot':
elif text == 'raspberry reboot':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the addition of "raspberry". Since this is just a sample and everyone has different preferences, I prefer to keep it simple.

@t1m0thyj
Copy link
Contributor Author

t1m0thyj commented Oct 18, 2017

Removed IP address action from this PR and updated HACKING.md based on feedback.

HACKING.md Outdated
sudo scripts/install-services.sh
```

## Installing the Voice HAT driver and config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also change this header to "Configuring the Voice HAT driver" since we're not installing now?

@drigz
Copy link
Member

drigz commented Oct 18, 2017

Excellent, thanks so much @t1m0thyj!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants