{"id":224,"date":"2019-04-13T12:11:42","date_gmt":"2019-04-13T12:11:42","guid":{"rendered":"http:\/\/jeedom.sigalou-domotique.fr\/activer-port-bluetooth-au-demarrage-de-jeedom"},"modified":"2024-04-21T13:18:13","modified_gmt":"2024-04-21T11:18:13","slug":"activer-port-bluetooth-au-demarrage-de-jeedom","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/zh\/activer-port-bluetooth-au-demarrage-de-jeedom","title":{"rendered":"\u542f\u52a8 Jeedom \u65f6\u542f\u7528\u84dd\u7259\u7aef\u53e3"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-220\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/souciblea.png\" alt=\"\u5fe7\u8651 \u767d \uff0c\" width=\"586\" height=\"190\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/souciblea.png 586w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/souciblea-300x97.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/p>\n<p>\u5982\u679c\u50cf\u6211\u4e00\u6837\uff0c\u5f53\u4f60\u91cd\u65b0\u542f\u52a8\u6811\u8393\u65f6\uff0c\u4f60\u5f88\u96be\u542f\u52a8BLEA\u63d2\u4ef6\uff0c\u5b83\u53ef\u80fd\u662f\u3002 <strong>\u521d\u59cb\u5316 HCI0 \u7aef\u53e3\u7684\u95ee\u9898\u3002<\/strong><!--more--><\/p>\n<p>\u4f60\u4f1a\u544a\u8bc9\u6211\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Raspbian\u4e2d\u914d\u7f6e\u8fd9\u4e2a\uff0c\u4f46\u6211\u66f4\u559c\u6b22\u5728\u542f\u52a8Jeedom\u65f6\u96c6\u6210\u5b83\uff0c\u56e0\u6b64\u4fdd\u5b58\u4e86\u5b83\uff0c\u5e76\u4e14\u91cd\u65b0\u683c\u5f0f\u5316Raspbian Lite +\u5bf9Jeedom\u5907\u4efd\u7684\u6062\u590d\u5c06\u8db3\u4ee5\u8ba9\u4e00\u5207\u518d\u6b21\u5de5\u4f5c\uff0c\u800c\u65e0\u9700\u64cd\u7eb5Raspberry OS\u6587\u4ef6\u3002<\/p>\n<p>\u4e3a\u6b64\uff0c\u6211\u5c06\u521b\u5efa\u4e00\u4e2a\u542f\u52a8\u4ee5\u4e0b\u547d\u4ee4\u7684 php \u811a\u672c\uff1a<\/p>\n<ul>\n<li>sudo systemctl \u542f\u7528 hciuart<\/li>\n<li>sudo systemctl \u542f\u52a8 hciuart<\/li>\n<li>sudo hciconfig HCIO<\/li>\n<li>sudo hciconfig HCIO<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u811a\u672c\uff0c\u6211\u5c06\u542f\u52a8\u5b83\u611f\u8c22\u4e00\u4e2a\u573a\u666f\u3002<\/p>\n<h2>\u521b\u5efa\u811a\u672c\u6587\u4ef6<\/h2>\n<p>\u4f7f\u7528\u63d2\u4ef6 <strong>\u811a\u672c \u811a\u672c<\/strong>, \u521b\u5efa\u4e00\u4e2a\u52a8\u4f5c\u547d\u4ee4 <strong>\u811a\u672c \u811a\u672c<\/strong> \u8f74\u627f\u4f5c\u4e3a\u540d\u5b57 <em><strong>Init \u84dd\u7259<\/strong><\/em> \u5728\u7530\u91ce\u91cc <strong>\u67e5\u8be2 \u67e5\u8be2<\/strong>, \u653e\uff1a<\/p>\n<p><strong>\/var\/www\/html\/plugins\/script\/core\/resources\/init-bluetooth.php<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-221\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scriptblea.png\" alt=\"\u811a\u672c \u5b57\u5e55 \uff0c\" width=\"752\" height=\"184\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scriptblea.png 752w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scriptblea-600x147.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scriptblea-300x73.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/p>\n<p>\u5728\u8fd9\u4e2a\u6587\u4ef6 init-bluetooth.php \u4e2d\uff0c\u653e\u7f6e\u4f60\u7684\u811a\u672c\uff1a<\/p>\n<p><code>#\/usr\/bin\/php<\/code><br \/>\n<code>&lt;!--?php$hostname = \"localhost\";<\/code><br \/>\n<code>$\u7528\u6237\u540d=\"pi\";<\/code><br \/>\n<code>$\u5bc6\u7801=\"raspberry\"\uff1b <\/code><\/p>\n<p><code>$SSH = ssh2_connect\uff08$\u4e3b\u673a\u540d\uff0c22\uff1b<\/code><br \/>\n<code>ssh2_auth _password\uff08$SSH, $\u7528\u6237\u540d\u3001 $\u5bc6\u7801\uff1b<\/code><br \/>\n<code>$ssh2_exec\uff08$SSH\uff0c\"sudo systemctl enable hciuart\"\uff09\uff1b<\/code><br \/>\n<code>$ssh2_exec\uff08$SSH\uff0c\"sudo systemctl start hciuart\"\uff09;<\/code><br \/>\n<code>$ssh2_exec\uff08$SSH\uff0c\"sudo hciconfig HCIO down\"\uff09;<\/code><br \/>\n<code>$ssh2_exec\uff08$SSH\uff0c\"sudo hciconfig HCIO up\";<\/code><br \/>\n<code>\uff1f<\/code><\/p>\n<p>\u5f53\u7136\uff0c\u66f4\u6b63\u60a8\u8fde\u63a5\u5230 ssh \u7684\u767b\u5f55\u540d\u548c\u5bc6\u7801\u3002<\/p>\n<h2>\u521b\u5efa\u5728\u542f\u52a8\u65f6\u542f\u52a8\u7684\u573a\u666f<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-222\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage.png\" alt=\"\u542f\u52a8\u65b9\u6848\" width=\"969\" height=\"169\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage.png 969w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage-600x105.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage-300x52.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage-768x134.png 768w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/p>\n<p>\u4e00\u5207\u90fd\u5728\u56fe\u50cf\u4e0a\uff0c\u8bf7\u6ce8\u610f\uff0c\u8981\u8ba9\u573a\u666f\u5728\u542f\u52a8\u65f6\u8fd0\u884c\uff0c\u4f60\u5fc5\u987b\u4f7f\u7528\u3002 <strong>\u6311\u8845 \u7684<\/strong> \u4f5c\u4e3a\u89e6\u53d1\u5668\uff1a <strong>#\u5f00\u59cb \u5f00\u59cb#<\/strong><\/p>\n<p>\u6b64\u573a\u666f\u4ec5\u5305\u542b\u4e00\u4e2a\u547d\u4ee4\uff0c\u542f\u52a8\u4e4b\u524d\u521b\u5efa\u7684\u811a\u672c\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-223\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage2.png\" alt=\"\u542f\u52a8\u65b9\u68482\" width=\"731\" height=\"120\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage2.png 731w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage2-600x98.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2019\/04\/scenariodemarrage2-300x49.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<h3><\/h3>\n<h3><\/h3>\n<h3>\u5c31\u8fd9\u6837 \u7ed3\u675f\u4e86 \u4e00\u4ef6\u597d\u4e8b\u89e3\u51b3\u4e86\uff01\uff01\uff01\uff01\uff01<\/h3>","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u50cf\u6211\u4e00\u6837\uff0c\u5f53\u4f60\u91cd\u65b0\u542f\u52a8 Raspberry \u65f6\uff0c\u4f60\u5f88\u96be\u542f\u52a8 BLEA \u63d2\u4ef6\uff0c\u90a3\u4e48\u521d\u59cb\u5316 HCI0 \u7aef\u53e3\u53ef\u80fd\u662f\u4e2a\u95ee\u9898\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,23],"tags":[],"class_list":["post-224","post","type-post","status-publish","format-standard","hentry","category-domotique","category-jeedom-2"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts\/224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/comments?post=224"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/posts\/224\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/media?parent=224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/categories?post=224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/zh\/wp-json\/wp\/v2\/tags?post=224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}