Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 116
11 月 | 2017 | FreeSandal | 第 3 頁

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 H 》

job security J

job security: n.

When some piece of code is written in a particularly obscure fashion, and no good reason (such as time or space optimization) can be discovered, it is often said that the programmer was attempting to increase his job security (i.e., by making himself indispensable for maintenance). This sour joke seldom has to be said in full; if two hackers are looking over some code together and one points at a section and says “job security”, the other one may just nod.

 

最近偶讀《A close look at ALSA》文章,驚聞該作者所言就業保障 job security 一詞。訝異之於!所以反思今夕何夕耶?

想起日前才見

Gladys Project: a Raspberry Pi home assistant

If, like me, you’re a pretty poor time-keeper with the uncanny ability to never get up when your alarm goes off and yet still somehow make it to work just in time — a little dishevelled, brushing your teeth in the office bathroom — then you too need Gladys.

Raspberry Pi home assistant

Over the last year, we’ve seen off-the-shelf home assistants make their way onto the Raspberry Pi. With the likes of Amazon Alexa, Google Home, and Siri, it’s becoming ever easier to tell the air around you to “Turn off the bathroom light” or “Resume my audiobook”, and it happens without you lifting a finger. It’s quite wonderful. And alongside these big names are several home-brew variants, such as Jarvis and Jasper, which were developed to run on a Pi in order to perform home automation tasks.

So do we need another such service? Sure! And here’s why…

……

 

,尚且直通三年前的

Meet Jasper: open-source voice computing

 Posted by Liz Upton
Director of Communications, Raspberry Pi Foundation
Usually quite inky

Meet Jasper. He’s like Siri, but much better, in that it’s open-source and completely customisable. All you need to set up your own is a microphone, a speaker, and a Raspberry Pi.

Jasper already comes with modules to deal with things like time, weather, Gmail, playing your Spotify music, news (and what’s on Hacker News)…and knock knock jokes. You can build your own modules to add more functionality. We’re really impressed by how well-documented Jasper is; new developers should be able to get to grips with building on the platform very easily, and we’re looking forward to watching what you guys get up to with it.

 

是否今日果真不同乎??

AIY logo

Do-it-yourselfartificialintelligence

We want to put AI into the maker toolkit , to help you solve real problems that matter to you and your communities. These kits will get you started by adding natural human interaction to your maker projects.

Project Overview

This project demonstrates how to get a natural language recognizer up and running and connect it to the Google Assistant, using your AIY Projects voice kit. Along with everything the Google Assistant already does, you can add your own question and answer pairs. All in a handy little cardboard cube, powered by a Raspberry Pi.

Don’t own a kit? You can also integrate the Google Assistant into your own hardware by following the official Google Assistant SDK guides, or you can read below for links to purchase the AIY kit.

Assembling the kit and setting up the Google Assistant SDK should take about an hour and a half.

 

故爾假借

ReSpeaker 4-Mic Array for Raspberry Pi

Introduction

ReSpeaker 4-Mic Array for Raspberry Pi is a quad-microphone expansion board for Raspberry Pi designed for AI and voice applications. This means that we can build a more powerful and flexible voice product that integrates Amazon Alexa Voice Service, Google Assistant, and so on.

 

談點

Asoundrc

Why asoundrc?

What is it good for, why do I want one?

Neither the user-side .asoundrc nor the asound.conf configuration files are required for ALSA to work properly. Most applications will work without them. These files are used to allow extra functionality, such as routing and sample-rate conversion, through the alsa-lib layer. The actual reason that most applications will work without these user-side custom config files is that usually a default install of alsa-lib provides a sufficiently capable setup consisting of hierarchical config files (which always make use of the standard .asoundrc format syntax as well), which are specifically capable of supporting certain soundcard brands each. Thus, let’s start with a quick overview of how ALSA config file framework evaluation is composed, globally:

Global view of ALSA config file framework, executive summary

