最安で リモートスイッチ作ってみる

たぶんいまのところwio nodeとgrove servoが一番簡単で安いだろう

リチウムを買った合計は結局3500円になる。

流れは

wio nodeを起動ボタン長押ししてwifiにつなげる

スマホのwioアプリで同じwifiに繋ぎ設定

serveのアイコンをドラッグして繋いでfireで書き込み

これで右上のviewAPIからdegreeをPOSTすると動く簡単!

次にIFTTTのアプリいれてthisのところをメールにして

thatのところをseed wioで自分のany driveにすれば

登録のメアドからtriggaにメール送るととりあえず動きます。

値はfirstparameteだけで十分、他入れても最後だけしか読み込まない

なぜか230くらいの値いれると180度動く、こわれたか

raspberry alexa マイク 読んだり読まなかったり

設定的うまくいっていればパルスからオフオンしてログアウトしてからログインしたら読み込んだ実績あり

Add dtparam=audio=on to /boot/config.txt and reboot.

alsactl restore
で保存した設定が読み込まれる

マイク
マイクが PulseAudio から認識されない
マイクのカードとデバイス番号を確認:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
hw:CARD,DEVICE という表記を見て下さい。上記の場合デバイスは hw:0,0 になります。

次に、/etc/pulse/default.pa を編集して以下のように load-module 行を挿入してください (デバイスは必要に応じて置き換えてください):

load-module module-alsa-source device=hw:0,0
# the line above should be somewhere before the line below
.ifexists module-udev-detect.so
最後に、pulseaudio を再起動して新しい設定を適用します:

$ pulseaudio -k ; pulseaudio -D
全てが上手くいった場合、pavucontrol を実行したときにマイクが認識されているのがわかるはずです (Input Devices タブ)。

Pulseaudio で間違ったマイクが使われる
Pulseaudio が間違ったマイクロフォンを使っていて、Pavucontrol で Input Device を変更しても直らない場合、alsamixer を見て下さい。Pavucontrol が入力ソースを正しく設定していない可能性があります。

$ alsamixer
F6 を押してあなたの使っているサウンドカードを選択してください (例: HDA Intel)。そして F5 を押し全てのアイテムを表示します。次のアイテムを探して下さい: Input Source。上下の矢印キーで入力ソースを変更することができます。

適切なマイクロフォンが録音に使われているか確かめて下さい。

Add dtparam=audio=on to /boot/config.txt and reboot.

raspberry pi alexa 日本語化 ならない

基本、日本のアカウントで開発登録したら日本語になるはずだが、
作ったばかりだとならないらしい、
まず普通のアカウントのウェブの端末と設定みたいなところで住所入れるところがある
最初設定しないと不明になっている。これを入力
そのあとアレクサもコマンドで日本語化し
スマホ側のアプリも一度サインアウトして入りなおしたら日本のスキルになってた

raspberry pi zero で 最少最安の音声設定 (minihdmi to 3.5mm audio out とUSBマイク)に挑戦

HFPができなかったので、最少最安の音声設定を考察

結果、
出力はminiHDMIからHDMIから3.5mm音声出力、VGA挿してスピーカへ
入力はUSBマイクが200円くらいであるから、そのあたりを使うことに

まず3.5mmから音だすにはboot/configの設定変更が必要らしい
1024X720 60Hz的なものを追加
USBマイクはコマンド入れて優先度あげてあげればいけるっぽい

詳細は後日余裕あったら書きます。

自分は、いろいろ試したけど結局、優先度あげてraspi-config upgrade的なことしたらなぜか入力するようになった

ただ本来の使い道であるアレクサがなぜか格段に遅くなって、使い物にならなくなった、意味不明

結局200円くらいのUSBインターフェイスでやったほうが安いかも、動くならね

Iseebiz MINI HDMIオス to VGA メス 変換 アダプタ 3.5mm 音声出力端子 / ケーブル付 1080p対応(ブラック)

MiniHDMI→VGA変換アダプタ
COMON(カモン) VGA-C
HDMI C端子(オス)→VGA(メス)
●オーディオ出力用3.5mmステレオ端子
●ミニHDMI
商品番号 COMON VGA-C

パイナップル miniHDMIオスをVGAメス変換します 音声出力3.5mmステレオ付き

Hot Mini USB Microphone Wireless MIC Audio Adapter Driver for MSN Notebook Skype

Plugable USB オーディオ変換アダプタ 3.5mm ヘッドホン・マイク端子付

人柱
SODIAL(R) USB5.1ステレオサウンドカードアダプター

raspberry pi zero でHFP に挑戦

https://scribles.net/hfp-on-raspberry-pi/
ひととおりやったがなにも変わらない
http://youness.net/raspberry-pi/bluetooth-headset-raspberry-pi
pacmd list-cards
コネクトまでいくがカードが出ないからその先進まない、たぶんHFPだけのスピーカとかだとだめかも

