{"id":123202,"date":"2026-11-06T21:08:54","date_gmt":"2026-11-06T13:08:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/123202.html"},"modified":"2026-11-06T21:08:54","modified_gmt":"2026-11-06T13:08:54","slug":"%e4%bb%8e%e9%9b%b6%e6%9e%84%e5%bb%ba%e5%b5%8c%e5%85%a5%e5%bc%8fweb%e7%9b%91%e6%8e%a7%ef%bc%9aimx6ull%e4%b8%8eboa%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%9a%84%e6%b7%b1%e5%ba%a6%e5%af%b9%e8%af%9d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/123202.html","title":{"rendered":"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<h2>\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7&#xff1a;IMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd<\/h2>\n<p>\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5f00\u53d1\u9886\u57df&#xff0c;\u5c06\u9ad8\u6027\u80fd\u5904\u7406\u5668\u4e0e\u8f7b\u91cf\u7ea7\u8f6f\u4ef6\u65b9\u6848\u7ed3\u5408&#xff0c;\u521b\u9020\u51fa\u7a33\u5b9a\u53ef\u9760\u7684\u7269\u8054\u7f51\u8bbe\u5907&#xff0c;\u4e00\u76f4\u662f\u5de5\u7a0b\u5e08\u4eec\u8ffd\u6c42\u7684\u76ee\u6807\u3002NXP\u7684i.MX6ULL\u5904\u7406\u5668\u4ee5\u5176\u51fa\u8272\u7684\u80fd\u6548\u6bd4\u548c\u4e30\u5bcc\u7684\u5916\u8bbe\u63a5\u53e3&#xff0c;\u6210\u4e3a\u4f17\u591a\u5d4c\u5165\u5f0f\u9879\u76ee\u7684\u9996\u9009\u5e73\u53f0\u3002\u5f53\u8fd9\u9897\u5f3a\u5927\u7684\u82af\u7247\u9047\u4e0a\u8f7b\u91cf\u7ea7Web\u670d\u52a1\u5668Boa&#xff0c;\u518d\u914d\u5408OV5640\u6444\u50cf\u5934\u6a21\u5757\u548cMJPG-Streamer\u89c6\u9891\u6d41\u670d\u52a1&#xff0c;\u4fbf\u80fd\u6784\u5efa\u51fa\u4e00\u5957\u5b8c\u6574\u7684\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\u89e3\u51b3\u65b9\u6848\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u8fd9\u4e00\u6280\u672f\u7ec4\u5408\u7684\u5b9e\u73b0\u7ec6\u8282&#xff0c;\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u8005\u548c\u7269\u8054\u7f51\u6280\u672f\u7231\u597d\u8005\u63d0\u4f9b\u4e00\u4efd\u8be6\u5b9e\u7684\u5b9e\u8df5\u6307\u5357\u3002<\/p>\n<h3>1. \u786c\u4ef6\u5e73\u53f0\u9009\u578b\u4e0e\u73af\u5883\u642d\u5efa<\/h3>\n<p>i.MX6ULL\u662fNXP\u516c\u53f8\u63a8\u51fa\u7684\u57fa\u4e8eARM Cortex-A7\u67b6\u6784\u7684\u9ad8\u80fd\u6548\u5e94\u7528\u5904\u7406\u5668&#xff0c;\u4e3b\u9891\u53ef\u8fbe900MHz&#xff0c;\u96c6\u6210\u4e86\u4e30\u5bcc\u7684\u5916\u8bbe\u63a5\u53e3\u5305\u62ecCSI\u6444\u50cf\u5934\u63a5\u53e3\u3001\u4ee5\u592a\u7f51MAC\u3001USB\u7b49&#xff0c;\u975e\u5e38\u9002\u5408\u9700\u8981\u591a\u5a92\u4f53\u5904\u7406\u548c\u7f51\u7edc\u8fde\u63a5\u7684\u5d4c\u5165\u5f0f\u5e94\u7528\u3002\u5728\u9009\u62e9\u5f00\u53d1\u677f\u65f6&#xff0c;\u9700\u8981\u8003\u8651\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u56e0\u7d20&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58\u914d\u7f6e&#xff1a;\u5efa\u8bae\u81f3\u5c11\u914d\u5907256MB DDR3\u5185\u5b58&#xff0c;\u4ee5\u786e\u4fdd\u7cfb\u7edf\u8fd0\u884c\u6d41\u7545<\/li>\n<li>\u5b58\u50a8\u65b9\u6848&#xff1a;eMMC\u6216NAND Flash\u5b58\u50a8&#xff0c;\u5bb9\u91cf\u4e0d\u5c0f\u4e8e4GB<\/li>\n<li>\u7f51\u7edc\u63a5\u53e3&#xff1a;10\/100M\u4ee5\u592a\u7f51\u63a5\u53e3\u662f\u5fc5\u5907\u7684&#xff0c;\u53ef\u9009Wi-Fi\u6a21\u5757\u6269\u5c55\u65e0\u7ebf\u8fde\u63a5<\/li>\n<li>\u6444\u50cf\u5934\u63a5\u53e3&#xff1a;\u652f\u6301MIPI CSI\u6216\u5e76\u884cCSI\u63a5\u53e3&#xff0c;\u786e\u4fdd\u4e0eOV5640\u6a21\u5757\u517c\u5bb9<\/li>\n<\/ul>\n<p>\u5f00\u53d1\u73af\u5883\u642d\u5efa\u9700\u8981\u51c6\u5907\u4ee5\u4e0b\u5de5\u5177\u94fe\u548c\u8f6f\u4ef6\u5305&#xff1a;<\/p>\n<p># \u5b89\u88c5\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u94fe<br \/>\nsudo apt-get install gcc-arm-linux-gnueabihf<br \/>\nsudo apt-get install g&#043;&#043;-arm-linux-gnueabihf<\/p>\n<p># \u5b89\u88c5\u5fc5\u8981\u7684\u5f00\u53d1\u5e93<br \/>\nsudo apt-get install libncurses5-dev<br \/>\nsudo apt-get install libssl-dev<br \/>\nsudo apt-get install flex<br \/>\nsudo apt-get install bison<\/p>\n<p>\u63d0\u793a&#xff1a;\u5efa\u8bae\u4f7f\u7528Ubuntu 18.04\u621620.04 LTS\u7248\u672c\u4f5c\u4e3a\u5f00\u53d1\u4e3b\u673a\u7cfb\u7edf&#xff0c;\u8fd9\u4e9b\u7248\u672c\u7684\u8f6f\u4ef6\u5305\u517c\u5bb9\u6027\u7ecf\u8fc7\u5e7f\u6cdb\u9a8c\u8bc1\u3002<\/p>\n<p>\u786c\u4ef6\u8fde\u63a5\u65b9\u9762&#xff0c;OV5640\u6444\u50cf\u5934\u6a21\u5757\u4e0ei.MX6ULL\u7684\u8fde\u63a5\u9700\u8981\u7279\u522b\u6ce8\u610f\u4fe1\u53f7\u5b8c\u6574\u6027\u3002CSI\u63a5\u53e3\u7684\u5e03\u7ebf\u5e94\u4fdd\u6301\u7b49\u957f&#xff0c;\u65f6\u949f\u4fe1\u53f7\u9700\u8981\u826f\u597d\u7684\u5c4f\u853d\u3002\u5728\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u6211\u4eec\u9047\u5230\u8fc7\u56e0\u4fe1\u53f7\u8d28\u91cf\u95ee\u9898\u5bfc\u81f4\u7684\u56fe\u50cf\u566a\u70b9\u95ee\u9898&#xff0c;\u901a\u8fc7\u6dfb\u52a0\u5408\u9002\u7684\u7ec8\u7aef\u7535\u963b\u548c\u6ee4\u6ce2\u7535\u5bb9\u5f97\u4ee5\u89e3\u51b3\u3002<\/p>\n<h3>2. \u6784\u5efa\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf<\/h3>\n<p>\u4e3ai.MX6ULL\u6784\u5efa\u5b9a\u5236\u5316\u7684Linux\u7cfb\u7edf\u662f\u9879\u76ee\u6210\u529f\u7684\u57fa\u7840\u3002\u6211\u4eec\u9700\u8981\u4eceBootloader\u3001Kernel\u5230Rootfs\u8fdb\u884c\u5b8c\u6574\u7684\u914d\u7f6e\u548c\u7f16\u8bd1\u3002<\/p>\n<h4>2.1 Bootloader\u914d\u7f6e<\/h4>\n<p>U-Boot\u4f5c\u4e3a\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f&#xff0c;\u9700\u8981\u9488\u5bf9\u5177\u4f53\u7684\u786c\u4ef6\u5e73\u53f0\u8fdb\u884c\u914d\u7f6e\u3002\u5173\u952e\u914d\u7f6e\u9879\u5305\u62ec&#xff1a;<\/p>\n<p># Makefile\u914d\u7f6e\u9009\u62e9<br \/>\nmake ARCH&#061;arm CROSS_COMPILE&#061;arm-linux-gnueabihf- imx6ull_14x14_evk_defconfig<\/p>\n<p># \u7279\u5b9a\u786c\u4ef6\u8c03\u6574<br \/>\nmake ARCH&#061;arm CROSS_COMPILE&#061;arm-linux-gnueabihf- menuconfig<\/p>\n<p>\u5728U-Boot\u914d\u7f6e\u4e2d&#xff0c;\u9700\u8981\u786e\u4fdd\u4ee5\u4e0b\u529f\u80fd\u88ab\u542f\u7528&#xff1a;<\/p>\n<ul>\n<li>\u7f51\u7edc\u652f\u6301&#xff1a;TFTP\u4e0b\u8f7d\u3001PING\u547d\u4ee4<\/li>\n<li>\u5b58\u50a8\u652f\u6301&#xff1a;eMMC\/SD\u5361\u8bfb\u5199<\/li>\n<li>\u8bbe\u5907\u6811\u652f\u6301&#xff1a;\u6b63\u786e\u7684\u8bbe\u5907\u6811\u6587\u4ef6\u7f16\u8bd1<\/li>\n<\/ul>\n<h4>2.2 Linux\u5185\u6838\u5b9a\u5236<\/h4>\n<p>\u5185\u6838\u914d\u7f6e\u9700\u8981\u9488\u5bf9\u5d4c\u5165\u5f0f\u76d1\u63a7\u5e94\u7528\u8fdb\u884c\u4f18\u5316&#xff0c;\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5173\u952e\u914d\u7f6e\u9879&#xff1a;<\/p>\n<p># \u751f\u6210\u9ed8\u8ba4\u914d\u7f6e<br \/>\nmake ARCH&#061;arm imx_v6_v7_defconfig<br \/>\nmake ARCH&#061;arm menuconfig<\/p>\n<p>\u5fc5\u8981\u7684\u5185\u6838\u9009\u9879\u5305\u62ec&#xff1a;<\/p>\n<table>\n<tr>\u914d\u7f6e\u7c7b\u522b\u5177\u4f53\u9009\u9879\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u8bbe\u5907\u9a71\u52a8<\/td>\n<td>OV5640\u6444\u50cf\u5934\u9a71\u52a8<\/td>\n<td>\u542f\u7528V4L2\u63a5\u53e3\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u6587\u4ef6\u7cfb\u7edf<\/td>\n<td>EXT4\u3001JFFS2\u3001RAMFS<\/td>\n<td>\u652f\u6301\u591a\u79cd\u5b58\u50a8\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u7f51\u7edc\u529f\u80fd<\/td>\n<td>TCP\/IP\u5806\u6808\u3001Netfilter<\/td>\n<td>\u5b8c\u6574\u7684\u7f51\u7edc\u534f\u8bae\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u591a\u5a92\u4f53<\/td>\n<td>V4L2\u6846\u67b6\u3001MJPG\u7f16\u7801<\/td>\n<td>\u89c6\u9891\u91c7\u96c6\u548c\u5904\u7406\u80fd\u529b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6ce8\u610f&#xff1a;\u5185\u6838\u5c3a\u5bf8\u9700\u8981\u4e25\u683c\u63a7\u5236&#xff0c;\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u529f\u80fd\u6a21\u5757\u589e\u52a0\u5185\u5b58\u5360\u7528\u3002<\/p>\n<h4>2.3 \u6839\u6587\u4ef6\u7cfb\u7edf\u6784\u5efa<\/h4>\n<p>\u4f7f\u7528Buildroot\u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u8f7b\u91cf\u7ea7\u7684\u6839\u6587\u4ef6\u7cfb\u7edf&#xff1a;<\/p>\n<p># \u4e0b\u8f7dBuildroot<br \/>\nwget https:\/\/buildroot.org\/downloads\/buildroot-2023.02.tar.gz<br \/>\ntar xvf buildroot-2023.02.tar.gz<\/p>\n<p># \u914d\u7f6e\u57fa\u672c\u7cfb\u7edf<br \/>\nmake menuconfig<\/p>\n<p>\u5173\u952e\u8f6f\u4ef6\u5305\u9009\u62e9&#xff1a;<\/p>\n<ul>\n<li>BusyBox&#xff1a;\u63d0\u4f9b\u57fa\u672c\u547d\u4ee4\u884c\u5de5\u5177<\/li>\n<li>Dropbear&#xff1a;\u8f7b\u91cf\u7ea7SSH\u670d\u52a1\u5668<\/li>\n<li>Lighttpd\u6216Boa&#xff1a;Web\u670d\u52a1\u5668<\/li>\n<li>\u5fc5\u8981\u7684\u5e93\u6587\u4ef6&#xff1a;libjpeg\u3001zlib\u3001libpng<\/li>\n<\/ul>\n<p>\u6587\u4ef6\u7cfb\u7edf\u5e03\u5c40\u5efa\u8bae\u91c7\u7528\u4ee5\u4e0b\u7ed3\u6784&#xff1a;<\/p>\n<p>\/root<br \/>\n\u251c\u2500\u2500 www                 # Web\u670d\u52a1\u5668\u6839\u76ee\u5f55<br \/>\n\u251c\u2500\u2500 cgi-bin            # CGI\u7a0b\u5e8f\u76ee\u5f55<br \/>\n\u251c\u2500\u2500 scripts            # \u7cfb\u7edf\u811a\u672c<br \/>\n\u2514\u2500\u2500 config             # \u914d\u7f6e\u6587\u4ef6<\/p>\n<h3>3. Boa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u96c6\u6210<\/h3>\n<p>Boa\u662f\u4e00\u6b3e\u5355\u4efb\u52a1\u7684HTTP\u670d\u52a1\u5668&#xff0c;\u6e90\u4ee3\u7801\u5f00\u653e\u3001\u6027\u80fd\u4f18\u79c0&#xff0c;\u7279\u522b\u9002\u5408\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5e94\u7528\u3002\u5176\u6700\u5927\u7279\u70b9\u5c31\u662f\u8d44\u6e90\u5360\u7528\u5c11&#xff0c;\u5728i.MX6ULL\u5e73\u53f0\u4e0a\u5185\u5b58\u5360\u7528\u4ec5\u51e0\u767eKB\u3002<\/p>\n<h4>3.1 Boa\u7684\u4ea4\u53c9\u7f16\u8bd1<\/h4>\n<p>\u9996\u5148\u4ece\u5b98\u7f51\u4e0b\u8f7dBoa\u6e90\u4ee3\u7801&#xff0c;\u7136\u540e\u8fdb\u884c\u4ea4\u53c9\u7f16\u8bd1&#xff1a;<\/p>\n<p># \u4e0b\u8f7d\u548c\u89e3\u538b<br \/>\nwget http:\/\/www.boa.org\/boa-0.94.13.tar.gz<br \/>\ntar zxvf boa-0.94.13.tar.gz<br \/>\ncd boa-0.94.13\/src<\/p>\n<p># \u4fee\u6539Makefile<br \/>\nCC &#061; arm-linux-gnueabihf-gcc<br \/>\nCPP &#061; arm-linux-gnueabihf-g&#043;&#043;<\/p>\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u9047\u5230\u7684\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<li>flex\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898&#xff1a;\u9700\u8981\u5b89\u88c5\u65e7\u7248\u672c\u7684flex\u5de5\u5177<\/li>\n<li>\u7f3a\u5c11libcrypt\u5e93&#xff1a;\u5728\u4ea4\u53c9\u7f16\u8bd1\u5de5\u5177\u94fe\u4e2d\u5b89\u88c5\u76f8\u5e94\u7684\u5f00\u53d1\u5305<\/li>\n<li>\u5b57\u8282\u5bf9\u9f50\u8b66\u544a&#xff1a;\u4fee\u6539\u6e90\u7801\u4e2d\u7684packed\u5c5e\u6027\u5b9a\u4e49<\/li>\n<h4>3.2 Boa\u914d\u7f6e\u6587\u4ef6\u4f18\u5316<\/h4>\n<p>boa.conf\u662f\u670d\u52a1\u5668\u7684\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6&#xff0c;\u9700\u8981\u9488\u5bf9\u5d4c\u5165\u5f0f\u73af\u5883\u8fdb\u884c\u4f18\u5316&#xff1a;<\/p>\n<p># \u57fa\u672c\u670d\u52a1\u5668\u8bbe\u7f6e<br \/>\nPort 80<br \/>\nUser root<br \/>\nGroup root<br \/>\nServerName embedded-camera<\/p>\n<p># \u91cd\u8981\u76ee\u5f55\u914d\u7f6e<br \/>\nDocumentRoot \/root\/www<br \/>\nScriptAlias \/cgi-bin\/ \/root\/cgi-bin\/<\/p>\n<p># \u6027\u80fd\u8c03\u4f18\u53c2\u6570<br \/>\nKeepAliveMax 100<br \/>\nKeepAliveTimeout 10<br \/>\nMaxKeepAliveRequests 100<\/p>\n<p>\u63d0\u793a&#xff1a;\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u5efa\u8bae\u5c06Web\u6839\u76ee\u5f55\u548cCGI\u76ee\u5f55\u8bbe\u7f6e\u4e3a\u53ea\u8bfb&#xff0c;\u63d0\u9ad8\u7cfb\u7edf\u5b89\u5168\u6027\u3002<\/p>\n<h4>3.3 CGI\u7a0b\u5e8f\u5f00\u53d1<\/h4>\n<p>CGI&#xff08;Common Gateway Interface&#xff09;\u662fWeb\u670d\u52a1\u5668\u4e0e\u5916\u90e8\u7a0b\u5e8f\u4ea4\u4e92\u7684\u6807\u51c6\u63a5\u53e3\u3002\u5728\u5d4c\u5165\u5f0f\u73af\u5883\u4e2d&#xff0c;\u6211\u4eec\u9700\u8981\u7f16\u5199\u9ad8\u6548\u7684CGI\u7a0b\u5e8f\u6765\u5904\u7406Web\u8bf7\u6c42\u3002<\/p>\n<p>\u4e00\u4e2a\u7b80\u5355\u7684LED\u63a7\u5236CGI\u793a\u4f8b&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\n#include &lt;string.h&gt;<\/p>\n<p>int main(void) {<br \/>\n    printf(&#034;Content-type: text\/html\\\\n\\\\n&#034;);<br \/>\n    printf(&#034;&lt;html&gt;&lt;head&gt;&lt;title&gt;LED Control&lt;\/title&gt;&lt;\/head&gt;&#034;);<\/p>\n<p>    \/\/ \u83b7\u53d6\u67e5\u8be2\u5b57\u7b26\u4e32<br \/>\n    char *data &#061; getenv(&#034;QUERY_STRING&#034;);<br \/>\n    if(data !&#061; NULL) {<br \/>\n        if(strstr(data, &#034;led&#061;on&#034;)) {<br \/>\n            \/\/ \u63a7\u5236LED\u6253\u5f00\u7684\u786c\u4ef6\u64cd\u4f5c<br \/>\n            system(&#034;echo 1 &gt; \/sys\/class\/leds\/user-led\/brightness&#034;);<br \/>\n            printf(&#034;&lt;body&gt;&lt;h2&gt;LED turned ON&lt;\/h2&gt;&lt;\/body&gt;&#034;);<br \/>\n        } else if(strstr(data, &#034;led&#061;off&#034;)) {<br \/>\n            \/\/ \u63a7\u5236LED\u5173\u95ed\u7684\u786c\u4ef6\u64cd\u4f5c<br \/>\n            system(&#034;echo 0 &gt; \/sys\/class\/leds\/user-led\/brightness&#034;);<br \/>\n            printf(&#034;&lt;body&gt;&lt;h2&gt;LED turned OFF&lt;\/h2&gt;&lt;\/body&gt;&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n    printf(&#034;&lt;\/html&gt;&#034;);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>CGI\u7f16\u7a0b\u4e2d\u7684\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58\u7ba1\u7406&#xff1a;\u5d4c\u5165\u5f0f\u7cfb\u7edf\u8d44\u6e90\u6709\u9650&#xff0c;\u907f\u514d\u52a8\u6001\u5185\u5b58\u5206\u914d<\/li>\n<li>\u5b89\u5168\u6027&#xff1a;\u5bf9\u6240\u6709\u8f93\u5165\u53c2\u6570\u8fdb\u884c\u9a8c\u8bc1\u548c\u8fc7\u6ee4<\/li>\n<li>\u6027\u80fd&#xff1a;\u51cf\u5c11\u7cfb\u7edf\u8c03\u7528&#xff0c;\u4f18\u5316\u5904\u7406\u903b\u8f91<\/li>\n<\/ul>\n<h3>4. \u89c6\u9891\u6d41\u5a92\u4f53\u670d\u52a1\u5b9e\u73b0<\/h3>\n<p>OV5640\u662f\u4e00\u6b3e500\u4e07\u50cf\u7d20\u7684\u6444\u50cf\u5934\u4f20\u611f\u5668&#xff0c;\u652f\u6301\u591a\u79cd\u8f93\u51fa\u683c\u5f0f\u3002\u5728i.MX6ULL\u5e73\u53f0\u4e0a&#xff0c;\u6211\u4eec\u9700\u8981\u901a\u8fc7MJPG-Streamer\u6765\u5b9e\u73b0\u89c6\u9891\u6d41\u7684\u7f51\u7edc\u4f20\u8f93\u3002<\/p>\n<h4>4.1 OV5640\u9a71\u52a8\u914d\u7f6e<\/h4>\n<p>\u786e\u4fddLinux\u5185\u6838\u4e2d\u5df2\u6b63\u786e\u914d\u7f6eOV5640\u9a71\u52a8&#xff1a;<\/p>\n<p># \u68c0\u67e5\u6444\u50cf\u5934\u8bbe\u5907<br \/>\nls \/dev\/video*<\/p>\n<p># \u6d4b\u8bd5\u6444\u50cf\u5934\u91c7\u96c6<br \/>\napt-get install v4l-utils<br \/>\nv4l2-ctl &#8211;list-formats<\/p>\n<p>\u5e38\u89c1\u7684\u6444\u50cf\u5934\u914d\u7f6e\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<li>\u8bbe\u5907\u672a\u8bc6\u522b&#xff1a;\u68c0\u67e5I2C\u5730\u5740\u914d\u7f6e\u548c\u8bbe\u5907\u6811\u8bbe\u7f6e<\/li>\n<li>\u56fe\u50cf\u8272\u5f69\u5f02\u5e38&#xff1a;\u8c03\u6574YUV\u683c\u5f0f\u914d\u7f6e\u53c2\u6570<\/li>\n<li>\u5e27\u7387\u4e0d\u7a33\u5b9a&#xff1a;\u4f18\u5316DMA\u7f13\u51b2\u533a\u5927\u5c0f\u548c\u6570\u91cf<\/li>\n<h4>4.2 MJPG-Streamer\u79fb\u690d<\/h4>\n<p>MJPG-Streamer\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u89c6\u9891\u6d41\u670d\u52a1\u5668&#xff0c;\u975e\u5e38\u9002\u5408\u5d4c\u5165\u5f0f\u5e73\u53f0&#xff1a;<\/p>\n<p># \u4e0b\u8f7d\u6e90\u7801<br \/>\ngit clone https:\/\/github.com\/jacksonliam\/mjpg-streamer.git<\/p>\n<p># \u4ea4\u53c9\u7f16\u8bd1<br \/>\ncd mjpg-streamer\/mjpg-streamer-experimental<br \/>\nmake CC&#061;arm-linux-gnueabihf-gcc<\/p>\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u9700\u8981\u5173\u6ce8\u7684\u4f9d\u8d56\u9879&#xff1a;<\/p>\n<ul>\n<li>libjpeg&#xff1a;JPEG\u7f16\u89e3\u7801\u5e93<\/li>\n<li>SDL&#xff1a;\u53ef\u9009&#xff0c;\u7528\u4e8e\u672c\u5730\u9884\u89c8<\/li>\n<li>V4L2&#xff1a;\u89c6\u9891\u91c7\u96c6\u63a5\u53e3<\/li>\n<\/ul>\n<h4>4.3 \u6d41\u5a92\u4f53\u670d\u52a1\u914d\u7f6e<\/h4>\n<p>\u521b\u5efa\u542f\u52a8\u811a\u672c\u914d\u7f6eMJPG-Streamer\u53c2\u6570&#xff1a;<\/p>\n<p>#!\/bin\/sh<\/p>\n<p># \u89c6\u9891\u91c7\u96c6\u53c2\u6570<br \/>\nWIDTH&#061;640<br \/>\nHEIGHT&#061;480<br \/>\nFPS&#061;15<br \/>\nBITRATE&#061;500000<\/p>\n<p># \u542f\u52a8\u6d41\u5a92\u4f53\u670d\u52a1<br \/>\n.\/mjpg_streamer -i &#034;input_uvc.so -d \/dev\/video0 -r ${WIDTH}x${HEIGHT} -f ${FPS}&#034; \\\\<br \/>\n                -o &#034;output_http.so -p 8080 -w .\/www&#034;<\/p>\n<p>\u4f18\u5316\u89c6\u9891\u6d41\u6027\u80fd\u7684\u5173\u952e\u53c2\u6570&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u63a8\u8350\u503c\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5206\u8fa8\u7387<\/td>\n<td>640&#215;480<\/td>\n<td>\u5e73\u8861\u753b\u8d28\u548c\u5e26\u5bbd<\/td>\n<\/tr>\n<tr>\n<td>\u5e27\u7387<\/td>\n<td>15fps<\/td>\n<td>\u6d41\u7545\u5ea6\u4e0eCPU\u5360\u7528\u7684\u6298\u4e2d<\/td>\n<\/tr>\n<tr>\n<td>\u6bd4\u7279\u7387<\/td>\n<td>500kbps<\/td>\n<td>\u63a7\u5236\u7f51\u7edc\u5e26\u5bbd\u5360\u7528<\/td>\n<\/tr>\n<tr>\n<td>\u8d28\u91cf<\/td>\n<td>80<\/td>\n<td>JPEG\u538b\u7f29\u8d28\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u5b9e\u9645\u9879\u76ee\u4e2d&#xff0c;\u6211\u4eec\u53d1\u73b0\u901a\u8fc7\u8c03\u6574DMA\u7f13\u51b2\u533a\u6570\u91cf\u53ef\u4ee5\u663e\u8457\u6539\u5584\u89c6\u9891\u6d41\u7684\u7a33\u5b9a\u6027&#xff1a;<\/p>\n<p>\/\/ \u5728V4L2\u91c7\u96c6\u4ee3\u7801\u4e2d\u589e\u52a0\u7f13\u51b2\u533a\u6570\u91cf<br \/>\nstruct v4l2_requestbuffers req &#061; {0};<br \/>\nreq.count &#061; 6;  \/\/ \u4ece\u9ed8\u8ba44\u4e2a\u589e\u52a0\u52306\u4e2a<br \/>\nreq.type &#061; V4L2_BUF_TYPE_VIDEO_CAPTURE;<br \/>\nreq.memory &#061; V4L2_MEMORY_MMAP;<br \/>\nioctl(fd, VIDIOC_REQBUFS, &amp;req);<\/p>\n<h3>5. \u7cfb\u7edf\u96c6\u6210\u4e0e\u6027\u80fd\u4f18\u5316<\/h3>\n<p>\u5c06\u5404\u4e2a\u7ec4\u4ef6\u6574\u5408\u4e3a\u4e00\u4e2a\u5b8c\u6574\u7684\u7cfb\u7edf\u662f\u6574\u4e2a\u9879\u76ee\u4e2d\u6700\u5177\u6311\u6218\u6027\u7684\u90e8\u5206\u3002\u6211\u4eec\u9700\u8981\u8003\u8651\u7cfb\u7edf\u7a33\u5b9a\u6027\u3001\u8d44\u6e90\u7ba1\u7406\u548c\u7528\u6237\u4f53\u9a8c\u7b49\u591a\u4e2a\u65b9\u9762\u3002<\/p>\n<h4>5.1 \u542f\u52a8\u811a\u672c\u4e0e\u670d\u52a1\u7ba1\u7406<\/h4>\n<p>\u521b\u5efa\u7cfb\u7edf\u542f\u52a8\u811a\u672c&#xff0c;\u786e\u4fdd\u5404\u4e2a\u670d\u52a1\u6309\u6b63\u786e\u987a\u5e8f\u542f\u52a8&#xff1a;<\/p>\n<p>#!\/bin\/sh<\/p>\n<p># \u542f\u52a8\u7f51\u7edc\u670d\u52a1<br \/>\n\/etc\/init.d\/networking start<\/p>\n<p># \u6302\u8f7d\u989d\u5916\u6587\u4ef6\u7cfb\u7edf<br \/>\nmount -t tmpfs tmpfs \/tmp<\/p>\n<p># \u542f\u52a8Boa\u670d\u52a1\u5668<br \/>\n\/usr\/sbin\/boa -d<\/p>\n<p># \u542f\u52a8\u89c6\u9891\u6d41\u670d\u52a1<br \/>\n\/root\/mjpg-streamer\/start_stream.sh &amp;<\/p>\n<p># \u542f\u52a8\u76d1\u63a7\u5b88\u62a4\u8fdb\u7a0b<br \/>\n\/root\/bin\/monitor_daemon<\/p>\n<p>\u4f7f\u7528systemd\u670d\u52a1\u7ba1\u7406\u53ef\u4ee5\u63d0\u9ad8\u7cfb\u7edf\u53ef\u9760\u6027&#xff1a;<\/p>\n<p>[Unit]<br \/>\nDescription&#061;Embedded Camera Service<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\nType&#061;forking<br \/>\nExecStart&#061;\/root\/scripts\/start_services.sh<br \/>\nRestart&#061;always<br \/>\nRestartSec&#061;5<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target<\/p>\n<h4>5.2 \u8d44\u6e90\u76d1\u63a7\u4e0e\u7ba1\u7406<\/h4>\n<p>\u5d4c\u5165\u5f0f\u7cfb\u7edf\u8d44\u6e90\u6709\u9650&#xff0c;\u9700\u8981\u5b9e\u65f6\u76d1\u63a7\u7cfb\u7edf\u72b6\u6001&#xff1a;<\/p>\n<p>\/\/ \u5185\u5b58\u4f7f\u7528\u76d1\u63a7<br \/>\nvoid check_memory_usage() {<br \/>\n    struct sysinfo si;<br \/>\n    sysinfo(&amp;si);<\/p>\n<p>    float free_ram &#061; (float)si.freeram \/ si.totalram * 100;<br \/>\n    if(free_ram &lt; 10.0) {<br \/>\n        \/\/ \u89e6\u53d1\u5185\u5b58\u6e05\u7406\u673a\u5236<br \/>\n        cleanup_resources();<br \/>\n    }<br \/>\n}<\/p>\n<p>\u521b\u5efa\u8d44\u6e90\u7ba1\u7406\u7b56\u7565\u8868&#xff1a;<\/p>\n<table>\n<tr>\u8d44\u6e90\u7c7b\u578b\u76d1\u63a7\u9608\u503c\u5e94\u5bf9\u63aa\u65bd<\/tr>\n<tbody>\n<tr>\n<td>\u5185\u5b58\u4f7f\u7528<\/td>\n<td>&gt;90%<\/td>\n<td>\u91cd\u542f\u975e\u5173\u952e\u670d\u52a1<\/td>\n<\/tr>\n<tr>\n<td>CPU\u8d1f\u8f7d<\/td>\n<td>&gt;80%\u6301\u7eed60\u79d2<\/td>\n<td>\u964d\u4f4e\u89c6\u9891\u5e27\u7387<\/td>\n<\/tr>\n<tr>\n<td>\u6e29\u5ea6<\/td>\n<td>&gt;85\u00b0C<\/td>\n<td>\u542f\u7528\u6563\u70ed\u673a\u5236<\/td>\n<\/tr>\n<tr>\n<td>\u5b58\u50a8\u7a7a\u95f4<\/td>\n<td>&lt;10%\u53ef\u7528<\/td>\n<td>\u6e05\u7406\u4e34\u65f6\u6587\u4ef6<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.3 \u7f51\u7edc\u4f18\u5316\u4e0e\u5b89\u5168<\/h4>\n<p>\u9488\u5bf9\u7f51\u7edc\u6027\u80fd\u8fdb\u884c\u4e13\u95e8\u4f18\u5316&#xff1a;<\/p>\n<p># TCP\/IP\u6808\u4f18\u5316<br \/>\necho 1024 &gt; \/proc\/sys\/net\/core\/somaxconn<br \/>\necho 30 &gt; \/proc\/sys\/net\/ipv4\/tcp_fin_timeout<br \/>\necho &#034;4096 87380 4194304&#034; &gt; \/proc\/sys\/net\/ipv4\/tcp_rmem<\/p>\n<p>\u5b89\u5168\u52a0\u56fa\u63aa\u65bd\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u9632\u706b\u5899\u914d\u7f6e&#xff1a;\u53ea\u5f00\u653e\u5fc5\u8981\u7684\u7aef\u53e3&#xff08;80\u30018080&#xff09;<\/li>\n<li>\u7528\u6237\u6743\u9650&#xff1a;\u4ee5\u975eroot\u7528\u6237\u8fd0\u884c\u670d\u52a1<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0&#xff1a;\u53ca\u65f6\u4fee\u8865\u5b89\u5168\u6f0f\u6d1e<\/li>\n<\/ul>\n<h3>6. \u5b9e\u9645\u90e8\u7f72\u4e0e\u6545\u969c\u6392\u9664<\/h3>\n<p>\u5728\u5b9e\u9645\u90e8\u7f72\u8fc7\u7a0b\u4e2d&#xff0c;\u6211\u4eec\u9047\u5230\u4e86\u591a\u79cd\u6311\u6218&#xff0c;\u8fd9\u4e9b\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848\u503c\u5f97\u5206\u4eab\u3002<\/p>\n<h4>6.1 \u786c\u4ef6\u517c\u5bb9\u6027\u95ee\u9898<\/h4>\n<p>i.MX6ULL\u4e0eOV5640\u7684\u786c\u4ef6\u517c\u5bb9\u6027\u9700\u8981\u7279\u522b\u6ce8\u610f&#xff1a;<\/p>\n<li>\u65f6\u949f\u4fe1\u53f7\u7a33\u5b9a\u6027&#xff1a;\u6dfb\u52a0\u9002\u5f53\u7684\u6ee4\u6ce2\u7535\u8def<\/li>\n<li>\u7535\u6e90\u566a\u58f0&#xff1a;\u4f7f\u7528LDO\u4ee3\u66ff\u5f00\u5173\u7535\u6e90\u4e3a\u6444\u50cf\u5934\u4f9b\u7535<\/li>\n<li>\u4fe1\u53f7\u5b8c\u6574\u6027&#xff1a;\u63a7\u5236CSI\u603b\u7ebf\u957f\u5ea6&#xff0c;\u6dfb\u52a0\u5339\u914d\u7535\u963b<\/li>\n<h4>6.2 \u8f6f\u4ef6\u914d\u7f6e\u9677\u9631<\/h4>\n<p>\u5e38\u89c1\u7684\u914d\u7f6e\u9519\u8bef\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<p># \u68c0\u67e5Boa\u670d\u52a1\u5668\u9519\u8bef\u65e5\u5fd7<br \/>\ntail -f \/var\/log\/boa\/error_log<\/p>\n<p># \u5e38\u89c1\u7684\u9519\u8bef\u4fe1\u606f\u53ca\u89e3\u51b3\u65b9\u6848<br \/>\n# &#034;boa.c:226.icky Linux kernel bug!&#034; \u2192 \u8c03\u6574\u5185\u6838\u914d\u7f6e&#xff0c;\u7981\u7528\u67d0\u4e9b\u7f51\u7edc\u7279\u6027<br \/>\n# &#034;getaddrinfo: No address associated with hostname&#034; \u2192 \u68c0\u67e5\/etc\/hosts\u914d\u7f6e<\/p>\n<p>\u7f51\u7edc\u8fde\u63a5\u95ee\u9898\u8bca\u65ad\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u7269\u7406\u5c42\u68c0\u67e5&#xff1a;\u7f51\u7ebf\u8fde\u63a5\u3001\u6307\u793a\u706f\u72b6\u6001<\/li>\n<li>\u7f51\u7edc\u5c42\u8bca\u65ad&#xff1a;ifconfig\u67e5\u770bIP\u5206\u914d&#xff0c;ping\u6d4b\u8bd5\u8fde\u901a\u6027<\/li>\n<li>\u5e94\u7528\u5c42\u9a8c\u8bc1&#xff1a;netstat\u67e5\u770b\u7aef\u53e3\u76d1\u542c&#xff0c;telnet\u6d4b\u8bd5\u670d\u52a1\u53ef\u7528\u6027<\/li>\n<h4>6.3 \u6027\u80fd\u74f6\u9888\u5206\u6790<\/h4>\n<p>\u4f7f\u7528\u7cfb\u7edf\u76d1\u63a7\u5de5\u5177\u8bc6\u522b\u6027\u80fd\u74f6\u9888&#xff1a;<\/p>\n<p># \u5b9e\u65f6\u76d1\u63a7\u7cfb\u7edf\u8d44\u6e90<br \/>\ntop -d 1<\/p>\n<p># I\/O\u6027\u80fd\u5206\u6790<br \/>\niostat -x 1<\/p>\n<p># \u7f51\u7edc\u6d41\u91cf\u76d1\u63a7<br \/>\niftop -i eth0<\/p>\n<p>\u5e38\u89c1\u7684\u6027\u80fd\u4f18\u5316\u63aa\u65bd&#xff1a;<\/p>\n<ul>\n<li>\u5185\u5b58\u4f7f\u7528\u4f18\u5316&#xff1a;\u4f7f\u7528\u5185\u5b58\u6c60\u51cf\u5c11\u788e\u7247<\/li>\n<li>CPU\u8d1f\u8f7d\u5747\u8861&#xff1a;\u8bbe\u7f6e\u8fdb\u7a0b\u4eb2\u548c\u6027<\/li>\n<li>I\/O\u8c03\u5ea6\u7b56\u7565&#xff1a;\u9009\u62e9\u9002\u5408\u7684\u78c1\u76d8\u8c03\u5ea6\u7b97\u6cd5<\/li>\n<\/ul>\n<p>\u5728\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u4e2d&#xff0c;\u6211\u4eec\u7279\u522b\u6ce8\u610f\u5230CGI\u7a0b\u5e8f\u7684\u6267\u884c\u6548\u7387\u5bf9\u6574\u4f53\u6027\u80fd\u5f71\u54cd\u5f88\u5927\u3002\u901a\u8fc7\u5c06\u9891\u7e41\u4f7f\u7528\u7684\u6570\u636e\u7f13\u5b58\u5728\u5171\u4eab\u5185\u5b58\u4e2d&#xff0c;\u51cf\u5c11\u4e86\u6587\u4ef6I\/O\u64cd\u4f5c&#xff0c;\u4f7f\u7f51\u9875\u54cd\u5e94\u65f6\u95f4\u51cf\u5c11\u4e8640%\u3002<\/p>\n<h3>7. \u529f\u80fd\u6269\u5c55\u4e0e\u8fdb\u9636\u5e94\u7528<\/h3>\n<p>\u57fa\u7840\u76d1\u63a7\u7cfb\u7edf\u642d\u5efa\u5b8c\u6210\u540e&#xff0c;\u53ef\u4ee5\u8003\u8651\u8fdb\u4e00\u6b65\u7684\u529f\u80fd\u6269\u5c55\u3002<\/p>\n<h4>7.1 \u79fb\u52a8\u7aef\u9002\u914d<\/h4>\n<p>\u901a\u8fc7\u54cd\u5e94\u5f0f\u7f51\u9875\u8bbe\u8ba1\u9002\u914d\u79fb\u52a8\u8bbe\u5907&#xff1a;<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n    &lt;meta name&#061;&#034;viewport&#034; content&#061;&#034;width&#061;device-width, initial-scale&#061;1.0&#034;&gt;<br \/>\n    &lt;style&gt;<br \/>\n        &#064;media screen and (max-width: 600px) {<br \/>\n            .video-container {<br \/>\n                width: 100%;<br \/>\n                height: auto;<br \/>\n            }<br \/>\n        }<br \/>\n    &lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n    &lt;div class&#061;&#034;video-container&#034;&gt;<br \/>\n        &lt;img src&#061;&#034;http:\/\/[IP]:8080\/?action&#061;stream&#034;&gt;<br \/>\n    &lt;\/div&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<h4>7.2 \u667a\u80fd\u5206\u6790\u529f\u80fd<\/h4>\n<p>\u96c6\u6210\u7b80\u5355\u7684\u8fd0\u52a8\u68c0\u6d4b\u7b97\u6cd5&#xff1a;<\/p>\n<p>int motion_detect(uint8_t *frame1, uint8_t *frame2, int width, int height) {<br \/>\n    int diff_count &#061; 0;<br \/>\n    int threshold &#061; 30;<\/p>\n<p>    for (int i &#061; 0; i &lt; width * height; i&#043;&#043;) {<br \/>\n        if (abs(frame1[i] &#8211; frame2[i]) &gt; threshold) {<br \/>\n            diff_count&#043;&#043;;<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/\/ \u5982\u679c\u53d8\u5316\u7684\u50cf\u7d20\u8d85\u8fc7\u603b\u6570\u76845%&#xff0c;\u8ba4\u4e3a\u6709\u8fd0\u52a8\u53d1\u751f<br \/>\n    if (diff_count &gt; (width * height * 0.05)) {<br \/>\n        return 1;<br \/>\n    }<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>7.3 \u8fdc\u7a0b\u8bbf\u95ee\u65b9\u6848<\/h4>\n<p>\u5b9e\u73b0\u5b89\u5168\u7684\u8fdc\u7a0b\u8bbf\u95ee\u529f\u80fd&#xff1a;<\/p>\n<p># \u4f7f\u7528SSH\u96a7\u9053\u8fdb\u884c\u5b89\u5168\u8bbf\u95ee<br \/>\nssh -N -L 8080:localhost:8080 user&#064;embedded-device-ip<\/p>\n<p># \u81ea\u52a8\u5316\u8fde\u63a5\u811a\u672c<br \/>\n#!\/bin\/bash<br \/>\nwhile true; do<br \/>\n    ssh -o ServerAliveInterval&#061;60 -R 0.0.0.0:8080:localhost:8080 user&#064;remote-server<br \/>\n    sleep 10<br \/>\ndone<\/p>\n<p>\u6269\u5c55\u529f\u80fd\u5bf9\u6bd4\u8868&#xff1a;<\/p>\n<table>\n<tr>\u529f\u80fd\u6a21\u5757\u8d44\u6e90\u9700\u6c42\u5b9e\u73b0\u96be\u5ea6\u5b9e\u7528\u4ef7\u503c<\/tr>\n<tbody>\n<tr>\n<td>\u79fb\u52a8\u7aef\u9002\u914d<\/td>\n<td>\u4f4e<\/td>\n<td>\u4f4e<\/td>\n<td>\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>\u8fd0\u52a8\u68c0\u6d4b<\/td>\n<td>\u4e2d<\/td>\n<td>\u4e2d<\/td>\n<td>\u9ad8<\/td>\n<\/tr>\n<tr>\n<td>\u4eba\u8138\u8bc6\u522b<\/td>\n<td>\u9ad8<\/td>\n<td>\u9ad8<\/td>\n<td>\u4e2d<\/td>\n<\/tr>\n<tr>\n<td>\u4e91\u5b58\u50a8<\/td>\n<td>\u4e2d<\/td>\n<td>\u4e2d<\/td>\n<td>\u9ad8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u6211\u4eec\u53d1\u73b0\u901a\u8fc7\u5408\u7406\u7684\u529f\u80fd\u9009\u62e9\u548c\u7ec4\u5408&#xff0c;\u53ef\u4ee5\u5728\u6709\u9650\u7684\u786c\u4ef6\u8d44\u6e90\u4e0a\u5b9e\u73b0\u4ee4\u4eba\u6ee1\u610f\u7684\u7528\u6237\u4f53\u9a8c\u3002\u7279\u522b\u662f\u5728\u8d44\u6e90\u5206\u914d\u65b9\u9762&#xff0c;\u9700\u8981\u6839\u636e\u5b9e\u9645\u5e94\u7528\u573a\u666f\u505a\u51fa\u6743\u8861\u3002<\/p>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u9879\u76ee\u7684\u5b9e\u8df5&#xff0c;\u6211\u4eec\u4e0d\u4ec5\u6210\u529f\u6784\u5efa\u4e86\u4e00\u4e2a\u529f\u80fd\u5b8c\u6574\u7684\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\u7cfb\u7edf&#xff0c;\u66f4\u91cd\u8981\u7684\u662f\u79ef\u7d2f\u4e86\u5927\u91cf\u5728\u8d44\u6e90\u53d7\u9650\u73af\u5883\u4e0b\u8fdb\u884c\u7cfb\u7edf\u4f18\u5316\u7684\u7ecf\u9a8c\u3002\u4ece\u786c\u4ef6\u9009\u578b\u5230\u8f6f\u4ef6\u8c03\u4f18&#xff0c;\u6bcf\u4e00\u4e2a\u73af\u8282\u90fd\u9700\u8981\u7cbe\u5fc3\u8bbe\u8ba1\u548c\u53cd\u590d\u6d4b\u8bd5<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14112,12164,14111,7881],"topic":[],"class_list":["post-123202","post","type-post","status-publish","format-standard","hentry","category-server","tag-boa","tag-imx6ull","tag-14111","tag-7881"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/123202.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/123202.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-06T13:08:54+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123202.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/123202.html\",\"name\":\"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-06T13:08:54+00:00\",\"dateModified\":\"2026-11-06T13:08:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/123202.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/123202.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123202.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/123202.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/123202.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-06T13:08:54+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/123202.html","url":"https:\/\/www.wsisp.com\/helps\/123202.html","name":"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-06T13:08:54+00:00","dateModified":"2026-11-06T13:08:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/123202.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/123202.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/123202.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u96f6\u6784\u5efa\u5d4c\u5165\u5f0fWeb\u76d1\u63a7\uff1aIMX6ULL\u4e0eBoa\u670d\u52a1\u5668\u7684\u6df1\u5ea6\u5bf9\u8bdd"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/123202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=123202"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/123202\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=123202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=123202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=123202"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=123202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}