The alsa-lib package (at least on Debian libasound2-data 1.0.27) provides the /usr/share/alsa/alsa.conf file as the main entry point. That file is responsible for including the full list of potential .asoundrc-format-type files on the system. It contains a reference to the ALSA “DATADIR” (Debian: /usr/share/alsa/). It continues by loading the DATADIR’s cards/aliases.conf file: that one defines translation mappings from the kernel driver’s sound card name (as listed at /proc/asound/cards, or aplay -Ll) to a “more detailed” description string. That “more detailed name” of a sound card then gets used to lookup a corresponding card-specific config file at DATADIR/cards/CARD.conf. And THAT card-specific file then attempts to provide a maximally elegant sound setup for its specific card brand, by compensating for various limitations of cards (e.g. use dmix to combat single-stream playback only, or stereo downmix to lessen a mono-output-only restriction). Finally (to support those cases where the standard setup of a soundcard is deficient/lacking, or custom plugin setup is desired), alsa.conf loads a system-global custom settings file /etc/asound.conf and a per-user custom settings file ~/.asoundrc.

So, the objective should be to achieve having the common alsa-lib configuration file framework enhanced by default in the best possible manner for each specific soundcard brand, to avoid the need of creating manually customized config files in all standard cases.

With this global overview done and cared for, let’s have a look at the actual configuration format of alsa-lib files.

……

Further reading

───

 

!!

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G‧H 》

假使當我們選擇藍牙喇叭作為系統預設時︰

pi@raspberrypi:~ more ~/.asoundrc  pcm.!default { 	type plug 	slave.pcm { 		type bluealsa 		device "00:02:5B:00:47:4E" 		profile "a2dp" 	} }  ctl.!default { 	type bluealsa } </pre>    <span style="color: #666699;">Sonic π 是否會使用它耶?</span>  <img class="alignnone size-full wp-image-78559" src="http://www.freesandal.org/wp-content/uploads/SonicPi-a2dp.png" alt="" width="1920" height="1080" />     <span style="color: #666699;">考之於啟動之 jackd 參數︰</span> <pre class="lang:default decode:true">pi@raspberrypi:~ ps ax | grep jack
 1952 ?        SLsl   0:01 jackd -R -p 32 -d alsa -d hw:0 -n 3 -p 2048 -o2 -r 44100
 2114 pts/0    S+     0:00 grep --color=auto jack

 

故知其未用乎??如是

Configuration & Usage

The main component of the BlueALSA is a program called bluealsa. It should be run as a root during system startup (root privileges are not required per se, the only requirement is a write access to /var/run/bluealsa). This program acts as a proxy between Bluez and ALSA.

In order to stream audio to the e.g. Bluetooth headset, firstly one has to connect the device. The most straightforward method is to use Bluez CLI utility called bluetoothctl. When the device is connected one can use the bluealsa virtual PCM device as follows:

