-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DietPi-Software | Google Assistant SDK and AIY kit. #1065
Comments
I haven't tested the SDK installer yet, but I've gotten the installer for the AIY kit to work, by adding these to dietpi-software: Added to the end of the:
Just after the section:
Just before:
I get all the way through the process (after several hours of fiddling about), but still get the following errors:
Frustrating! EDIT: Maybe a similar problem: xtools-at/AssistantPi#5 |
I have just opened an issue on Google's AIO projects' Github: |
Hi Rich,
I don't, but I believe i'll need to obtain one if I'am to be any assistance here. It seems a large implementation that would need much testing, although you've done great so far, looks good.
Seems the microphone is failing open a ALSA stream. If the AIY kit image works flawlessly, it could be a lack of documentation for the manual installation, or a slip in the configuration somewhere.
It looks all in order, however, I usually have everything outside of any DietPi scripts, in note form, before I implement it. You will have issues with your Cant see to find a copy of the MagPi 57 anywhere for purchase lol. I'am assuming the voice hat is required for this project (https://github.com/google/aiyprojects-raspbian)? |
It may be worth trying https://github.com/google/aiyprojects-raspbian/blob/master/HACKING.md#setting-up-the-image on Raspbian. If that is successful, we could compare the installs and try to find out why it only fails on DietPi. |
Doesnt seem like the dtoverlay is loaded for voice hat? Are these applied to Applied to |
Thanks for the feedback. 🥇
I was thinking along those lines, last night, before my brain melted. ;)
I'll take a look. I won't have as much time to hack on this during the week, but I'll do my best. :)
Hehe. Yeah. I think that every copy on the planet sold within two days! I've gotten a reply over at the other issue page, so I'll have a go with his suggestion there, too:
It could be something to do with HDMI: I set it up headless with |
🥇 🥇
Bingo! |
https://github.com/google/aiyprojects-raspbian/tree/master/scripts scripts/install-deps.sh:
(puts scripts/install-services.sh:
(tries to use scripts/configure-driver.sh:
(writes to scripts/install-alsa-config.sh:
(tries to use Fixing these should do the job, hopefully... |
Would it be possible to use some sort of globally applied alias' to catch these sorts of things in dietpi? Or maybe some symlinks, or something, so we don't have to alter any such code again? Some catch-alls? It'd be handy to have stuff redirected to Changing where If this is too problematic, perhaps the code could be altered upstream to make it a little friendlier to non-standard distros. EDIT: Having thought about it, though, it might just be easier to stick the whole thing in /home/pi and run the whole thing as user pi. |
Success! I just disabled the sound through Audio Options, changed the scripts and it works! The light in the arcade button on top triggers voice recognition, though doesn't flash like it should and the service is broken; but I think we can both see what's wrong, there:
scripts/configure-driver.sh:
scripts/install-alsa-config.sh:
Once those services in the first script are all sorted out, it should work perfectly! My next job will be to do the same thing with the Assistant SDK, so you can try it out on some of your hardware. (You'll just need a mike and sound output.) |
Yep, they could use
I can make this easier by adding the soundcard as an option in
Try running that command manually, if it fails, should give you some verbose information.
Yep 👍 |
Adding the following lines to the installation entry fixes all outstanding issues and the AIY Kit now seems to work perfectly:
The suggested dietpi-software entries would therefore be:
To automatically start on boot, run EDIT: From what I can tell from the project's Github, I believe that this should work on any Raspberry Pi (and maybe other devices), without needing the Voice Hat; so there should be no need to have a separate install option for the SDK. We just have to use different sound devices and alter the file '~/.config/voice-recognizer.ini':
i.e. Change |
I haven't had a lot of time to look at this over the last couple of days, but I have just been looking through 'dietpi-config'. I am trying to figure out how to add an option for the AOI Hat sound hardware. I'm trying to get this down pat, which may take a little time, but I'd just like to ask if you have any templates or tools, which help you construct the statements to do this stuff. I'd also like to add an option to install a relay driver called Crelay, which allows the control of USB and GPIO relays from a Linux machine, via the command line, as well as providing a simple web interface. This would be very useful for hardware hackers (including myself), and will expand the appeal of DietPi (especially if voice control can be integrated). ;) EDIT: I have gotten this to work on a Linux x86-64 desktop and a Raspberry Pi (in minutes) by following the instructions on the GitHub page. |
I've been at work all week and did the best I could, but I have finally had the chance to go through the The Maybe someone else involved in the project might be able to help with this, if they have the knowledge? |
Hi Rich,
Yep, DietPi-Config uses multiple external script functions to apply its settings. The main one is Is the DietPi-Config additions you are trying to apply, for the voice HAT soundcard?
I'll write up the steps needed to add this today, or, I can make the changes here and send the commit?
Know the feeling lol 👍 |
Guide for adding soundcards: Should cover it, but let me know if any issues/unsure. |
This would make a great |
Thanks for the quick response.
Thanks for the walk-through: You might want to consider adding this to the
Well, It looks like I've got until v155 comes out, to get this sorted. :-) If I don't get enough time, I'd appreciate it if you would do the honours, but it shouldn't come to that; I'll have a proper look at this ASAP and then post my attempt. At the end of the day, you're gonna have to be satisfied with it (and test it, to make sure it doesn't break anything else), before you add it to the main release. https://github.com/ondrej1024/crelay
I want to have a go at adding this to My top priority in this is to make sure that the Voice installer works on a 'vanilla' RasPi and then add an option to turn on the extra functionality of the AIY Hat. (Meaning sound drivers: The rest of the functions, I think, just re-map the GPIO pins.) Thanks again, |
Hi Rich,
Thanks, great suggestion 👍
Yep no worries, regardless, good stuff for giving it a go, most people don't lol 😄 . If you get no joy with it, let me know and i'll implement what you have. I'll do additional testing aswell.
Hehe, I put in the milestone for my benefit, mainly to stop me from forgetting/mislaying the ticket. We can always move this to v200 if it requires it 😉
Perfect 👍 |
Thanks @Fourdee. ...processing... |
Google Voice Hat Drivers: Hi, Dan: I've just spent a couple of hours on this (since 8:30ish) and here is my take; based of my current understanding: Straight from my notes, from this morning: Please look in https://github.com/google/aiyprojects-raspbian/tree/master/scripts. Step 1. In /DietPi/dietpi/func/dietpi-set_hardware: Under "# - Disable known soundcard dtoverlays":
Under "Soundcard_Main()":
Under "# - Apply asound.conf": This is where I'm starting to get way out of my depth: The script voice-recognizer-raspi/scripts/install-alsa-config.sh simply backs up the originals and then copies voice-recognizer-raspi/scripts/asound.conf into /home and /etc. I think that the contents of voice-recognizer-raspi/scripts/asound.conf should be added to the end of the #googlevoicehat-soundcard entry. i.e:
Step 2. In DietPi/dietpi/dietpi-config Under "Menu_AudioOptions()": Add the menu option:
Please take a look and see if any of it is OK, based off of Google's own method; which seems to work. |
Great work 👍
Should not be required. In DietPi, enabling an overlay will disable the onboard soundcard, resulting in the addon card being the 1st device index
Tricky. Quick solution may be be to remove that reference in the install script, prior to running it, eg:
This needs to be put at the end of
Just noticed these are additional overlays, that wont exist in
Then also add removal lines in the reset section:
|
This thread is starting to get very long now, so I'll be as brief as I can be. :) I've read over your last reply and I think I see what you're doing there and follow it ~99%. I think It's about time you took charge of this one now, if that's OK. I now see that, with the possible exception of I know that you'd probably prefer to be able to test this on your own Voice Hat hardware, but I'm more than happy to do this. This will take forever if I try to write it all myself, in the limited time I have. From what I can see, we've got enough of this sorted out, that you might as well go ahead and give me something to test. If I get positive results, both with and without the Voice Hat, we can try it out on a variety of hardware. As the scope of this has now changed in my mind, I think that it might be best to call it:
And maybe miss out the Let me know what you think. EDIT: Oh yeah, we should probably make it default to trigger with 'OK Google', rather than using the button on top (GPIO - pin23, I think):
It might be best to have a couple of different config options to turn this stuff on-and-off, if you see what I'm saying... Though I don't want to over-complicate things, at this stage... |
Hi, Dan. I got to the stage, three days ago where I started to think "This is way to complicated for me" and I kinda bailed. It was unfair of me to be throwing this thing into your lap, especially as you have your own busy schedule and have other considerations and priorities (as well as a roadmap to follow). I basically realised that there were, very likely, several more pieces to this jigsaw than I'd considered and I decided that I needed to take a break. After taking this break and giving it a couple of days, I realised that the best way for me to get my head around this, would be for me to have a stab at working at an installer for the Crelay driver / controller / web interface; which I mentioned before. To this end, I have opened an issue for this at https://github.com/Fourdee/DietPi/issues/1091. We have covered the installation stage for the software and drivers here, but the parts of the process I hadn't considered, up until now, are updating and uninstalling. (I think that you might be able to give me some pointers around this in the other thread). I also need to test the stuff we have discussed here, too. To this end, I have set up a DietPi image on a Pi3 running BerryBoot, which I have configured, updated and then cloned, in order to make repeated reinstallations fast and manageable, directly on a RasPi. (Thanks for that work, by the way). I will try to devote as much time as I can to these, this weekend, as I'm going for an "Unplugged Holiday" soon, so I need to get my affairs in order :). As you said: It can wait until "version-whatever", but I would like to include this soon. Please take a look at the links above and over the next couple of days, give me some feedback so that I will hopefully be able to use any insights that I can gain from the process, and help me figure out all of the steps that I need to follow here. If you are on a deadline, please disregard this. Rich. |
Just an FYI... Google seem to have reworked their code and created a new branch with a new API. The good news is that they appear to have rewritten their install scripts to allow for non-standard install paths. I haven't had a chance to give the new code a go. I will have a try over the weekend. They say there is no migration path from the old to the new code layout / API, so you are required to do a clean install. |
Thanks for the heads-up @mpember. I do actually remember hearing something about this a while back, but didn't have the chance to check it out. I'll have to look it over. Did you manage to try it out, in the end? |
I did. Since it was a bit of a hatchet job (by me), I can't be 100% sure that the steps are 100% accurate. That said... Remove the old service configs. The new codebase is not designed to use the fragmented service structure. Download the new AIY code Install driver and ALSA config (If doing a clean install) There is only one file in the new "voicekit" code that still uses a hard-coded home path. I have raised this as an issue with Google and gotten no response. The new code only comes with examples for a service script using the new structure. They no longer provide a systemd config file Their assumption is that developers should be integrating the code into a custom project and not simply cloning a Google-provided service. If you want to see the files that I use, they are available here. The bit I didn't document was the rebuilding of the 'env' contents for the new code. I butchered it due to my own incompetence and it is likely someone with a better knowledge of python will know exactly which steps are required. I have successfully upgraded both of my AIY kits to use the new system and they are working fine. If there are any questions, just shout. |
Finally got one on order. Once it arrives i'll be able to get involved in this ticket. |
@Fourdee |
It looks like the voicekit has been updated to contain a systemd service config file and the expected script name for the service will remain as main.py (in the /mnt/dietpi_data/voice-recognizer-raspi/src folder). Since the instructions are to copy one of the examples to main.py, it may be worth chucking a note somewhere to inform users where to locate the files. I understand that most DietPi users with a voicekit are likely to familiar with the setup, but it should protect against the odd 'I installed it and it doesn't work' forum posts. |
Notes: |
+ DietPi-Software | Google AIY: Now available for installation: https://github.com/Fourdee/DietPi/issues/1065
+ Soundcard Google AIY: https://github.com/Fourdee/DietPi/issues/1065
Pretty much done. Will run one more test install to check installation and online guide. |
I now see why the Google AIY kit is worth a purchase, so much fun 👍 |
Is there a need to have the service run as root? Mine is working fine as the dietpi user. |
+ run as dietpi user : https://github.com/Fourdee/DietPi/issues/1065
Tested and completed. |
Thank you so much for this, @Fourdee! Also; thanks for your input, too, @mpember. It would not have been possible without you. This stuff is going to be a moving target and is one of Google's top priorities, so I am in awe of what has been accomplished here.
I got lucky, in a way: When I subscribed to the MAGPI and got this kit, a year ago, I immediately jumped on the hype train. As the magazine transitioned to what it is now and became a fully legitimate, commercial publication, I was happy to join in. I really don't think that most people understand how much joy can be derived from these sorts of projects. It was so much fun playing with this.... :) Ordinary users, like myself, can make small, but significant contributions to the development of these embedded platforms; but it takes lots of work and it is not easy at all. Much Respect, Rich |
FYI, Google have changed the default branch to be the new vision-based kit. This means that the script needs to explicitly request the voicekit branch. |
Many thanks, confirmed with their online doc:
|
+ DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388
Completed. |
**v6.0** (previously v160) (28/01/18) **Important Information:** **All DietPi images have been re-created. Existing installations (v159 or lower), can no longer be updated, or supported. To continue support, users must install the latest v6.0 image.** - https://github.com/Fourdee/DietPi/issues/1385 - All images are now Debian Stretch (excluding Odroid's) - ARMbian based images are now mainline kernel 4.13+. - Native PC (EFI): is now an ISO, with clonezilla bundled. Simplifies installation via Rufus write: https://github.com/Fourdee/DietPi/issues/1171#issuecomment-336522021 - If you are happy with your existing installation of v159 (or lower), you are not required to install the v6.0 image, however, we cannot continue to provide support for v159 (or lower) installations. **Minor notes:** The XMAS tree has now been taken down, stored away on github history for next year. Hope you all had a good one :D **Changes / Improvements / Optimizations:** General | DietPi RPi kernel, now reverted to stock RPi kernel: https://github.com/Fourdee/DietPi/issues/1378 General | We have completed much needed backbone work for DietPi, which will allow for improved expansion in source code. This includes the use of dietpi-globals. DietPi-Globals | New script which optimizes most used DietPi commands and vars, throughout our scripts. Also exported to bash session, please type 'G_' then press 'TAB' to see a full list of options: https://github.com/Fourdee/DietPi/issues/1311 General | FHS compliance completed. /etc/dietpi has moved to /var/lib/dietpi. RAMlog store has moved to /var/tmp/dietpi: https://github.com/Fourdee/DietPi/issues/1297#issuecomment-352241193 General | We have refreshed our terminal messages look & feel, oriented on RPi boot messages, and with process animation: https://github.com/Fourdee/DietPi/pull/1377 General | wget: Now set to prefer IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | APT: Now set to force IPv4 by default (generally faster, can be changed by 'CONFIG_PREFER_IPVERSION' in dietpi.txt): https://github.com/Fourdee/DietPi/issues/1285#issuecomment-353230187 General | SparkySBC: CPU gov default changed to Performance, reports of increased stability. General | Swapfile generation is now completed during 1st run of dietpi-software (previously boot stage): https://github.com/Fourdee/DietPi/issues/1270#issue-278797206 General | DietPi-Funtime: Removed from DietPi. Although it looked pretty, it did absolutely nothing (except slow down a program) DietPi-Automation | All dietpi.txt entries have been renamed and cleaned up. DietPi-Automation | dietpi.txt: CONFIG_NTP_MODE will now be applied during 1st run of device: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Boot | Improved the method of initial FS_partition and FS_expansion during 1st run, via systemD services. 'fs_force_resize=' in dietpi.txt is no longer supported: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-352159930 DietPi-Banner | IP: Will now also list the active network adapter used (eg: eth0/wlan0) DietPi-Config | Dion Audio LOCO V1/V2: Soundcards added for RPi. DietPi-Config | Locale: en_GB.UTF-8 is now automatically installed, alongside user selected choice. Required for DietPi scripts to function. DietPi-Drive_Manager | Added support for exFAT, many thanks @MichaIng : https://github.com/Fourdee/DietPi/pull/1312 DietPi-Globals | Global variables and functions are now exported during login. Please see the sourcecode for more information: https://github.com/Fourdee/DietPi/issues/1311 DietPi-Set_Hardware | Sparky SBC: enable aotg.aotg1_speed compatibility setting for USB 1.1, when USB-DAC configured: https://github.com/Fourdee/DietPi/issues/1301 DietPi-Set_Software | "pool" directive is now used for NTPD: https://github.com/Fourdee/DietPi/pull/1404 DietPi-Software | NAA Daemon: Updated to latest (3.5.2-36). Existing installs will be patched automatically: https://github.com/Fourdee/DietPi/issues/1305 DietPi-Software | PHP-FPM: Increased from "$CPU_CORES_TOTAL" to "pm.max_children = $(( $CPU_CORES_TOTAL * 3 ))". This should avoid failed forking of PHP-FPM processes/requests : https://github.com/Fourdee/DietPi/issues/1298 DietPi-Software | ownCloud/Nextcloud: Added option to choose data directory via dietpi.txt pre installation: https://github.com/Fourdee/DietPi/issues/1314#issuecomment-352782055 DietPi-Software | ownCloud/Nextcloud: Switch to pretty URLs (without "index.php") on Apache DietPi-Software | ownCloud/Nextcloud: Automated backup restoring on install and creation und uninstall to ownCloud/Nextcloud data directory DietPi-Software | ownCloud: Switch to non-package/archive installation. This allows usage of preferred web based updater. DietPi-Software | Nextcloud: Resolved OPcache admin panel warnings now also on Lighttpd DietPi-Software | UrBackup: Installation updated to latest version 2.1.20. For new installations only: https://github.com/Fourdee/DietPi/issues/1335 DietPi-Software | NodeRed: Corrected user which nodered runs under, now runs as its own user, created during install: https://github.com/Fourdee/DietPi/issues/1294#issuecomment-354314318 DietPi-Software | SqueezeBox/LMS (Stretch): Installation resolved: https://github.com/Fourdee/DietPi/issues/1124 DietPi-Software | MySQL: Completely remove MySQL from DietPi in favour of MariaDB: https://github.com/Fourdee/DietPi/issues/1397 DietPi-Software | Ampache: MySQL DB and configs have been updated (adds correct userdata folder for music by default): https://github.com/Fourdee/DietPi/issues/1420 run_ntpd | Added support for systemd-timesyncd completion/detection: https://github.com/Fourdee/DietPi/issues/1379 **Bug Fixes:** General | Fixed two systemd error messages during shutdown and boot: https://github.com/Fourdee/DietPi/issues/1330 DietPi-Automation | Resolved an issue where AUTO_SETUP_TIMEZONE was not being applied correctly, thanks @k-plan: https://github.com/Fourdee/DietPi/issues/1285#issuecomment-356310496 DietPi-Automation | dietpi.txt: CONFIG_NTP_MIRROR will now be applied to systemd-timesyncd configuration: https://github.com/Fourdee/DietPi/issues/1379 DietPi-Config | Resolved an issue with WiFi Country code, failing to set on some devices: https://github.com/Fourdee/DietPi/issues/838 DietPi-Config | Resolved an issue where disabling IPv6 didn't have an effect on AMD64 devices: https://github.com/Fourdee/DietPi/issues/1343#issuecomment-359652751 DietPi-Services | dietpi-wifi-monitor: Is no longer controlled, to prevent WiFi drop during software installs/updates etc: https://github.com/Fourdee/DietPi/issues/1288#issuecomment-350653480 DietPi-Software | General: MySQL using software titles now have their own database user, instead of accessing as "root": https://github.com/Fourdee/DietPi/issues/1397#issuecomment-359655198 DietPi-Software | qBittorrent: Resolved an issue with inability to log into web interface: https://github.com/Fourdee/DietPi/issues/1366 DietPi-Software | Resolved an issue where our custom LD_LIBRARY_PATH would cause APT failures. LD_LIBRARY_PATH has now been reverted, apologies if this effected your system: https://github.com/Fourdee/DietPi/issues/1329 DietPi-Software | Resolved an issue where APT installations would fail if services were masked. All known DietPi software services, will be enabled/unmasked, before installation: https://github.com/Fourdee/DietPi/issues/1320 DietPi-Software | WiFi Hotspot (Stretch): Resolved an issue where hostapd would fail to run due to missing libssl1.0.0 lib, not available in repos: https://github.com/Fourdee/DietPi/issues/1299 DietPi-Software | Shairport-sync (Stretch): Resolved an issue where this would fail to install, due to pre-req URLS becomming invalid: https://github.com/Fourdee/DietPi/issues/1303 DietPi-Software | Plex Media Server: Resolved uninstall to include /var/lib/plexmediaserver in removal (which is not completed via apt purge). DietPi-Software | MariaDB: Resolved an issue where MariaDB would fail to uninstall correctly: https://github.com/Fourdee/DietPi/pull/1280 DietPi-Software | Aira2 (Stretch): Resolved installation, now used APT installation: https://github.com/Fourdee/DietPi/issues/1310 DietPi-Software | Mosquitto: Resolved various issues with failed install, due to Mosq repo not being maintained (deb's missing from repo header list, requires non-stretch available packages). deb's are now hosted on dietpi.com: https://github.com/Fourdee/DietPi/issues/1306 DietPi-Software | ownCloud/Nextcloud: Fixed an installation issue on Jessie with MariaDB: https://github.com/Fourdee/DietPi/pull/1319 DietPi-Software | Google AIY: Updated install to gitbranch=voicekit. Many thanks to @mpember for the heads up: https://github.com/Fourdee/DietPi/issues/1065#issuecomment-354304388 DietPi-Software | OpenJDK: Replaces OracleJDK: https://github.com/Fourdee/DietPi/issues/1401 DietPi-Update | dietpi.txt is now checked for missing entries, and, will now be patched during the update: https://github.com/Fourdee/DietPi/issues/1292#issuecomment-350818969 Sparky SBC | Kernel updated, which resolves issues with HQPlayer playback: https://www.computeraudiophile.com/forums/topic/32132-allo-sparky-usbridge/?do=findComment&comment=753100 **Allo Web Interface v5:** Sparky SBC: Matrix Audio X-SPDIF 2, native DSD is now added to kernel, many thanks @sudeep: sparkysbc/Linux#3
Hey Dan,
A while back, I received one of those funky, DIY, cardboard Google assistants from the MagPi:
https://aiyprojects.withgoogle.com/voice/
I decided to have a go at adding this functionality to DietPi, by adding two new installation options to DietPi-Software: One for the standard Assistant SDK and one for the AIY kit.
For each of these options, I have tried to implement the instructions from each of the following sites, respectively:
SDK: https://developers.google.com/assistant/sdk/prototype/getting-started-pi-python/run-sample
AIY Kit: https://github.com/google/aiyprojects-raspbian/blob/master/HACKING.md#setting-up-the-image
Could you please take a look at my attempt at this in the link below and let me know if I have done it correctly. I will have a go at testing this soon, but I wanted you to take a look first; this is my first attempt at doing this sort of thing myself.
R1CH-T@b5b8f1c
Thanks, Rich.
P.S. Do you have one of the AIY Kits, yet?
The text was updated successfully, but these errors were encountered: