{"id":4610,"date":"2025-07-15T19:11:30","date_gmt":"2025-07-15T10:11:30","guid":{"rendered":"https:\/\/eternalsphere.net\/echoes\/?p=4610"},"modified":"2026-06-06T09:57:53","modified_gmt":"2026-06-06T00:57:53","slug":"49ztur0kx8qlkr0","status":"publish","type":"post","link":"https:\/\/eternalsphere.net\/echoes\/index.php\/2025\/07\/15\/49ztur0kx8qlkr0\/","title":{"rendered":"Linux \u84dd\u7259\u591a\u63a7\u5236\u5668\u5207\u6362\u4e0e\u624b\u5199\u677f\u81ea\u52a8\u65ad\u5f00\u8c03\u8bd5\u7b14\u8bb0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u5982\u679c\u540c\u65f6\u5b58\u5728\u5185\u7f6e\u84dd\u7259\u63a7\u5236\u5668\u548c USB \u84dd\u7259\u63a7\u5236\u5668\uff0c\u84dd\u7259\u8bbe\u5907\u7ba1\u7406\u4f1a\u53d8\u5f97\u590d\u6742\uff0c\u5c24\u5176\u5728\u6d89\u53ca\u81ea\u52a8\u65ad\u5f00\u8bbe\u5907\u3001\u5207\u6362\u63a7\u5236\u5668\u7b49\u9700\u6c42\u65f6\uff0c\u5e38\u4f1a\u9047\u5230\u610f\u60f3\u4e0d\u5230\u7684\u60c5\u51b5\u3002\u6b64\u6587\u8bb0\u5f55\u4e00\u6b21\u9488\u5bf9\u84dd\u7259\u624b\u5199\u677f\u7684\u8c03\u8bd5\u8fc7\u7a0b\uff0c\u4f5c\u4e3a\u53c2\u8003\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u80cc\u666f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9700\u8981\u4f7f\u7528\u811a\u672c\u81ea\u52a8\u65ad\u5f00\u84dd\u7259\u8bbe\u5907\uff08\u4f8b\u5982\u624b\u5199\u677f\uff09\uff0c\u811a\u672c\u4e2d\u4f7f\u7528 <code>bluetoothctl info<\/code> \u547d\u4ee4\u914d\u5408 <code>expect<\/code> \u81ea\u52a8\u5316\u4ea4\u4e92\u6d41\u7a0b\u3002\u7136\u800c\uff0c\u5728\u63a5\u5165 USB \u84dd\u7259\u63a7\u5236\u5668\u540e\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4ecd\u7136\u4f7f\u7528\u5185\u7f6e\u63a7\u5236\u5668\uff0c\u5bfc\u81f4\u811a\u672c\u65e0\u6cd5\u6b63\u5e38\u8bc6\u522b\u76ee\u6807\u8bbe\u5907\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u521d\u6b65\u73b0\u8c61<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c <code>bluetoothctl info<\/code> \u65f6\uff0c\u8f93\u51fa\u7684\u8bbe\u5907\u4fe1\u606f\u4e2d\uff0c<code>Device<\/code> \u884c\u5e76\u4e0d\u5305\u542b <code>(random)<\/code> \u6216 <code>(public)<\/code> \u6807\u8bb0\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Device AA:BB:CC:DD:EE:FF Generic Pen Tablet<br>Name: Generic Pen Tablet<br>Connected: yes<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u811a\u672c\u4e2d\u539f\u672c\u4f7f\u7528\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>regexp {Device ([A-F0-9:]+) \\(random\\)} $output match mac<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e\u7f3a\u5c11\u62ec\u53f7\u6807\u8bb0\uff0c\u8fd9\u6761\u6b63\u5219\u65e0\u6cd5\u6210\u529f\u63d0\u53d6 MAC \u5730\u5740\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u4fee\u6539\u6b63\u5219<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u8ba2\u540e\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u6539\u4e3a\u4e0d\u4f9d\u8d56\u62ec\u53f7\u6807\u8bb0\uff0c\u4ec5\u63d0\u53d6 MAC \u5730\u5740\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>regexp {Device ([A-F0-9:]+)} $output match mac<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\u53ef\u517c\u5bb9\u6240\u6709\u60c5\u51b5\uff0c\u65e0\u8bba <code>Device<\/code> \u884c\u540e\u9762\u662f\u5426\u5305\u542b\u62ec\u53f7\u4fe1\u606f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u63a7\u5236\u5668\u51b2\u7a81\u95ee\u9898<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7cfb\u7edf\u6240\u6709\u84dd\u7259\u63a7\u5236\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>bluetoothctl list<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u793a\u4f8b\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Controller 11:22:33:44:55:66 HostDevice [default]<br>Controller 77:88:99:AA:BB:CC HostDevice<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u89c1\uff0c\u7cfb\u7edf\u4f1a\u9ed8\u8ba4\u5c06\u5185\u7f6e\u84dd\u7259\uff08\u5982 <code>hci0<\/code>\uff09\u8bbe\u7f6e\u4e3a <code>[default]<\/code>\uff0c\u5373\u4f7f\u5c1d\u8bd5\u4f7f\u7528 <code>bluetoothctl select<\/code> \u5207\u6362\u63a7\u5236\u5668\uff0c\u7cfb\u7edf\u5185\u6838\u5c42\u9762\u4ecd\u4f1a\u4f18\u5148\u4f7f\u7528\u5185\u7f6e\u84dd\u7259\uff0c\u65e0\u6cd5\u771f\u6b63\u5207\u6362\u9ed8\u8ba4\u63a7\u5236\u5668\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u9a8c\u8bc1\u7ed1\u5b9a\u5173\u7cfb<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fdb\u4e00\u6b65\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4\u76ee\u6807\u8bbe\u5907\u7ed1\u5b9a\u5728\u54ea\u4e2a\u63a7\u5236\u5668\u4e0a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>find \/var\/lib\/bluetooth -type d -name \"AA:BB:CC:DD:EE:FF\"<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/var\/lib\/bluetooth\/77:88:99:AA:BB:CC\/AA:BB:CC:DD:EE:FF<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf4\u660e\u8be5\u8bbe\u5907\u5b9e\u9645\u7ed1\u5b9a\u5728 USB \u84dd\u7259\u63a7\u5236\u5668\uff08MAC: <code>77:88:99:AA:BB:CC<\/code>\uff09\u4e0b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u6f5c\u5728\u89e3\u51b3\u65b9\u6848<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u82e5\u5e0c\u671b\u5f7b\u5e95\u89e3\u51b3\u63a7\u5236\u5668\u51b2\u7a81\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6682\u65f6\u7981\u7528\u5185\u7f6e\u84dd\u7259\u63a7\u5236\u5668\uff0c\u8ba9\u7cfb\u7edf\u4ec5\u8bc6\u522b USB \u84dd\u7259\u63a7\u5236\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"blacklist btusb\" | sudo tee \/etc\/modprobe.d\/blacklist-btusb.conf<br>sudo update-initramfs -u<br>sudo reboot<br><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u9700\u6062\u590d\u5185\u7f6e\u84dd\u7259\uff0c\u5220\u9664\u5bf9\u5e94\u914d\u7f6e\u6587\u4ef6\u540e\u66f4\u65b0\u5e76\u91cd\u542f\u5373\u53ef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo rm \/etc\/modprobe.d\/blacklist-btusb.conf<br>sudo update-initramfs -u<br>sudo reboot<br><\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b9e\u9645\u7ed3\u679c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u7ec8\uff0c\u5c3d\u7ba1\u5b8c\u6210\u4e86\u6b63\u5219\u4fee\u6539\u5e76\u786e\u8ba4\u4e86\u7ed1\u5b9a\u5173\u7cfb\uff0c\u4f46\u7531\u4e8e\u591a\u63a7\u5236\u5668\u73af\u5883\u590d\u6742\uff0c\u5207\u6362\u9ed8\u8ba4\u63a7\u5236\u5668\u672a\u80fd\u6210\u529f\u3002\u4e0d\u8fc7\uff0c\u4ee5\u4e0a\u8c03\u8bd5\u8fc7\u7a0b\u4f9d\u7136\u5177\u6709\u4e00\u5b9a\u53c2\u8003\u4ef7\u503c\uff0c\u53ef\u4e3a\u65e5\u540e\u89e3\u51b3\u7c7b\u4f3c\u95ee\u9898\u63d0\u4f9b\u601d\u8def\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u84dd\u7259\u591a\u63a7\u5236\u5668\u73af\u5883\u4e0b\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u63a7\u5236\u5668\u4f1a\u5f71\u54cd\u8bbe\u5907\u7ba1\u7406<\/li>\n\n\n\n<li><code>bluetoothctl select<\/code> \u5e76\u4e0d\u80fd\u771f\u6b63\u5207\u6362\u7cfb\u7edf\u5168\u5c40\u9ed8\u8ba4\u63a7\u5236\u5668<\/li>\n\n\n\n<li>\u786e\u8ba4\u8bbe\u5907\u7ed1\u5b9a\u60c5\u51b5\u662f\u5224\u65ad\u95ee\u9898\u6839\u6e90\u7684\u5173\u952e\u4e00\u6b65<\/li>\n\n\n\n<li>\u7981\u7528\u5185\u7f6e\u84dd\u7259\u63a7\u5236\u5668\u662f\u6700\u76f4\u63a5\u7684\u5f7b\u5e95\u65b9\u6848<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u5982\u679c\u540c\u65f6\u5b58\u5728\u5185\u7f6e\u84dd\u7259\u63a7\u5236\u5668\u548c USB \u84dd\u7259\u63a7\u5236\u5668\uff0c\u84dd\u7259\u8bbe\u5907\u7ba1\u7406\u4f1a\u53d8\u5f97\u590d\u6742\uff0c\u5c24\u5176\u5728\u6d89\u53ca\u81ea\u52a8\u65ad\u5f00\u8bbe\u5907\u3001\u5207\u6362\u63a7\u5236\u5668\u7b49\u9700\u6c42\u65f6\uff0c\u5e38\u4f1a\u9047\u5230\u610f\u60f3\u4e0d\u5230\u7684\u60c5\u51b5\u3002\u6b64\u6587\u8bb0\u5f55\u4e00\u6b21\u9488\u5bf9\u84dd\u7259\u624b\u5199\u677f\u7684\u8c03\u8bd5\u8fc7\u7a0b\uff0c\u4f5c\u4e3a\u53c2\u8003\u3002 \u80cc\u666f \u9700\u8981\u4f7f\u7528\u811a\u672c\u81ea\u52a8\u65ad\u5f00\u84dd\u7259\u8bbe\u5907\uff08\u4f8b\u5982\u624b\u5199\u677f\uff09\uff0c\u811a\u672c\u4e2d\u4f7f\u7528 bluetoothctl info \u547d\u4ee4\u914d\u5408 expect \u81ea\u52a8\u5316\u4ea4\u4e92\u6d41\u7a0b\u3002\u7136\u800c\uff0c\u5728\u63a5\u5165 USB \u84dd\u7259\u63a7\u5236\u5668\u540e\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u4ecd\u7136\u4f7f\u7528\u5185\u7f6e\u63a7\u5236\u5668\uff0c\u5bfc\u81f4\u811a\u672c\u65e0\u6cd5\u6b63\u5e38\u8bc6\u522b\u76ee\u6807\u8bbe\u5907\u3002 \u521d\u6b65\u73b0\u8c61 \u6267\u884c bluetoothctl info \u65f6\uff0c\u8f93\u51fa\u7684\u8bbe\u5907\u4fe1\u606f\u4e2d\uff0cDevice \u884c\u5e76\u4e0d\u5305\u542b (random) \u6216 (public) \u6807\u8bb0\u3002\u4f8b\u5982\uff1a Device AA:BB:CC:DD:EE:FF Generic Pen TabletName: Generic Pen TabletConnected: yes \u811a\u672c\u4e2d\u539f\u672c\u4f7f\u7528\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u5982\u4e0b\uff1a regexp {Device ([A-F0-9:]+) \\(random\\)} $output match mac \u7531\u4e8e\u7f3a\u5c11\u62ec\u53f7\u6807\u8bb0\uff0c\u8fd9\u6761\u6b63\u5219\u65e0\u6cd5\u6210\u529f\u63d0\u53d6 MAC \u5730\u5740\u3002 \u4fee\u6539\u6b63\u5219 \u4fee\u8ba2\u540e\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u6539\u4e3a\u4e0d\u4f9d\u8d56\u62ec\u53f7\u6807\u8bb0\uff0c\u4ec5\u63d0\u53d6 MAC \u5730\u5740\uff1a regexp {Device &hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[205],"tags":[],"class_list":["post-4610","post","type-post","status-publish","format-standard","hentry","category-qzjvuuz9j7iauim"],"_links":{"self":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/comments?post=4610"}],"version-history":[{"count":1,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4610\/revisions"}],"predecessor-version":[{"id":4611,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/posts\/4610\/revisions\/4611"}],"wp:attachment":[{"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/media?parent=4610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/categories?post=4610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eternalsphere.net\/echoes\/index.php\/wp-json\/wp\/v2\/tags?post=4610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}