aplay -D bluealsa:HCI=hci0,DEV=XX:XX:XX:XX:XX:XX,PROFILE=a2dp Bourree_in_E_minor.wav</code></pre>    <span style="color: #666699;">所說的 bluealsa 到底是什麼東東也!分明</span>  <span style="color: #ff9900;">aplay -D bluealsa:HCI=hci0,DEV=00:02:5B:00:47:4E,PROFILE=a2dp /usr/share/sounds/alsa/Noise.wav</span>  <span style="color: #ff9900;">aplay -D default /usr/share/sounds/alsa/Noise.wav</span>     <span style="color: #666699;">都很 OK 哩,而且果有此 default 裝置呦!!</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
playback
dmixed
ac108
default
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions
pi@raspberrypi:~ </pre>    <span style="color: #666699;">難到遇着虛擬裝置啊?★</span> <h1><span style="color: #ff9900;"><a style="color: #ff9900;" href="http://nairobi-embedded.org/alsa_pcm_plugins_capture.html">Basic Virtual PCM Devices for Playback/Capture, <i>ALSA</i></a></span></h1> <div class="well small">  <span style="color: #808080;"><b>Author:</b> <a class="url fn" style="color: #808080;" href="http://nairobi-embedded.org/author/mugabi-siro.html"><i>Mugabi Siro</i></a></span>  <span style="color: #808080;"><b>Category:</b><a style="color: #808080;" href="http://nairobi-embedded.org/category/alsacots-infrastructure-for-dsp.html"> ALSA/COTS Infrastructure for DSP</a></span>  <span style="color: #808080;"><b>Summary:</b></span>  <span style="color: #808080;">Brief descriptions of a few ALSA virtual PCM devices. Note that the complete information about these devices and PCM plugins is quite extensive and can be found in the links included in the <em>Resources</em> section. This entry will only describe a few of the standard/common virtual PCM devices. It was originally written for audio capture purposes, but all the virtual PCM devices described -- with the exception of <code>dsnoop</code> -- can also be used for playback.</span>  <span style="color: #808080;"><i>Tags: <a style="color: #808080;" href="http://nairobi-embedded.org/tag/linux.html">linux </a><a style="color: #808080;" href="http://nairobi-embedded.org/tag/alsa.html">alsa </a></i></span>  </div> <div class="well small"></div> <div> <span style="color: #666699;">一時狐疑,將如何判斷的呀!☆</span></div> <pre class="lang:default decode:true ">pi@raspberrypi:~ arecord [-D default] foo.wav -vv
ALSA lib bluealsa-pcm.c:660:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: 沒有此一裝置
arecord: main:788: audio open error: 沒有此一裝置
pi@raspberrypi:~ $

 

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G.4 》

黃鐘

 

 

 

 

 

 

韓娥

 

 

 

古琴

列子‧湯問

匏巴鼓琴
匏巴鼓琴而鳥舞魚躍,鄭師文聞之,棄家從師襄游。柱指鈞弦,三年不成章。師襄曰: 『子可以歸矣。』師文舍其琴,歎曰:『文非弦之不能鈞,非章之不能成。文所存者不在弦,所志者不在聲。內不得於心,外不應於器 ,故不敢發手而動弦。且小假之 ,以觀其後。』無幾何,復見師襄。師襄曰:『子之琴何如?』師文曰:『得之矣。請嘗試之。 』於是當春而叩商弦以召南呂,涼風忽至,草木成實。及秋而叩角 弦以激夾鍾,溫風徐迴,草木發榮。當夏而叩羽弦以召黃鐘,霜雪交下,川池暴沍。及冬而叩徵弦以激蕤賓,陽光熾烈,堅冰立散。將終,命宮而總四弦,則景風 翔,慶雲浮,甘露降,澧泉涌。師襄乃撫心高蹈曰:『微矣 !子之彈也!雖師曠之清角,鄒衍之吹律,亡以加之。彼將挾琴執管而從子之後耳。』

韓娥鬻歌
薛譚學謳於秦青,未窮青之技,自謂盡之;遂辭歸。秦青弗止;餞於郊衢,撫節悲歌,聲振林木 ,響遏行雲。薛譚乃謝求反,終身不敢言歸。秦青顧謂其友曰:『昔 韓 娥東之齊,匱糧,過雍門,鬻歌假食。既去而餘音繞梁欐,三日不絕,左右以其人弗去 。過逆旅,逆旅人辱之。韓娥因曼聲哀哭,一里老幼悲愁,垂涕相對,三日不 食。遽而追之。娥還,復為曼聲長歌。一里老幼喜躍抃舞,弗能自禁,忘向之悲也。乃厚賂發之。故雍門之人至今善歌哭,放娥之遺聲。』

高山流水
伯牙善鼓 琴,鍾子期善聽。伯牙鼓琴,志在登高山。鍾子期曰:『善哉!峨峨兮若泰山!』志在流水。鍾子期曰:『善哉!洋洋兮若江河!』伯牙所念,鍾子期必得之。伯牙 游於泰山之陰,卒逢暴雨,止於巖下;心悲,乃援琴而鼓之。初為霖雨之操,更造崩山之音。曲每奏,鍾子期輒窮其趣。伯牙乃舍琴而嘆曰:『善哉,善哉,子之聽 夫!志想象猶吾心也。吾於何逃聲哉?』

