{"id":288,"date":"2016-03-29T07:04:59","date_gmt":"2016-03-29T05:04:59","guid":{"rendered":"https:\/\/www.datenreise.de\/en\/?p=288"},"modified":"2018-03-19T23:07:08","modified_gmt":"2018-03-19T21:07:08","slug":"raspberry-pi-connect-bluetooth","status":"publish","type":"post","link":"https:\/\/www.datenreise.de\/en\/raspberry-pi-connect-bluetooth\/","title":{"rendered":"Raspberry Pi 3 &#8211; Connect Bluetooth"},"content":{"rendered":"<p>The Raspberry Pi 3 comes with WLAN and Bluetooth. The integrated Bluetooth module saves the purchase of an additional Bluetooth USB stick. In the following I explain the individual steps how to establish a Bluetooth connection on the console.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h4><strong>Difficulty level:<\/strong> <span style=\"color: #4f70c5;\"><i class=\"icon-wrench\"><\/i><\/span><span style=\"color: #cccccc;\"><i class=\"icon-wrench\"><\/i><i class=\"icon-wrench\"><\/i><i class=\"icon-wrench\"><\/i><\/span><\/h4>\n<hr \/>\n<p>&nbsp;<\/p>\n<h2>Setting up the Bluetooth connection<\/h2>\n<p>To use the integrated Bluetooth module of Raspberry Pi 3, either the latest Raspbian image is required or an upgrade should be performed first:<\/p>\n<pre>$ sudo apt-get update\r\n$ sudo apt-get dist-upgrade\r\n$ reboot<\/pre>\n<p>&nbsp;<\/p>\n<h4>Pairing<\/h4>\n<p>In order to bind two devices together, they must first be made known to each other. For newly configured Bluetooth devices, the pairing button (e.g. for keyboard \/ mouse \/ etc.) must be pressed. This means that the device is ready to establish a connection and often signals this state with a flashing LED.<\/p>\n<p>Pairing with other Bluetooth devices is done with the command <em>bluetoothctl<\/em>. After the start we enter the command mode:<\/p>\n<pre>$ sudo bluetoothctl<\/pre>\n<p>First, we activate a Bluetooth agent that takes care of the authorization of new devices. With the command <em>scan on<\/em> all Bluetooth devices within range can now be displayed:<\/p>\n<pre>[bluetooth]# agent on\r\n[bluetooth]# default-agent\r\n[bluetooth]# scan on<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.datenreise.de\/wp-content\/uploads\/2016\/03\/raspberry_bluetooth_scan.jpg\" alt=\"raspberry_bluetooth_scan\" width=\"630\" height=\"240\" class=\"aligncenter size-full wp-image-3815\" \/><\/p>\n<p>With the command <em>pair<\/em>, followed by the MAC address of the device, the connection can now be initiated. At the device to be connected we are now asked to enter the displayed PIN code:<\/p>\n<pre>[bluetooth]# pair xx:xx:xx:xx:xx:xx<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.datenreise.de\/wp-content\/uploads\/2016\/03\/raspberry_bluetooth_pairing.jpg\" alt=\"raspberry_bluetooth_pairing\" width=\"630\" height=\"102\" class=\"aligncenter size-full wp-image-3817\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Trust the device<\/h4>\n<p>After successful pairing, we should still mark the device as trustworthy. This means that the connection does not have to be made manually each time (e.g. after a restart). Then we can leave the Bluetooth tool:<\/p>\n<pre>[bluetooth]# trust xx:xx:xx:xx:xx:xx\r\n[bluetooth]# exit<\/pre>\n<div class=\"supportbox\"><p class=\"supporticon\"><i class=\"icon-heart-empty icon-3x\"><\/i><\/p><p class=\"supporttext\"><strong>This article was helpful for you?<\/strong><br \/>Please support Datenreise.de \u2013 Thank you!<\/p><a class=\"supportbtn\" href=\"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&hosted_button_id=6JPY2XDV9QYLA\" target=\"_blank\"><span class=\"btntext\">Donate<\/span><\/a><\/div>\n<hr \/>\n<span id=\"post-ratings-288\" class=\"post-ratings\" data-nonce=\"2cd78dbbe3\"><p><strong>Rate this Post:<\/strong><br \/>\r\n<img decoding=\"async\" id=\"rating_288_1\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_on.gif\" alt=\"1 Star\" title=\"1 Star\" onmouseover=\"current_rating(288, 1, '1 Star');\" onmouseout=\"ratings_off(5, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img decoding=\"async\" id=\"rating_288_2\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_on.gif\" alt=\"2 Stars\" title=\"2 Stars\" onmouseover=\"current_rating(288, 2, '2 Stars');\" onmouseout=\"ratings_off(5, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img decoding=\"async\" id=\"rating_288_3\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_on.gif\" alt=\"3 Stars\" title=\"3 Stars\" onmouseover=\"current_rating(288, 3, '3 Stars');\" onmouseout=\"ratings_off(5, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img decoding=\"async\" id=\"rating_288_4\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_on.gif\" alt=\"4 Stars\" title=\"4 Stars\" onmouseover=\"current_rating(288, 4, '4 Stars');\" onmouseout=\"ratings_off(5, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><img decoding=\"async\" id=\"rating_288_5\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/stars\/rating_on.gif\" alt=\"5 Stars\" title=\"5 Stars\" onmouseover=\"current_rating(288, 5, '5 Stars');\" onmouseout=\"ratings_off(5, 0, 0);\" onclick=\"rate_post();\" onkeypress=\"rate_post();\" style=\"cursor: pointer; border: 0px;\" \/><br \/>\r\n<span style=\"color:#999\">5.00\/5 (2 votes)<\/span>\r\n<\/p>\r\n<span class=\"hreview-aggregate\">\r\n  <span class=\"item\">\r\n    <span class=\"fn\">Raspberry Pi 3 &#8211; Connect Bluetooth<\/span>, \r\n  <\/span>\r\n  <span class=\"rating\">\r\n    <span class=\"average\">5.00<\/span> out of\r\n    <span class=\"best\">5<\/span> based on <span class=\"votes\">2<\/span> ratings\r\n  <\/span>\r\n<\/span><\/span><span id=\"post-ratings-288-loading\" class=\"post-ratings-loading\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.datenreise.de\/en\/wp-content\/plugins\/wp-postratings\/images\/loading.gif\" width=\"16\" height=\"16\" class=\"post-ratings-image\" \/>Loading...<\/span>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Raspberry Pi 3 comes with WLAN and Bluetooth. The integrated Bluetooth module saves the purchase of an additional Bluetooth USB stick. In the following I explain the individual steps how to establish a Bluetooth connection on the console. &nbsp;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":289,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,40],"tags":[122,7,49,123,44,48,124,107,8],"class_list":["post-288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-raspberry-pi","tag-bluetooth","tag-howto","tag-linux","tag-pairing","tag-raspberry-pi","tag-raspbian","tag-rpi3","tag-tips","tag-tutorial"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":1,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":290,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/posts\/288\/revisions\/290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/media\/289"}],"wp:attachment":[{"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datenreise.de\/en\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}