Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775

Warning: Cannot modify header information - headers already sent by (output started at /home/cra-log/www/index.php:1) in /home/cra-log/www/site-admin-wp/wp-includes/rest-api/class-wp-rest-server.php on line 1775
{"id":3564,"date":"2023-08-19T23:57:05","date_gmt":"2023-08-19T14:57:05","guid":{"rendered":"https:\/\/craft-gogo.com\/?p=3564"},"modified":"2023-08-19T23:57:06","modified_gmt":"2023-08-19T14:57:06","slug":"raspi-bluetoothctl","status":"publish","type":"post","link":"https:\/\/craft-gogo.com\/raspi-bluetoothctl\/","title":{"rendered":"\u3010Raspberry Pi\u3011bluetoothctl\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30a4\u30b9\u3092Bluetooth\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n

Raspberry Pi\u306b\u30d7\u30ec\u30b9\u30c6\u3084Switch\u306e\u30ef\u30a4\u30e4\u30ec\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u63a5\u7d9a\u3057\u3066\u3001\u64cd\u4f5c\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n

\u672c\u8a18\u4e8b\u3067\u306f\u3001Linux\u306ebluetoothctl\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30a4\u30b9\u3092Bluetooth\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

bluetoothctl\u3068\u306f<\/h2>\n\n\n\n

\u300cbluetoothctl\u300d\u3068\u306f\u3001Linux\u74b0\u5883\u306b\u304a\u3044\u3066Bluetooth\u30c7\u30d0\u30a4\u30b9\u306e\u7ba1\u7406\u3084\u64cd\u4f5c\u3092\u884c\u3046\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u3067\u3059\u3002Bluetooth\u30c7\u30d0\u30a4\u30b9\u306e\u30b9\u30ad\u30e3\u30f3\u3001\u30da\u30a2\u30ea\u30f3\u30b0\u3001\u63a5\u7d9a\u3001\u5207\u65ad\u306a\u3069\u306e\u64cd\u4f5c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u901a\u3058\u3066Bluetooth\u3092\u5236\u5fa1\u3067\u304d\u308b\u305f\u3081\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u81ea\u52d5\u5316\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n

\u5fc5\u8981\u306a\u6e96\u5099<\/h2>\n\n\n\n

\u901a\u5e38\u306eLinux\u74b0\u5883\u3067\u306f\u3001bluetoothctl\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u306f\u305a\u3067\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u6b21\u306e\u3088\u3046\u306b\u6253\u3061\u3001bluetoothctl\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

$ sudo apt -y install bluetooth bluez<\/code><\/pre><\/div>\n\n\n\n

\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3089\u3001bluetoothctl\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

$ bluetoothctl<\/code><\/pre><\/div>\n\n\n\n

\u8d77\u52d5\u3059\u308b\u3068\u6b21\u306b\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n

[bluetoothctl]#<\/code><\/pre><\/div>\n\n\n\n

bluetoothct\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u7d42\u4e86\u3059\u308b\u306b\u306f<\/p>\n\n\n\n

[bluetoothctl]# quit<\/code><\/pre><\/div>\n\n\n\n

\u3068\u6253\u3061\u307e\u3059\u3002<\/p>\n\n\n\n

\u30c7\u30d0\u30a4\u30b9\u3068\u306e\u63a5\u7d9a\u65b9\u6cd5<\/h2>\n\n\n\n

\u30b9\u30ad\u30e3\u30f3<\/h3>\n\n\n\n

\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u8fd1\u304f\u306eBluetooth\u30c7\u30d0\u30a4\u30b9\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n

[bluetoothctl]# scan on<\/code><\/pre><\/div>\n\n\n\n

\u30c7\u30d0\u30a4\u30b9\u304c\u30b9\u30ad\u30e3\u30f3\u3055\u308c\u308b\u3068\u3001MAC\u30a2\u30c9\u30ec\u30b9\u3068\u30c7\u30d0\u30a4\u30b9\u540d\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n

Discovery started\n[NEW] Device XX:XX:XX:XX:XX:XX [\u30c7\u30d0\u30a4\u30b9\u540d]<\/code><\/pre><\/div>\n\n\n\n

\u3053\u306eMAC\u30a2\u30c9\u30ec\u30b9\u306f\u3001\u30da\u30a2\u30ea\u30f3\u30b0\u3001\u63a5\u7d9a\u306b\u5fc5\u8981\u306e\u305f\u3081\u3001\u30b3\u30d4\u30fc\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

\u30b9\u30ad\u30e3\u30f3\u3092\u7d42\u3048\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u6253\u3061\u307e\u3059\u3002<\/p>\n\n\n\n

[bluetoothctl]# scan off<\/code><\/pre><\/div>\n\n\n\n

\u30da\u30a2\u30ea\u30f3\u30b0<\/h3>\n\n\n\n

\u30b9\u30ad\u30e3\u30f3\u3067\u691c\u51fa\u3057\u305f\u30c7\u30d0\u30a4\u30b9\u3068\u30da\u30a2\u30ea\u30f3\u30b0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

[bluetoothctl]# pair XX:XX:XX:XX:XX:XX<\/code><\/pre><\/div>\n\n\n\n

“XX:XX:XX:XX:XX:XX”\u306f\u30c7\u30d0\u30a4\u30b9\u306eMAC\u30a2\u30c9\u30ec\u30b9\u3067\u3059\u3002<\/p>\n\n\n\n

\u30c7\u30d0\u30a4\u30b9\u5074\u3067\u63a5\u7d9a\u8981\u6c42\u3092\u53d7\u3051\u5165\u308c\u305f\u5f8c\u3001bluetoothctl\u5074\u306e\u78ba\u8a8d\u4f9d\u983c\u306byes\u3092\u8fd4\u7b54\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

[agent] Confirm passkey xxxxxxx (yes\/no): yes<\/code><\/pre><\/div>\n\n\n\n

\u6700\u7d42\u7684\u306b\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u305f\u3089\u30da\u30a2\u30ea\u30f3\u30b0\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n\n

[CHG] Device XX:XX:XX:XX:XX:XX Paired: yes\nPairing successful<\/code><\/pre><\/div>\n\n\n\n

\u63a5\u7d9a<\/h3>\n\n\n\n

\u307e\u305a\u3001\u30c7\u30d0\u30a4\u30b9\u3092\u4fe1\u983c\u3067\u304d\u308b\u30c7\u30d0\u30a4\u30b9\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306b\u6253\u3061\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n

[bluetoothctl]# trust XX:XX:XX:XX:XX:XX<\/code><\/pre><\/div>\n\n\n\n

\u8a2d\u5b9a\u5b8c\u4e86\u306e\u8868\u793a\u304c\u3053\u3061\u3089\u3002<\/p>\n\n\n\n

[CHG] Device XX:XX:XX:XX:XX:XX Trusted: yes\nChanging XX:XX:XX:XX:XX:XX trust succeeded<\/code><\/pre><\/div>\n\n\n\n

\u6b21\u306b\u63a5\u7d9a\u3067\u3059\u3002<\/p>\n\n\n\n

[bluetoothctl]# connect XX:XX:XX:XX:XX:XX<\/code><\/pre><\/div>\n\n\n\n

\u63a5\u7d9a\u306b\u6210\u529f\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n

Attempting to connect to XX:XX:XX:XX:XX:XX\n[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes\nConnection successful\n[CHG] Device XX:XX:XX:XX:XX:XX ServicesResolved: yes\n[\u30c7\u30d0\u30a4\u30b9\u540d]#<\/code><\/pre><\/div>\n\n\n\n

\u5207\u65ad<\/h3>\n\n\n\n

\u30c7\u30d0\u30a4\u30b9\u3068\u5207\u65ad\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u307e\u3059\u3002<\/p>\n\n\n\n

[\u30c7\u30d0\u30a4\u30b9\u540d]# disconnect XX:XX:XX:XX:XX:XX<\/code><\/pre><\/div>\n\n\n\n

\u5207\u65ad\u5b8c\u4e86\u3055\u308c\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n

Attempting to disconnect from XX:XX:XX:XX:XX:XX\n[CHG] Device XX:XX:XX:XX:XX:XX ServicesResolved: no\nSuccessful disconnected\n[CHG] Device XX:XX:XX:XX:XX:XX Connected: no\n[bluetooth]#<\/code><\/pre><\/div>\n\n\n\n

\u4e3b\u306a\u30b3\u30de\u30f3\u30c9\u4e00\u89a7<\/h2>\n\n\n\n
\u30b3\u30de\u30f3\u30c9<\/th>\u8aac\u660e<\/th><\/tr><\/thead>
scan on<\/td>\u30da\u30a2\u30ea\u30f3\u30b0\u30fb\u63a5\u7d9a\u53ef\u80fd\u306a\u30c7\u30d0\u30a4\u30b9\u3092\u691c\u7d22\u3059\u308b<\/td><\/tr>
scan off<\/td>\u30da\u30a2\u30ea\u30f3\u30b0\u30fb\u63a5\u7d9a\u53ef\u80fd\u306a\u30c7\u30d0\u30a4\u30b9\u306e\u691c\u7d22\u3092\u505c\u6b62\u3059\u308b<\/td><\/tr>
devices<\/td>\u30da\u30a2\u30ea\u30f3\u30b0\u30fb\u63a5\u7d9a\u53ef\u80fd\u306a\u30c7\u30d0\u30a4\u30b9\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b<\/td><\/tr>
pair <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3068\u30da\u30a2\u30ea\u30f3\u30b0\u3059\u308b<\/td><\/tr>
paired-devices<\/td>\u30da\u30a2\u30ea\u30f3\u30b0\u3055\u308c\u3066\u3044\u308b\u30c7\u30d0\u30a4\u30b9\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b<\/td><\/tr>
trust <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u4fe1\u983c\u6e08\u306b\u3059\u308b<\/td><\/tr>
untrust <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u306b\u3059\u308b<\/td><\/tr>
connect <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3068\u63a5\u7d9a\u3059\u308b<\/td><\/tr>
disconnect <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3092\u5207\u65ad\u3059\u308b<\/td><\/tr>
info <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u60c5\u5831\u3092\u8868\u793a\u3059\u308b<\/td><\/tr>
remove <MAC\u30a2\u30c9\u30ec\u30b9><\/td><MAC\u30a2\u30c9\u30ec\u30b9>\u306e\u30c7\u30d0\u30a4\u30b9\u3068\u5207\u65ad\u3057\u3001\u30da\u30a2\u30ea\u30f3\u30b0\u60c5\u5831\u3092\u524a\u9664\u3059\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u307e\u3068\u3081<\/h2>\n\n\n\n

\u672c\u8a18\u4e8b\u3067\u306f\u3001Linux\u306ebluetoothctl\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30a4\u30b9\u3092Bluetooth\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n

bluetoothctl\u3092\u4f7f\u3048\u3070Bluetooth\u30c7\u30d0\u30a4\u30b9\u306e\u30b9\u30ad\u30e3\u30f3\u3001\u30da\u30a2\u30ea\u30f3\u30b0\u3001\u63a5\u7d9a\u3001\u5207\u65ad\u306a\u3069\u306e\u64cd\u4f5c\u3092\u7c21\u5358\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n

\u4eca\u56de\u306e\u8a18\u4e8b\u304c\u7686\u3055\u3093\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306b\u5f79\u7acb\u3064\u306a\u3089\u5e78\u3044\u3067\u3059\u3002<\/p>\n\n\n\n

\u6700\u5f8c\u307e\u3067\u8aad\u3093\u3067\u3044\u305f\u3060\u304d\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Raspberry Pi\u306b\u30d7\u30ec\u30b9\u30c6\u3084Switch\u306e\u30ef\u30a4\u30e4\u30ec\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u63a5\u7d9a\u3057\u3066\u3001\u64cd\u4f5c\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u305b\u3093\u304b\uff1f \u672c\u8a18\u4e8b\u3067\u306f\u3001Linux\u306ebluetoothctl\u3092\u4f7f\u3063\u3066\u30c7\u30d0\u30a4\u30b9\u3092Bluetooth\u63a5\u7d9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066 […]<\/p>\n","protected":false},"author":1,"featured_media":3578,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/posts\/3564"}],"collection":[{"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/comments?post=3564"}],"version-history":[{"count":16,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/posts\/3564\/revisions"}],"predecessor-version":[{"id":3583,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/posts\/3564\/revisions\/3583"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/media\/3578"}],"wp:attachment":[{"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/media?parent=3564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/categories?post=3564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craft-gogo.com\/wp-json\/wp\/v2\/tags?post=3564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}