─── 《Sonic π 知音?!

 

談到 Sonic π 軟件之寫作理念,當然是以原創者英國劍橋大學 Dr . Sam Aaron 博士說法為准︰

 

據聞聲子派之海洋 Ocean

Examples – rework examples to reflect best practices

# Coded by Sam Aaron
with_fx :reverb, mix: 0.5 do
live_loop :oceans do
s = synth [:bnoise, :cnoise, :gnoise].choose, amp: rrand(0.5, 1.5), attack: rrand(0, 4), sustain: rrand(0, 2), release: rrand(1, 5), cutoff_slide: rrand(0, 5), cutoff: rrand(60, 100), pan: rrand(-1, 1), pan_slide: rrand(1, 5), amp: rrand(0.5, 1)
control s, pan: rrand(-1, 1), cutoff: rrand(60, 110)
sleep rrand(2, 4)
end
end

 

十分擬真,程式含表頭僅僅四百一十三 Byte ,就能展現浪濤的上下起伏高低變化之聲!

聽過後欲探其玄,故借黑傑克

勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧ Hi-Jack‧Sonic π 之設定

的儀表究之也。

 

一時歡天喜地,偏偏突如其來如之思緒……

試試聲音知覺量化吧………

過去當人們走過街角之書店,偶然地發現一本吸引人的書,也許會駐足翻閱一番,再決定是否要沉浸於書中的奇異世界。而今人們在網際網路的汪洋裡打撈,篩選過濾無所不在的廣告。曾幾何時世界變成了喧囂的市場?或許因此知覺也早就超載的了!模糊的記憶,想不出如何邂逅上

japa

The JACK & ALSA Audio Perceptual Analyser, is a ‘perceptual’ or ‘psychoacoustic’ audio spectrum analyser.

In contrast to JAAA, this is more an acoustical or musical tool than a purely technical one. Possible uses include spectrum monitoring while mixing or mastering, evaluation of ambient noise, and (using pink noise), equalisation of PA systems.

,一個所謂的『聲音』『知覺』分析儀。依稀記得當初為了弄明白它的『名目』,在大海裡撈針。很高興發現了一篇『通告』︰

JAPA Jack/Alsa Perceptual Analyser initial release

From:   fons adriaensen <fons.adriaensen-AT-skynet.be>
To:   Linix Audio Developers <linux-audio-dev-AT-music.columbia.edu>, Linux Audio Announce <linux-audio-announce-AT-music.columbia.edu>, JACK Developers <jackit-devel-AT-lists.sourceforge.net>
Subject:   [linux-audio-announce] [ANN] JAPA Jack/Alsa Perceptual Analyser
Date:   Sat, 6 Aug 2005 17:24:17 +0200

The first (alpha) release of JAPA is now available at

<http://users.skynet.be/solaris/linuxaudio>>

>From the README:

JAPA is a ‘perceptual’ or ‘psychoacoustic’ audio spectrum
analyser. This means that the filters that are used to
analyse the spectrum have bandwidths that are neither
constant (as in JAAA), nor proportional to the center
frequency (as in a 1/3 octave band analyser), but tuned
to human perception. With the default settings, JAPA uses
a filter set that closely follows the Bark scale.

In contrast to JAAA, this is more an acoustical or musical
tool than a purely technical one. Possible uses include
spectrum monitoring while mixing or mastering, evaluation
of ambient noise, and (using pink noise), equalisation
of PA systems.

JAPA allows you to measure two inputs at the same time,
compare them, store them to memory and compare them to
stored traces. It offers a number of resolutions, speeds,
and various display options. The dual inputs and memories
will find their way into future JAAA versions as well.
This is a source release. You will also need libclalsadrv,
libclthreads (from the same place), and libfftw3f.
Enjoy !


FA

,卻失笑於那個『讀我』 README 之文。畢竟難得天真如愛麗絲,看到『吃我』就『吃』,『喝我』就『喝』的吧!終究那個

