私的AI研究会? > Google Cloud Platform

Google Cloud Platform (改定版)

登録と設定 (詳細手順)

 2019/06「Google Assistant Library」の破棄に伴い 書籍「Raspberry Pi + AI 電子工作入門」の手順が実行できなくなったよう。
2020/02 頃までは若干の推測を追加することで何とかある程度の実行が可能だった。
 参照 → 「Google Cloud Platform」登録と設定?

2020/03/05 現在のプロジェクトを進行する方法を検証した。
以下、(ページ数) は「Raspberry Pi + AI 電子工作入門」の該当ページを示す。

事前準備として Googleアカウント(Gmailアカウント)を用意

(姓)いづつ (名)まさひろ
(ユーザー名) idzutsumasahiro@gmail.com
(パスワード) *********
(電話番号) XXX-XXXX-XXXX
(メールアドレス) XXXXXXXXX@XXXXX
(生年月日) XXXX/XX/XX
(性別) 男性

「Google Cloud Platform」登録と設定

#ref(): File not found: "cloud_003s.jpg" at page "Google Cloud2"

(1) https://console.cloud.google.com でクラウド・プラットフォーム・コンソールにアクセスする。

左のような画面となった場合はすでに Googleアカウントでログインしている。
作成したアカウントと異なる場合は「赤印」をクリックしてアカウントを変更する。
(Googleアカウントは複数運用ができるので常に現在のアカウントの確認が必要)

#ref(): File not found: "cloud_004s.jpg" at page "Google Cloud2"

(2) 初回ログイン時のみ左の承認画面が表示されるのでチェックして「同意して続行」を押す。

#ref(): File not found: "cloud_005s.jpg" at page "Google Cloud2"

(3) 続けて表示される画面で「プロジェクトの選択」を押す。

#ref(): File not found: "cloud_006s.jpg" at page "Google Cloud2"

(4)「新しいプロジェクト」を押す。

#ref(): File not found: "cloud_007s.jpg" at page "Google Cloud2"

(5)「プロジェクト名」を入力。

#ref(): File not found: "cloud_008s.jpg" at page "Google Cloud2"

(6) もう一度「プロジェクトの選択」を押す。

#ref(): File not found: "cloud_009s.jpg" at page "Google Cloud2"

(7) 登録された「RaspberryAi2」プロジェクトを選択。

#ref(): File not found: "cloud_010s.jpg" at page "Google Cloud2"

(8)「RaspberryAi2」プロジェクトの情報が表示される。(140ページ)

「Google Assistant API」の有効化

#ref(): File not found: "cloud_021s.jpg" at page "Google Cloud2"

(9)「Assistant API」のURLは変化しているようだ。前記の画面の検索窓にAssistant と入力する。(左画面)

#ref(): File not found: "cloud_022s.jpg" at page "Google Cloud2"

(10) 表示された左画面(141ページ)の「有効にする}をクリックする。

#ref(): File not found: "cloud_023s.jpg" at page "Google Cloud2"

(11) 表示される左画面(142ページ)の「Learn more」を押す。

#ref(): File not found: "cloud_024s.jpg" at page "Google Cloud2"

(12) 2020/03/05 現在左画面に遷移する。画面右上の「Go to Action Console」を押す。

 

Assistant SDK クラウド設定

「Action on Google」プロジェクトの作成

#ref(): File not found: "cloud_025s.jpg" at page "Google Cloud2"

(13) 画面右上の現在ログイン状態のユーザーを確認し「New Project」を押す。

#ref(): File not found: "cloud_026s.jpg" at page "Google Cloud2"

(14) 初回のみ左の承認画面が表示されるのでチェックして「同意して続行」を押す。

#ref(): File not found: "cloud_027s.jpg" at page "Google Cloud2"

(15) 新規プロジェクト作成画面が表示される。(144ページ画面)

#ref(): File not found: "cloud_028s.jpg" at page "Google Cloud2"

(16) 新規プロジェクト画面が表示される。(145ページ)

「Google API」認証情報の設定

#ref(): File not found: "cloud_031s.jpg" at page "Google Cloud2"

(17) https://console.developers.google.com/apis/credentials/consent にアクセスして表示される左画面上部の「プロジェクトの選択」を押す。

#ref(): File not found: "cloud_032s.jpg" at page "Google Cloud2"

(18) 表示される左画面でプロジェクト「RaspberryAI2」を選択する。

#ref(): File not found: "cloud_032as.jpg" at page "Google Cloud2"

(19) 左画面の表示となった場合、右上のログイン状態を確認して左カラム「OAuth 同意画面」を選択。

#ref(): File not found: "cloud_034s.jpg" at page "Google Cloud2"

(20)「アプリを編集」を押す。

#ref(): File not found: "cloud_033s.jpg" at page "Google Cloud2"

(21)「Google API 認証情報の設定」画面が表示される。145ページ下)

#ref(): File not found: "cloud_034s.jpg" at page "Google Cloud2"

(22)「Google API 認証情報の設定」完了画面。

アクティビティの設定

#ref(): File not found: "cloud_041s.jpg" at page "Google Cloud2"

