| Zeile 6: |
Zeile 6: |
| | === Erste Schritte === | | === Erste Schritte === |
| | | | |
| | + | * [https://kofler.info/bluetooth-konfiguration-im-terminal-mit-bluetoothctl/ kofler.info zu Pairen mit bluetoothctl] |
| | * '''Die''' [http://www.holtmann.org/linux/bluetooth/ Übersicht für Howtos für Bluetooth unter Linux] | | * '''Die''' [http://www.holtmann.org/linux/bluetooth/ Übersicht für Howtos für Bluetooth unter Linux] |
| | * Eine ältere [http://www.holtmann.org/papers/bluetooth/uptimes2003.html Anleitung zu Bluetooth unter Linux] | | * Eine ältere [http://www.holtmann.org/papers/bluetooth/uptimes2003.html Anleitung zu Bluetooth unter Linux] |
| Zeile 13: |
Zeile 14: |
| | * Eingebaute Bluetooth-Adapter anzeigen | | * Eingebaute Bluetooth-Adapter anzeigen |
| | hcitool dev | | hcitool dev |
| | + | * Oder mit ''bluetoothctl'' (benötigt Rechte der Gruppe <code>lp</code><ref>Siehe https://wiki.archlinux.org/index.php/bluetooth</ref> und/oder eine Anpassung der Rechte in <code>/etc/dbus-1/system.d/bluetooth.conf </code>) |
| | + | sudo adduser USER lp |
| | + | bluetoothctl |
| | + | list |
| | + | |
| | * Falls kein Adapter angezeigt wird, ist er möglicherweise geblockt: | | * Falls kein Adapter angezeigt wird, ist er möglicherweise geblockt: |
| | ** Anzeige der Funk-Geräte | | ** Anzeige der Funk-Geräte |
| Zeile 54: |
Zeile 60: |
| | | | |
| | durchführen. | | durchführen. |
| | + | |
| | + | === Automatisches Pairen und Vertrauen === |
| | + | |
| | + | ''Der folgende Tipp kann ein Sicherheitsrisiko darstellen:'' |
| | + | |
| | + | Um andere Geräte automatisch mit dem Linux-Server koppeln zu lassen und ihnen auch noch zu ''vertrauen(!)'', kann folgendes Skript benutzt werden. |
| | + | |
| | + | |
| | + | #!/bin/bash |
| | + | echo -e "pairable on\ndiscoverable on\nagent on\n" | bluetoothctl |
| | + | while true; do |
| | + | echo paired-devices | bluetoothctl \ |
| | + | | sed -n -e 's/^Device \(..:..:..:..:..:..\).*$/trust \1/p' \ |
| | + | | xargs -l -dz echo | bluetoothctl |
| | + | sleep 20s |
| | + | done |
| | | | |
| | === Linux-Server als Audio-Ausgabe === | | === Linux-Server als Audio-Ausgabe === |
| | + | |
| | + | Die üblichen Werkzeuge, um den Linux-Server als Audio-Ausgabe für ein Smartphone mit Hilfe der Kommandozeile einzurichten, sind bluetoothctl und [[PulseAudio]]. |
| | | | |
| | Siehe | | Siehe |
| | + | * https://askubuntu.com/questions/763939/bluetoothctl-what-is-a-bluetooth-agent |
| | + | * https://pi-buch.info/bluetooth-konfiguration-mit-bluetoothctl/ |
| | + | * https://github.com/ev3dev/ev3dev.github.io/pull/24/files/50787e9fae767f4a8e5e1748c5bb70b40eb9f259?short_path=2545682 |
| | * https://blog.stevenocchipinti.com/2012/10/bluetooth-audio-streaming-from-phone-to.html/ | | * https://blog.stevenocchipinti.com/2012/10/bluetooth-audio-streaming-from-phone-to.html/ |
| | | | |
| Zeile 176: |
Zeile 203: |
| | | | |
| | | | |
| | + | |
| | + | == Bluetooth vom Browser == |
| | + | |
| | + | In wenigen Browsern gibt es ein experimentelles Feature: die Web-Bluetooth-API. |
| | + | |
| | + | Im Firefox-Browser soll es diese API aus Sicherheitsgründen nicht geben (dem Nutzer können die Gefahren einer Low-Level-Bluetooth-Verbindung nicht leicht und verständlich genug mitgeteilt werden, was aber für das gefahrlose Browsen im Internet möglich sein muss). |
| | + | |
| | + | In Chrome und Edge gibt es diese [https://developer.chrome.com/docs/capabilities/bluetooth API] (u.U. freizuschalten in den Flags (about://flags#experimental-web-platform-features)). |
| | + | |
| | + | Zu Debugging-Zwecken integrieren diese auch ein einfaches Tool: |
| | + | |
| | + | * about://bluetooth-internals |
| | | | |
| | == Bluetooth und Java == | | == Bluetooth und Java == |