… 摘自《勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧聲音知覺分析儀

 

嘗試選單啟動,竟然無動於衷?終端機察後

 

,怪也哉!?雖然心理 ○○×× ,嘟囔著自寫自讀文字?!莫非又是 Buffer 大小設定、誰先誰後的問題??

 

將如之何耶?★

或用萬古唯一妙計── 試誤法 ── 的乎!☆

 

 

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G.3 》

Listen to Bluetooth Audio on Your Raspberry Pi 3, Pi Zero, or Earlier Pi

YouTube on the Pi

The Raspberry Pi is a handy little computer for so many uses, but Raspbian doesn’t come already set up for listening to audio over Bluetooth headphones or speakers. However, it’s not hard to do, it’s a lot of fun, and it works!. As I’m writing this, I’m listening to 40s Big Band music on my Pi 3 through my Bluetooth headphones.

The instructions in this post are for the February 26, 2016 version of version of Raspbian or Noobs, but they work with all previous versions of Raspbian Jessie. They work for the Raspberry any Pi version, although the Zero and the original Pi are not really powerful enough to stream from the internet. They work great for playing mp3 files with a media player like VLC.

Except for the Pi 3, you’ll need a Bluetooth adapter like the Plugable Bluetooth adapter. For the Pi Zero, you’ll also need a way to connect to the Internet like a Plugable USB-Ethernet adapter or WiFi adapter, along with an OTG cable and a powered hub like the compact Plugable 4-port USB 2.0 hub. Whichever Pi you use, you end up with is a great little music server that opens the door to a lot of fun projects.

───

只不過眼前似乎『踢到鐵板』?之前 OK 的『藍牙喇叭』

IMAG1178

,現在雖不能用『blueman』連接??不是還可用『bluetoothctl』

pi@raspberrypi ~ bluetoothctl  [NEW] Controller B8:27:EB:23:2B:C8 raspberrypi [default] [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent  Default agent request successful [bluetooth]# scan on Discovery started [CHG] Controller B8:27:EB:23:2B:C8 Discovering: yes [NEW] Device 00:02:5B:00:47:4E NOGO B6500 [NEW] Device 74:E5:43:88:E4:16 localhost.localdomain-0 [bluetooth]# pair 00:02:5B:00:47:4E Attempting to pair with 00:02:5B:00:47:4E [CHG] Device 00:02:5B:00:47:4E Connected: yes [CHG] Device 00:02:5B:00:47:4E UUIDs: 	00001108-0000-1000-8000-00805f9b34fb 	0000110b-0000-1000-8000-00805f9b34fb 	0000110c-0000-1000-8000-00805f9b34fb 	0000110e-0000-1000-8000-00805f9b34fb 	0000111e-0000-1000-8000-00805f9b34fb [CHG] Device 00:02:5B:00:47:4E Paired: yes Pairing successful [CHG] Device 00:02:5B:00:47:4E Connected: no [bluetooth]# connect 00:02:5B:00:47:4E Attempting to connect to 00:02:5B:00:47:4E [CHG] Device 00:02:5B:00:47:4E Connected: yes Connection successful [bluetooth]# quit Agent unregistered [DEL] Controller B8:27:EB:23:2B:C8 raspberrypi [default] pi@raspberrypi ~ 

 

連成功乎!怎 A2DP 聲音會 …… 不忍聞的耶!!

─── 摘自《W!o+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之 VLC 篇

 

身處 BlueZ  4→5 大變革的時刻,而且品嚐了

Bluetooth Audio ALSA Backend

With this application (later named as BlueALSA), one can achieve the same goal as with PulseAudio, but with less dependencies and more bare-metal-like. BlueALSA registers all known Bluetooth audio profiles in Bluez, so in theory every Bluetooth device (with audio capabilities) can be connected. In order to access the audio stream, one has to connect to the ALSA PCM device called bluealsa. The device is based on the ALSA software PCM plugin.

 

a2dp 之美聲︰

pi@raspberrypi:~ hciconfig -a hci0:	Type: Primary  Bus: UART 	BD Address: B8:27:EB:68:1A:C4  ACL MTU: 1021:8  SCO MTU: 64:1 	UP RUNNING PSCAN  	RX bytes:1476 acl:0 sco:0 events:90 errors:0 	TX bytes:4410 acl:0 sco:0 commands:90 errors:0 	Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3  	Link policy: RSWITCH SNIFF  	Link mode: SLAVE ACCEPT  	Name: 'raspberrypi' 	Class: 0x6c0000 	Service Classes: Rendering, Capturing, Audio, Telephony 	Device Class: Miscellaneous,  	HCI Version: 4.1 (0x7)  Revision: 0x145 	LMP Version: 4.1 (0x7)  Subversion: 0x2209 	Manufacturer: Broadcom Corporation (15) </pre>   <pre class="lang:default decode:true">pi@raspberrypi:~ more ~/.asoundrc 
pcm.!default {
	type plug
	slave.pcm {
		type bluealsa
		device "00:02:5B:00:47:4E"
		profile "a2dp"
	}
}

ctl.!default {
	type bluealsa
}
pi@raspberrypi:~ $

 

 

奈何還難忘懷開機

systemctl status bluetooth

的錯誤耶?

Failed to obtain handles for “Service Changed” characteristic

Sap driver initialization failed.

sap-server: Operation not permitted (1)

 

事實,科技本就來自人性◎

Bluetooth HSP/HFP not working in Raspberry PI 3 #2229

Trying to use a bluetooth mic/speaker in a raspberry pi 3 (headless).

Hardware is Raspberry pi 3, firmware updated today, running raspbian also dist-upgraded today. Using bluez and pulseaudio (system service start mode).

  • The device is trusted, paired and connects/disconnects without problems.
  • When device is initially connected, “pactl list” shows the device is using the profile named “headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: yes)”. With this profile, no sound (trying to play with aplay command).
  • When profile is changed to “a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes)” (using command pactl set-card-profile), the sound is played correctly.

