LoginSignup
0
0

More than 1 year has passed since last update.

WSLでのgoogle-home-notifierの動かし方

Posted at

google-home-notifierをラズベリーパイに1年前にインストールして以来、その後、Ubuntu18.04にインストールして愛用していましたが、
最近、WIndows10,Windows11をインストールしてWindowsでもLinuxが使えるということが今年になり分かりました。多くの資料をネットで勉強して、ようやく、WSL環境下でgoogle-home-notifierを動かすことができましたので報告します。コメント頂ければ光栄です。

環境

●Google Home 192.168.12.3
●WSL Ubuntu 20.04
●npm: v6.14.4
●node:v10.19.6
●ngrok:v3.0.3

Google-home-notifierインストール

google-home-notifierをラズベリーパイに1年前にインストールして以来、その後、Ubuntu18.04にインストールして愛用していましたが、 最近、WIndows10,Windows11をインストールしてWindowsでもLinuxが使えるということが今年になり分かりました。多くの資料をネットで勉強 して、ようやく、WSL環境下でgoogle-home-notifierを動かすことができましたので報告します。 コメント頂ければ光栄です。


下記URLを参考にしまして何とかできました?

google-home-notifierでエラー
fatal error: dns_sd.h: No such file or directory #66
 Windows 10 (Windows Subsystem for Linux) で Google Home に喋らせたい

②の回答にあったのをインストールします。

 sudo apt-get install libavahi-compat-libdnssd-dev

その後、③ の
sudo service dbus star
sudo service avahi-daemon start
実行して、node ghome.jsでほぼ、O.K。

1.Google-home-notifier のひな型


shino@raspberrypi:~ $ cd ghome
shino@raspberrypi:~/ghome $ ls -l
合計 0

次に、https://github.com/noelportugal/google-home-notifier から
ターミナル画面から
$ git clone https://github.com/noelportugal/google-home-notifier
を入力すると下記のようにGoogle-home-notifier のひな型ができます。

shino@raspberrypi:~/ghome $ git clone https://github.com/noelportugal/google-home-notifier
Cloning into 'google-home-notifier'...
remote: Enumerating objects: 155, done.
remote: Total 155 (delta 0), reused 0 (delta 0), pack-reused 155
Receiving objects: 100% (155/155), 26.28 KiB | 0 bytes/s, done.
Resolving deltas: 100% (84/84), done.
shino@raspberrypi:~/ghome $ ls -l
合計 4
drwxr-xr-x 3 shino shino 4096 5月 20 07:14 google-home-notifier
shino@raspberrypi:~/ghome $ cd *
shino@raspberrypi:~/ghome/google-home-notifier $ ls -l
合計 20
-rw-r--r-- 1 shino shino 1069 5月 20 07:14 LICENSE
-rw-r--r-- 1 shino shino 2404 5月 20 07:14 README.md
-rw-r--r-- 1 shino shino 2845 5月 20 07:14 example.js
-rw-r--r-- 1 shino shino 2827 5月 20 07:14 google-home-notifier.js
-rw-r--r-- 1 shino shino 507 5月 20 07:14 package.json

3.Nodeで起動


*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see 
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see 
Endpoints:
    http://192.168.11.2:8091/google-home-notifier
    https://7005c9e66038.ngrok.io/google-home-notifier
GET example:
curl -X GET https://7005c9e66038.ngrok.io/google-home-notifier?text=Hello+Google+Home
POST example:
curl -X POST -d "text=Hello Google Home" https://7005c9e66038.ngrok.io/google-home-notifier

WSL環境での課題

google-home-notifierをラズベリーパイに1年前にインストールして以来、その後、Ubuntu18.04にインストールして愛用していましたが、 最近、WIndows10,Windows11をインストールしてWindowsでもLinuxが使えるということが今年になり分かりました。多くの資料をネットで勉強 して、ようやく、WSL環境下でgoogle-home-notifierを動かすことができましたので報告します。 コメント頂ければ光栄です。


下記URLを参考にしまして何とかできました?

google-home-notifierでエラー
fatal error: dns_sd.h: No such file or directory #66
 Windows 10 (Windows Subsystem for Linux) で Google Home に喋らせたい

②の回答にあったのをインストールします。

 sudo apt-get install libavahi-compat-libdnssd-dev

その後、③ の
sudo service dbus star
sudo service avahi-daemon start
実行して、node ghome.jsでほぼ、O.K。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0