{"id":41211,"date":"2023-09-28T12:27:09","date_gmt":"2023-09-28T04:27:09","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=41211"},"modified":"2023-09-28T12:27:09","modified_gmt":"2023-09-28T04:27:09","slug":"lsyckfssj","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/41211.html","title":{"rendered":"Linux\u4f7f\u7528\u4e32\u53e3\u53d1\u9001\u6570\u636e"},"content":{"rendered":"

  \u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u662f\u4e00\u79cd\u975e\u5e38\u6709\u7528\u7684\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5b9e\u73b0\u8ba1\u7b97\u673a\u4e0e\u5916\u90e8\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u901a\u8fc7\u4f7f\u7528Linux\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u4e32\u884c\u7aef\u53e3\uff08\u4e5f\u79f0\u4e3a\u201c\u4e32\u53e3\u201d\uff09\u6765\u53d1\u9001\u548c\u63a5\u6536\u6570\u636e\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u63a2\u8ba8Linux\u4f7f\u7528\u4e32\u53e3\u53d1\u9001\u6570\u636e\u7684\u65b9\u6cd5\uff0c\u5e76\u8ba8\u8bba\u5b83\u7684\u4e00\u4e9b\u4f18\u70b9\u548c\u7f3a\u70b9\u3002<\/p>\n

\u8fde\u63a5\u8bbe\u5907<\/h2>\n

  \u8981\u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\uff0c\u9996\u5148\u8981\u8fde\u63a5\u5916\u90e8\u8bbe\u5907\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528USB\u6216RS-232\u8fde\u63a5\u5668\u6765\u5b9e\u73b0\u3002\u5982\u679c\u8981\u4f7f\u7528USB\u8fde\u63a5\u5668\uff0c\u8bf7\u786e\u4fddLinux\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5\u6700\u65b0\u7684USB\u9a71\u52a8\u7a0b\u5e8f\u3002\u5982\u679c\u8981\u4f7f\u7528RS-232\u8fde\u63a5\u5668\uff0c\u8bf7\u786e\u4fddLinux\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5\u6700\u65b0\u7684\u4e32\u53e3\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n

  \u8bbe\u7f6e\u4e32\u53e3\u901a\u4fe1<\/h3>\n

  \u5b8c\u6210\u8fde\u63a5\u8bbe\u5907\u4e4b\u540e\uff0c\u60a8\u9700\u8981\u8bbe\u7f6e\u4e32\u53e3\u901a\u4fe1\u3002\u4e3a\u6b64\uff0c\u60a8\u9700\u8981\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

  “`<\/p>\n

  sudo stty -F \/dev\/ttyS0 9600<\/p>\n

  “`<\/p>\n

  \u4e0a\u8ff0\u547d\u4ee4\u5c06\u8bbe\u7f6e\u4e32\u53e3\u7684\u6ce2\u7279\u7387\u4e3a9600\u6bd4\u7279\/\u79d2\u3002\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u6ce2\u7279\u7387\uff0c\u53ea\u9700\u66f4\u6539\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u7684\u6570\u5b57\u5373\u53ef\u3002<\/p>\n

  \u53d1\u9001\u6570\u636e<\/h3>\n

  \u5b8c\u6210\u8bbe\u7f6e\u4e32\u53e3\u901a\u4fe1\u4e4b\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u53d1\u9001\u6570\u636e\uff1a<\/p>\n

  “`<\/p>\n

  echo \u201cHello World\u201d > \/dev\/ttyS0<\/p>\n

  “`<\/p>\n

  \u4e0a\u8ff0\u547d\u4ee4\u5c06\u53d1\u9001\u201cHello World\u201d\u5b57\u7b26\u4e32\u5230\u4e32\u53e3\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u540c\u6837\u7684\u65b9\u6cd5\u53d1\u9001\u5176\u4ed6\u6570\u636e\uff0c\u53ea\u9700\u66f4\u6539\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u7684\u5b57\u7b26\u4e32\u5373\u53ef\u3002<\/p>\n

\u4f18\u70b9\u4e0e\u7f3a\u70b9<\/h2>\n

  \u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u6709\u4e00\u4e9b\u4f18\u70b9\u548c\u7f3a\u70b9\u3002<\/p>\n

  \u4f18\u70b9<\/h3>\n

  - \u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u975e\u5e38\u7b80\u5355\uff0c\u4e0d\u9700\u8981\u5b89\u88c5\u4efb\u4f55\u989d\u5916\u7684\u8f6f\u4ef6\u3002<\/p>\n

  - \u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684Linux\u547d\u4ee4\u6765\u53d1\u9001\u6570\u636e\uff0c\u8fd9\u4f7f\u5f97\u53d1\u9001\u6570\u636e\u53d8\u5f97\u66f4\u52a0\u5bb9\u6613\u3002<\/p>\n

  - \u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u53ef\u4ee5\u4fdd\u6301\u7a33\u5b9a\u6027\uff0c\u5e76\u4e14\u53ef\u4ee5\u63d0\u9ad8\u6570\u636e\u4f20\u8f93\u901f\u5ea6\u3002<\/p>\n

  \u7f3a\u70b9<\/h3>\n

  - \u5982\u679c\u6ca1\u6709\u6b63\u786e\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\u3002<\/p>\n

  - \u5982\u679c\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684\u9a71\u52a8\u7a0b\u5e8f\u4e0d\u6b63\u786e\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u53d1\u9001\u5931\u8d25\u3002<\/p>\n

  - \u5982\u679c\u6ca1\u6709\u6b63\u786e\u8bbe\u7f6e\u4e32\u53e3\u901a\u4fe1\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u53d1\u9001\u5931\u8d25\u3002<\/p>\n

\u603b\u7ed3<\/h2>\n

  \u7efc\u4e0a\u6240\u8ff0\uff0c\u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u662f\u4e00\u9879\u6709\u7528\u7684\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5b9e\u73b0\u8ba1\u7b97\u673a\u4e0e\u5916\u90e8\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u53ef\u4ee5\u8282\u7701\u65f6\u95f4\uff0c\u5e76\u4e14\u53ef\u4ee5\u4fdd\u6301\u7a33\u5b9a\u6027\u3002\u4f46\u662f\uff0c\u5982\u679c\u6ca1\u6709\u6b63\u786e\u5b89\u88c5\u9a71\u52a8\u7a0b\u5e8f\u6216\u8bbe\u7f6e\u4e32\u53e3\u901a\u4fe1\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u53d1\u9001\u5931\u8d25\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4f7f\u7528Linux\u53d1\u9001\u4e32\u53e3\u6570\u636e\u662f\u4e00\u79cd\u975e\u5e38\u6709\u7528\u7684\u6280\u672f\uff0c\u5b83\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5b9e\u73b0\u8ba1\u7b97\u673a\u4e0e\u5916\u90e8\u8bbe\u5907\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u901a\u8fc7\u4f7f\u7528Linux\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u4e32\u884c\u7aef\u53e3\uff08\u4e5f\u79f0\u4e3a\u201c\u4e32\u53e3\u201d\uff09\u6765\u53d1\u9001<\/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-41211","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\/41211","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=41211"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/41211\/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=41211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=41211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=41211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}