(23) https://myaccount.google.com/activitycontrols にアクセスして「ウェブアプリのアクティビティ」がON、「音声録音を含める」にチェックが入っていることを確認する。

#ref(): File not found: "cloud_042s.jpg" at page "Google Cloud2"

(24) 画面を下にスクロールし、「[デバイス情報の設定]は、[アクティビティ管理]から移動しました」の項目の「アシスタントでのデータ」をクリックする。

#ref(): File not found: "cloud_043s.jpg" at page "Google Cloud2"

(25) 表示される左画面を下にスクロールする。

#ref(): File not found: "cloud_044s.jpg" at page "Google Cloud2"

(26)「Google 全体にわたる管理」の項目の「ウエブとアプリのアクティビティ」「音声録音」「デバイスのアプリ情報」をONにする。(ONになっていることの確認)

モデルの登録

「Device Regstration」メニューが該当画面から削除され、「REGISTER MODEL」の登録ができなくなっている。
これまでに登録されたものは表示されるので、メニューから隠されているだけだと判断し、以下の操作を探し出した。

#ref(): File not found: "cloud_051s.jpg" at page "Google Cloud2"

(27) https://console.actions.google.com/ にアクセスして左画面を表示する。

登録されているプロジェクト「RaspberryAi2」をクリック。
表示される画面に従って下のように遷移する。

#ref(): File not found: "cloud_052s.jpg" at page "Google Cloud2"

#ref(): File not found: "cloud_053s.jpg" at page "Google Cloud2"

#ref(): File not found: "cloud_054s.jpg" at page "Google Cloud2"

#ref(): File not found: "cloud_055s.jpg" at page "Google Cloud2"

 

#ref(): File not found: "cloud_056s.jpg" at page "Google Cloud2"

(28) 左画面の表示になったら、アドレスバーのURL の最後の方 プロジェクト番号の後の /actions//deviceregistration/ に変更してページを表示する。

#ref(): File not found: "cloud_060s.jpg" at page "Google Cloud2"

(29)「Device Registrer Model」の登録画面が表示される。(147ページ下)

#ref(): File not found: "cloud_061s.jpg" at page "Google Cloud2"

(30) デバイス登録する。(148ページ上)

#ref(): File not found: "cloud_062s.jpg" at page "Google Cloud2"

(31) 証明書ダウンロードのページが表示される。
Windowsの場合(Edge/IE)ダウンロードボタンを押してもダウンロードできない(2020/03/05現在)ので次に進む。

Traitsの設定

#ref(): File not found: "cloud_063s.jpg" at page "Google Cloud2"

(32)「All 7 traits」を選んでSAVE する。

#ref(): File not found: "cloud_064s.jpg" at page "Google Cloud2"

(33) デバイスの登録が終わるとデバイス一覧に表示される。

 

証明書の再取得

#ref(): File not found: "cloud_051s.jpg" at page "Google Cloud2"

(34) https://console.actions.google.com/ にアクセスして左画面を表示する。

登録されているプロジェクト「RaspberryAi2」をクリック。

#ref(): File not found: "cloud_052s.jpg" at page "Google Cloud2"

(35) 左画面の表示になったら、画面左上のメニューボタンを押す。

#ref(): File not found: "cloud_0521s.jpg" at page "Google Cloud2"

(36) 画面左上のメニューから「OverView」→「Develop」と選択する。

#ref(): File not found: "cloud_0522s.jpg" at page "Google Cloud2"

(36) 画面左のメニューから「Device registration」を選択し、メニューを閉じる。

#ref(): File not found: "cloud_064s.jpg" at page "Google Cloud2"

(37) デバイス一覧の画面から証明書の再取得ができる。

 2020/03/05 現在 Windows10(Edge/IE)では、ダウンロードボタンを押してもダウンロードできないので別の方法で取得する。

#ref(): File not found: "cloud_065s.jpg" at page "Google Cloud2"

(38) 左画面が表示されたら「Google Chrome」を起動し、左画面のURL をコピーして「Google Chrome」の検索窓にペーストし、「Google Chrome」に同じページを表示させる。

#ref(): File not found: "cloud_070s.jpg" at page "Google Cloud2"

(39) 「Google Chrome」ブラウザ画面右の「Download OAuth 2.0 credentals」を押して証明書をダウンロードする。

#ref(): File not found: "cloud_071s.jpg" at page "Google Cloud2"

(40) 「Google Chrome」ブラウザ画面左下のダウンロードが終了したらファイルの場所を開く。

#ref(): File not found: "cloud_072s.jpg" at page "Google Cloud2"

(41) 証明書 (XXXXXXX.json) ファイルを取得できる。

このファイルを「TeraTerm」などで Raspberry Pi 上に転送する。

 VNCビューアなどからRaspberry Pi 上のWEBブラウザを呼び出し先の画面の再取得で証明書をダウンロードすることができる。
上記(37)画面のURLをRaspberry Pi 上のWEBブラウザの検索窓に入力して(39)~(41)の操作を行う。
この場合転送の必要はない。(取得場所: ~/Downloads)

参考資料