pulseaudio入れるとCmediaから音が出なくなった、基本この設定しようとしたら普通の音声は使えなくなるから微妙

現状pulseaudioがない状態ならヘッドセットを使える。

結論
usb c mediaでマイクと音がでるやつが最高。
例えばこういうの↓
エレコム HS-EP13USV USBヘッドセット(イヤーフックタイプ)

alexa google assitant home raspberry pi zero wh に挑戦

alexa と google Assistantを入れようとしてたがgoogle-assistant-sdk[samples]がどうも入らない。
ググルと↓の記事をみつけ
https://github.com/home-assistant/home-assistant/issues/10314
色々試したらどうも↓のコマンドで同じエラーが出るので何回かやったらとりあえず進んだ
pip3 install --upgrade pywebpush==1.1.0
次は↓で止まる
Running setup.py bdist_wheel for grpcio
容量不足だったみたいで、wolffarm消したら600M空いて次進んだら
9687 Illegal instruction googlesamples-assistant-hotword -
が出た
今度は
(env) $ python -m pip install --upgrade google-auth-oauthlib[tool]
でエラー出たがこれしてからやったら通った→(env) $ python -m pip install --upgrade google-assistant-library
用意されてたsh入れてもエラーIllegal instructionではじかれるので直接入れたらいちお動いた↓
(env) pi@raspberrypi:~/Assistants $ googlesamples-assistant-pushtotalk --project-id rasberry-d7b3b --device-model-id rasberry-d7b3b-20180302094919 --lang ja_jp
次はたぶん音声デバイスのエラーが出た。もうめんどい
RROR:root:grpc unavailable error: <_Rendezvous of RPC that terminated with (StatusCode.UNAVAILABLE, Service unavailable.)>
とりあえず、インストールもういっかい
pip install --upgrade google-assistant-grpc
Running setup.py bdist_wheel for grpcio ...がめちゃ長い |
Illegal instruction 発生
Raspberry Pi Zero はARM6なんでhotwordは未サポートでした。ちゃんちゃん
pushtalkはいけるみたい



↓これがエラー内容
pip install --upgrade google-assistant-sdk[samples]
Collecting google-assistant-sdk[samples]
Using cached google_assistant_sdk-0.4.3-py2.py3-none-any.whl
Requirement already up-to-date: google-auth-oauthlib[tool]>=0.1.0 in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: click<7,>=6.7; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: urllib3[secure]<2,>=1.21; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: futures<4,>=3.1.1; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: sounddevice<0.4,>=0.3.7; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Collecting google-assistant-grpc==0.1.0; extra == "samples" (from google-assistant-sdk[samples])
Using cached google_assistant_grpc-0.1.0-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/home/pi/Assistants/env/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
(env) pi@raspberrypi:~/Assistants $ googlesamples-assistant-pushtotalk
bash: googlesamples-assistant-pushtotalk: コマンドが見つかりません
(env) pi@raspberrypi:~/Assistants $ googlesamples-assistant-devicetool register-model --model 'my-model-identifier' --manufacturer 'Assistant SDK developer' --product-name 'Assistant SDK light' --description 'Assistant SDK light device'
bash: googlesamples-assistant-devicetool: コマンドが見つかりません
(env) pi@raspberrypi:~/Assistants $ sudo pip install cython
Collecting cython
Downloading Cython-0.27.3.tar.gz (1.8MB)
100% |████████████████████████████████| 1.8MB 17kB/s
^[[ABuilding wheels for collected packages: cython
Running setup.py bdist_wheel for cython ... done
Stored in directory: /root/.cache/pip/wheels/d1/2d/01/94d746e3ab647f56f2b1ef9547e37f62ed010d9956c988ab9f
Successfully built cython
Installing collected packages: cython
Successfully installed cython-0.27.3
(env) pi@raspberrypi:~/Assistants $ python -m pip install --upgrade google-assistant-sdk[samples]
Collecting google-assistant-sdk[samples]
Using cached google_assistant_sdk-0.4.3-py2.py3-none-any.whl
Requirement already up-to-date: google-auth-oauthlib[tool]>=0.1.0 in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: pathlib2==2.3.0; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: urllib3[secure]<2,>=1.21; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Requirement already up-to-date: futures<4,>=3.1.1; extra == "samples" in ./env/lib/python3.5/site-packages (from google-assistant-sdk[samples])
Collecting google-assistant-grpc==0.1.0; extra == "samples" (from google-assistant-sdk[samples])
Using cached google_assistant_grpc-0.1.0-py2.py3-none-any.whl
Exception:
Traceback (most recent call last):
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/req/req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/home/pi/Assistants/env/lib/python3.5/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/home/pi/Assistants/env/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/home/pi/Assistants/env/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/pi/Assistants/env/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'