No error messages seen in any log file.

Moreover, if I “down” (“hciadmin hci0 down”) the internal raspberry bluetooth controller and use instead an external bluetooth controller connected in an usb port, both modes works correctly. Thus, problem seems related with the bluetooth device in raspberry card.

 

bluetoothd sap driver issue

jeeva

Sat Jan 09, 2016 6:15 pm

Hello All,

I quite new to rpi world.. When I try to check the status of my bluetooth, I am getting the Sap driver initialization failed error as shown below. Could someone please help me resolve this issue?

……

Bluetooth issues

M4NOOb

Thu Mar 03, 2016 8:38 pm

Hi everyone,

currently I am trying to connect my raspberry pi 2 with my Android 5.1.1 phone via bluetooth (I am trying with Bluez 5.23). The pairing seems to work, but it always returns “Connected: no”. If I try to connect manually it says “Failed to connect: org.bluez.Error.Failed”.

………

 

新舊換代之間能無大哉辯嘛!

 

 

 

 

 

 

 

 

【鼎革‧革鼎】︰ Raspbian Stretch 《六之 G.2 》

比之於
W!o+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之藍牙篇【上】

文本寫作那時,現下的 pi-bluetooth

pi@raspberrypi:~ apt-cache show pi-bluetooth Package: pi-bluetooth Version: 0.1.6 Architecture: armhf Maintainer: Serge Schneider <serge@raspberrypi.org> Installed-Size: 18 Depends: init-system-helpers (>= 1.18~), bluez, bluez-firmware, raspberrypi-sys-mods Homepage: https://github.com/RPi-Distro/pi-bluetooth Priority: optional Section: misc Filename: pool/main/p/pi-bluetooth/pi-bluetooth_0.1.6_armhf.deb </pre>    <span style="color: #666699;">小程式可是方便多了!</span>  <img class="alignnone size-full wp-image-78477" src="http://www.freesandal.org/wp-content/uploads/Add-New-Device_025.png" alt="" width="368" height="280" />    <pre class="lang:default decode:true ">pi@raspberrypi:~ apt-cache show bluez
Package: bluez
Version: 5.43-2+rpt2+deb9u2
Architecture: armhf
Maintainer: Debian Bluetooth Maintainers <pkg-bluetooth-maintainers@lists.alioth.debian.org>

 

