{"id":6005,"date":"2016-04-21T11:10:10","date_gmt":"2016-04-21T03:10:10","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=6005"},"modified":"2016-04-21T11:10:10","modified_gmt":"2016-04-21T03:10:10","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e9%80%82%e9%85%8d%e8%93%9d%e7%89%99%ef%bc%8c%e5%b0%86%e5%a3%b0%e9%9f%b3%e8%be%93%e5%87%ba%e5%88%b0%e8%93%9d%e7%89%99%e9%9f%b3%e5%93%8d","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/6005.html","title":{"rendered":"\u6811\u8393\u6d3e\u9002\u914d\u84dd\u7259\uff0c\u5c06\u58f0\u97f3\u8f93\u51fa\u5230\u84dd\u7259\u97f3\u54cd"},"content":{"rendered":"<p>\u63d2\u5165\u84dd\u7259\u3002<\/p>\n<p>###\u8fde\u63a5\u84dd\u7259\u8bbe\u5907<\/p>\n<p>add nao to group plugdev<br \/>\n> usermod -a -G plugdev nao<\/p>\n<p>sudo hciconfig hci0 up    \u8fd9\u4e00\u6b65\u4f1a\u62a5\u9519\uff1a<br \/>\nCan&#8217;t init device hci0: Operation not possible due to RF-kill (132)<\/p>\n<p>\u7136\u540e\u53ef\u4ee5\u901a\u8fc7 rfkill list \u770bsoft block\u72b6\u6001\uff1a<\/p>\n<p>0: hci0: Bluetooth<br \/>\n\tSoft blocked: yes<br \/>\n\tHard blocked: no<br \/>\n1: phy0: Wireless LAN<br \/>\n\tSoft blocked: no<br \/>\n\tHard blocked: no<\/p>\n<p>\u53ef\u4ee5\u770b\u5230 Bluetooth\u662f\u5904\u4e8e soft blocked \u7684\u72b6\u6001\uff0c\u53ef\u662f\u901a\u8fc7  rfkill unblock all \u6216 rfkill unblock bluetooth \u90fd\u6ca1\u6548\u679c\u3002<\/p>\n<p>\u67e5\u8d44\u6599\u53ef\u80fd\u662f\u7531\u4e8e\u5185\u6838\u6a21\u5757 acer-wmi \u51b2\u7a81\u9020\u6210\u7684\uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\nsudo modprobe -r acer-wmi<br \/>\ncd \/etc\/modprobe.d<br \/>\nsudo nano blacklist.conf<br \/>\n\u6765\u81ea\uff1ahttp:\/\/askubuntu.com\/questions\/62730\/cannot-change-soft-block-setting-to-no-for-ar9287-wireless-network<\/p>\n<p>\u7136\u540enaoqi\u7cfb\u7edf\u91cc\u9762\u4e0d\u5b58\u5728 acer-wmi\u6a21\u5757\u3002<\/p>\n<p>\u540e\u6765\u53d1\u73b0\u662f connman \u9020\u6210\u7684\uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\nroot@osmc:~$ cat \/var\/lib\/connman\/settings<br \/>\n[global]<br \/>\nOfflineMode=false<\/p>\n<p>[Wired]<br \/>\nEnable=true<br \/>\nTethering=false<\/p>\n<p>[Bluetooth]<br \/>\nEnable=false<br \/>\nTethering=false<\/p>\n<p>Setting Enabled=true under the Bluetooth tag fixed the soft block\u3002<\/p>\n<p>\u6216\u76f4\u63a5\u7528\u547d\u4ee4 connman enable bluetooth<br \/>\n\u6765\u81ea\uff1ahttps:\/\/discourse.osmc.tv\/t\/enabling-bluetooth\/711<\/p>\n<p>\u4fee\u6539\u540e\u9700\u8981\u91cd\u542f\u7cfb\u7edf\u3002<\/p>\n<p>\u4e4b\u540e\u518d \uff0chciconfig hci0 up <\/p>\n<p>\u5176\u4e2d hci0 \u662f\u901a\u8fc7 hciconfig -a  \u62ff\u5230\u7684\u3002<\/p>\n<p>\u518d\u901a\u8fc7\u547d\u4ee4\u626b\u63cf\u5468\u56f4\u7684\u84dd\u7259\uff1a<br \/>\nhcitool scan<br \/>\n\u626b\u63cf\u7ed3\u679c\u53ef\u80fd\u662f\uff1a<br \/>\nScanning &#8230;<br \/>\n      <hadware_id> CLLSPKPCARG<\/p>\n<p>\u627e\u5230\u76ee\u6807\u7684 hadware_id\u540e\u518d\u8fd0\u884c\uff1a<br \/>\nsimple-agent hci0 <hadware_id>    \u6216\u6709\u7684\u547d\u4ee4\u4e3a bluez-simple-agent<\/p>\n<p>\u518d\u8fd0\u884c<br \/>\nhcitool cc <hadware_id> &#038;&#038; hcitool auth <hadware_id><\/p>\n<p>\u67e5\u770b\u5df2\u7ecf\u8ba4\u8bc1\u8fc7\u7684\u84dd\u7259\u5217\u8868\uff1a<br \/>\nbluez-test-device list<\/p>\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 \/etc\/asound.conf \uff0c\u52a0\u5165<\/p>\n<p>pcm.bluetooth {<br \/>\n      type bluetooth<br \/>\n      device <hardware_id><br \/>\n}<\/p>\n<p>\u518d\u7f16\u8f91 vi \/etc\/bluetooth\/audio.conf\uff0c\u52a0\u5165\uff1a<br \/>\nDisable=Media<br \/>\nEnable=Socket<\/p>\n<p>\u91cd\u542f sudo \/etc\/init.d\/bluetooth restart<\/p>\n<p>\u7136\u540e\u6d4b\u8bd5\u4e00\u4e0b\uff1a<\/p>\n<p>mpg321 -a bluetooth -g 15 02 Magic.mp3<br \/>\naplay -D bluetooth bluetooth-music.wav<\/p>\n<p>###\u4fee\u6539\u7cfb\u7edf\u7684\u9ed8\u8ba4\u8f93\u51fa\u8bbe\u5907<\/p>\n<p>\u4f7f\u7528 pactl list \u51fa\u73b0\u4ee5\u4e0b\u62a5\u9519\uff1a<br \/>\nConnection failure: Connection refused<br \/>\npa_context_connect() failed: Connection refused<br \/>\n\u6216\u4f7f\u7528pacmd \u4ee5\u4e0b\u9519\uff1a<br \/>\nNo PulseAudio daemon running, or not running as session daemon.<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a pulseaudio &#8211;kill &#038;&#038; pulseaudio &#8211;start <\/p>\n<p>\u5982\u679c pactl list sinks short \u547d\u4ee4\u6ca1\u6709\u51fa\u73b0\u84dd\u7259\u8bbe\u5907\u7684sink\uff0c\u90a3\u4e48\u8fd0\u884c\uff1apactl load-module module-alsa-sink device=bluetooth<br \/>\n\u53c2\u8003\uff1ahttp:\/\/askubuntu.com\/questions\/145733\/a2dp-connection-not-shown-in-pulseaudio<\/p>\n<p>\u5f53\u84dd\u7259\u65ad\u5f00\u8fde\u63a5\u65f6\uff0c\u9700\u8981unload-module\uff0c\u53c2\u8003 https:\/\/gist.github.com\/joergschiller\/1673341<\/p>\n<p>\u518d\u8bbe\u7f6e pacmd set-default-sink 1<br \/>\n\u53c2\u8003\u5982\u4f55 \u52a8\u6001\u5207\u6362audio\u8f93\u51fa sink \uff1a<br \/>\nhttp:\/\/askubuntu.com\/questions\/71863\/how-to-change-pulseaudio-sink-with-pacmd-set-default-sink-during-playback<br \/>\nhttp:\/\/unix.stackexchange.com\/questions\/65246\/change-pulseaudio-input-output-from-shell<\/p>\n<p>\u8bbe\u7f6e\u540e\uff0cnaoqi\u7cfb\u7edf\u9700\u8981\u91cd\u542f\u624d\u80fd\u751f\u6548\u3002<\/p>\n<p>\u53c2\u8003 \uff1ahttp:\/\/blog.whatgeek.com.pt\/2014\/04\/raspberry-pi-bluetooth-wireless-speaker\/<br \/>\nNAO\u8bbe\u7f6e\u53c2\u8003\uff1ahttps:\/\/community.aldebaran.com\/en\/forum\/problem-about-bluetooth-earphone-configuration-nao-3875<\/p>\n<p>\u53c2\u8003NAO\u5bf9\u63a5\u84dd\u7259\u89c6\u9891\uff1ahttps:\/\/www.youtube.com\/watch?v=57Z4vLBgynI<\/p>\n<p>2 &#8211; Create a serial port over BlueTooth:<br \/>\n> bluez-test-serial 00:07:80:51:10:73<br \/>\nConnected \/dev\/rfcomm0 to 00:07:80:51:10:73<br \/>\nPress CTRL-C to disconnect<\/p>\n<p>Note the serial port name: &#8220;\/dev\/rfcomm0&#8221;<\/p>\n<p>13 &#8211; Open, read and write using that port, eg using python and pyserial.<br \/>\nWe&#8217;ve made an example using choregraphe: the simple_serial.py<br \/>\n(the serial port can be changed clicking the small tools at the bottom left of the choregraphe box)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63d2\u5165\u84dd\u7259\u3002 ###\u8fde\u63a5\u84dd\u7259\u8bbe\u5907 add nao to group plugdev > usermod -a &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6005","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=6005"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6005\/revisions"}],"predecessor-version":[{"id":6006,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6005\/revisions\/6006"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=6005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=6005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=6005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}