{"id":57178,"date":"2023-10-22T03:21:57","date_gmt":"2023-10-21T19:21:57","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=57178"},"modified":"2023-10-22T03:21:57","modified_gmt":"2023-10-21T19:21:57","slug":"sylxckfssj","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/57178.html","title":{"rendered":"\u4f7f\u7528Linux\u5411\u4e32\u53e3\u53d1\u9001\u6570\u636e"},"content":{"rendered":"

  Linux\u53ef\u4ee5\u901a\u8fc7\u4e32\u53e3\u7ebf\u8fde\u63a5\u5404\u79cd\u5916\u56f4\u8bbe\u5907\uff0c\u4ece\u800c\u5b9e\u73b0\u5411\u5916\u56f4\u8bbe\u5907\u53d1\u9001\u6570\u636e\u7684\u529f\u80fd\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u5411\u4e32\u53e3\u53d1\u9001\u6570\u636e\uff0c\u4ee5\u53ca\u53d1\u9001\u6570\u636e\u65f6\u53ef\u80fd\u9047\u5230\u7684\u4e00\u4e9b\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n

Linux\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f<\/h2>\n

  Linux\u7cfb\u7edf\u4e2d\u7684\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u662f\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7ed9\u7528\u6237\u7684\u4e00\u79cd\u63a5\u53e3\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u8fd9\u79cd\u63a5\u53e3\u6765\u63a7\u5236\u4e32\u53e3\u7684\u72b6\u6001\uff0c\u4ece\u800c\u5b9e\u73b0\u5411\u5916\u56f4\u8bbe\u5907\u53d1\u9001\u6570\u636e\u7684\u529f\u80fd\u3002<\/p>\n

  \u67e5\u770b\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f<\/h3>\n

  \u8981\u67e5\u770bLinux\u7cfb\u7edf\u4e2d\u7684\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u201clsmod\u201d\uff0c\u8be5\u547d\u4ee4\u5c06\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u4e2d\u6b63\u5728\u8fd0\u884c\u7684\u6240\u6709\u9a71\u52a8\u7a0b\u5e8f\uff0c\u5305\u62ec\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

  \u5b89\u88c5\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f<\/h3>\n

  \u5982\u679c\u5f53\u524d\u7cfb\u7edf\u4e2d\u6ca1\u6709\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u201csudo apt-get install \u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u540d\u79f0\u201d\u6765\u5b89\u88c5\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

Linux\u4e32\u53e3\u53d1\u9001\u6570\u636e<\/h2>\n

  \u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u201cecho\u201d\u547d\u4ee4\u5411\u4e32\u53e3\u53d1\u9001\u6570\u636e\uff0c\u8be5\u547d\u4ee4\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u6216\u8005\u4e8c\u8fdb\u5236\u6570\u636e\u53d1\u9001\u81f3\u4e32\u53e3\u3002<\/p>\n

  echo\u547d\u4ee4\u53c2\u6570<\/h3>\n

  \u4f7f\u7528echo\u547d\u4ee4\u53d1\u9001\u6570\u636e\u65f6\uff0c\u9700\u8981\u6307\u5b9a\u53d1\u9001\u6570\u636e\u7684\u4e32\u53e3\u8bbe\u5907\u540d\u79f0\uff0c\u4ee5\u53ca\u53d1\u9001\u7684\u6570\u636e\u5185\u5bb9\u3002\u4f8b\u5982\uff1aecho “Hello World” > \/dev\/ttyS0\uff0c\u8868\u793a\u5c06\u5b57\u7b26\u4e32\u201cHello World\u201d\u53d1\u9001\u81f3\u4e32\u53e3\u8bbe\u5907\/dev\/ttyS0\u3002<\/p>\n

  echo\u547d\u4ee4\u53d1\u9001\u4e8c\u8fdb\u5236\u6570\u636e<\/h3>\n

  echo\u547d\u4ee4\u4e5f\u53ef\u4ee5\u53d1\u9001\u4e8c\u8fdb\u5236\u6570\u636e\uff0c\u4f8b\u5982\uff1aecho -ne “x01x02x03x04” > \/dev\/ttyS0\uff0c\u8868\u793a\u5c06\u4e8c\u8fdb\u5236\u6570\u636e\u201cx01x02x03x04\u201d\u53d1\u9001\u81f3\u4e32\u53e3\u8bbe\u5907\/dev\/ttyS0\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Linux\u5411\u4e32\u53e3\u53d1\u9001\u6570\u636e\uff0c\u5305\u62ecLinux\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u7684\u67e5\u770b\u548c\u5b89\u88c5\uff0c\u4ee5\u53ca\u4f7f\u7528echo\u547d\u4ee4\u53d1\u9001\u5b57\u7b26\u4e32\u548c\u4e8c\u8fdb\u5236\u6570\u636e\u7684\u65b9\u6cd5\u3002<\/strong>\u901a\u8fc7\u638c\u63e1\u8fd9\u4e9b\u77e5\u8bc6\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u63a7\u5236Linux\u7cfb\u7edf\u4e2d\u7684\u4e32\u53e3\uff0c\u5b9e\u73b0\u5411\u5916\u56f4\u8bbe\u5907\u53d1\u9001\u6570\u636e\u7684\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux\u53ef\u4ee5\u901a\u8fc7\u4e32\u53e3\u7ebf\u8fde\u63a5\u5404\u79cd\u5916\u56f4\u8bbe\u5907\uff0c\u4ece\u800c\u5b9e\u73b0\u5411\u5916\u56f4\u8bbe\u5907\u53d1\u9001\u6570\u636e\u7684\u529f\u80fd\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u5411\u4e32\u53e3\u53d1\u9001\u6570\u636e\uff0c\u4ee5\u53ca\u53d1\u9001\u6570\u636e\u65f6\u53ef\u80fd\u9047\u5230\u7684\u4e00\u4e9b\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n","protected":false},"author":1,"featured_media":4132,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"categories":[36],"tags":[69],"class_list":["post-57178","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-cktx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/57178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=57178"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/57178\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/4132"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=57178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=57178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=57178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}