pi@raspberrypi:~ systemctl status bluetooth ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since Wed 2017-11-15 16:30:27 CST; 20s ago      Docs: man:bluetoothd(8)  Main PID: 500 (bluetoothd)    Status: "Running"    CGroup: /system.slice/bluetooth.service            └─500 /usr/lib/bluetooth/bluetoothd  11月 15 16:30:26 raspberrypi systemd[1]: Starting Bluetooth service... 11月 15 16:30:27 raspberrypi bluetoothd[500]: Bluetooth daemon 5.43 11月 15 16:30:27 raspberrypi systemd[1]: Started Bluetooth service. 11月 15 16:30:27 raspberrypi bluetoothd[500]: Starting SDP server 11月 15 16:30:27 raspberrypi bluetoothd[500]: Bluetooth management interface 1.14 initialized 11月 15 16:30:27 raspberrypi bluetoothd[500]: Failed to obtain handles for "Service Changed" characteristic 11月 15 16:30:27 raspberrypi bluetoothd[500]: Sap driver initialization failed. 11月 15 16:30:27 raspberrypi bluetoothd[500]: sap-server: Operation not permitted (1) 11月 15 16:30:27 raspberrypi bluetoothd[500]: Endpoint registered: sender=:1.5 path=/MediaEndpoint/A2DPSource 11月 15 16:30:28 raspberrypi bluetoothd[500]: Endpoint registered: sender=:1.5 path=/MediaEndpoint/A2DPSink pi@raspberrypi:~

 

不過要是已批配且信賴之藍牙鍵盤與或滑鼠,不能重啟後容易主動連接︰

pi@raspberrypi:~ bluetoothctl  [NEW] Controller B8:27:EB:68:1A:C4 raspberrypi [default] [NEW] Device F1:A3:00:00:60:1D Bluetooth 3.0 Keyboard [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent  Default agent request successful [bluetooth]# list Controller B8:27:EB:68:1A:C4 raspberrypi [default] [bluetooth]# devices  Device F1:A3:00:00:60:1D Bluetooth 3.0 Keyboard [bluetooth]# info F1:A3:00:00:60:1D Device F1:A3:00:00:60:1D 	Name: Bluetooth 3.0 Keyboard 	Alias: Bluetooth 3.0 Keyboard 	Class: 0x002540 	Icon: input-keyboard 	Paired: yes 	Trusted: yes 	Blocked: no 	Connected: no 	LegacyPairing: no 	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb) 	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb) 	Modalias: usb:v04E8p7021d011B [CHG] Device F1:A3:00:00:60:1D Connected: yes [CHG] Device F1:A3:00:00:60:1D Connected: no [bluetooth]# connect F1:A3:00:00:60:1D Attempting to connect to F1:A3:00:00:60:1D [CHG] Device F1:A3:00:00:60:1D Connected: yes Connection successful [CHG] Device F1:A3:00:00:60:1D ServicesResolved: yes [Bluetooth 3.0 Keyboard]# quit Agent unregistered [DEL] Controller B8:27:EB:68:1A:C4 raspberrypi [default] pi@raspberrypi:~ 

 

實用上,豈非枉然耶??無怪乎早有『按時輪詢』之議也!!

Connect Bluetooth Keyboard at boot

clonmac

Tue Sep 06, 2016 11:19 pm

I am trying to configure the bluetooth on the RPi3 to automatically connect to my BT keyboard when it boots up, but am unable to get it to work. Currently I am using Raspbian and it boots to the login screen via GUI. Would anyone be able to help me out on how to configure it so it connects at bootup? The device is trusted via bluetoothctl and I can connect to it fine once I am logged in and I connect it manually.

 

 

 

 

 

 

 

 

輕。鬆。學。部落客