本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
~~NOCACHE~~ ~~NOTOC~~ <html><style> .dokuwiki h1,.sml-c-wrap h1{font-family:"Microsoft YaHei","PingFang SC","Hiragino Sans GB","Helvetica Neue",Arial,sans-serif!important;font-size:22px!important;font-weight:600!important;line-height:1.35!important;letter-spacing:.2px!important;color:#1f2a37!important;font-variant-numeric:lining-nums tabular-nums;font-feature-settings:"lnum" 1,"tnum" 1;border-bottom:1px solid #a2a9b1;padding:0 0 .2em 0!important;margin:0 0 .2em 0!important;} .dokuwiki h2{font-family:Georgia,"Times New Roman","Songti SC",SimSun,serif;font-weight:400;font-size:1.5em;line-height:1.3;border-bottom:1px solid #a2a9b1;padding-bottom:.15em;margin:1.6em 0 .55em;} .dokuwiki h3{font-size:1.02em;font-weight:700;margin:1.3em 0 .35em;} .dokuwiki h4{font-size:.98em;font-weight:700;margin:1.1em 0 .35em;} .dokuwiki .level2{margin-top:0;} #smltoc{border:1px solid #a2a9b1;background:#f9f9f9;padding:11px 17px 13px;display:table;max-width:100%;font-size:14px;line-height:1.6;margin:0 0 1.6em;} #smltoc .hd{text-align:center;font-size:14px;font-weight:700;margin:0 0 9px;padding-bottom:8px;border-bottom:1px solid #d5dce4;color:#1f2a37;letter-spacing:1px;} #smltoc .hd a{font-weight:400;color:#0645ad;cursor:pointer;text-decoration:none;} #smltoc ul.toclist{list-style:none;margin:0;padding:0;} #smltoc ul.toclist li{margin:0;padding:0;list-style:none;background:none;font-size:14px;} #smltoc ul.toclist li.l2{padding-left:1.5em;} #smltoc ul.toclist li.l3{padding-left:2.9em;} #smltoc ul.toclist a{color:#0645ad;text-decoration:none;} #smltoc ul.toclist a:hover{text-decoration:underline;} .dokuwiki pre.code{border:1px solid #c8ccd1;background:#f8f9fa;padding:8px 12px;line-height:1.6;font-size:.88em;border-radius:0;} .dokuwiki pre.code code{font-size:1em;} .dokuwiki code{background:#f8f9fa;border:1px solid #eaecf0;padding:0 2px;} /* 附件下载链接:加重显示,与正文区分 */ #bodyContent a.mediafile.mf_zip{font-weight:600;color:#0b5394!important;text-decoration:none;border-bottom:1px solid #c9dcef;} #bodyContent a.mediafile.mf_zip:hover{color:#0645ad!important;border-bottom-color:#0645ad;background:#f2f7fc;} /* 网盘提取码徽标 */ .sml-code{display:inline-block;background:#eef4fb;border:1px solid #cfe0f2;color:#0b5394;font-weight:700;font-size:.92em;letter-spacing:.4px;padding:1px 8px;border-radius:3px;line-height:1.55;} /* 网盘等外部下载链接:与附件下载链接同款 */ #bodyContent a.urlextern{font-weight:600;color:#0b5394!important;text-decoration:none!important;border-bottom:1px solid #c9dcef;background:none!important;padding-right:0!important;} #bodyContent a.urlextern:hover{color:#0645ad!important;border-bottom-color:#0645ad;background:#f2f7fc!important;} .dokuwiki pre.code{border:1px solid #c8ccd1 !important;background:#f8f9fa !important;} .dokuwiki .media img{border:1px solid #c8ccd1;background:#fff;max-width:100%;height:auto;} .dokuwiki table.inline th{background:#eaecf0;font-weight:700;} .catlinks{display:none !important;} #bodyContent{padding-bottom:68vh;} #p-logo a{background-image:url(/dokuwiki/lib/exe/fetch.php?media=wiki:logo_sml.png)!important;background-size:132px auto!important;background-position:center center!important;background-repeat:no-repeat!important;} /* GPIO 端子脚位方向:醒目提示 */ .sml-gpio{margin:14px 0 18px;padding:11px 15px 12px;border:1px solid #e3b45a;border-left:5px solid #d98b0b;background:#fff9ec;border-radius:3px;line-height:1.65;color:#4a3a1c;} .sml-gpio .gt{font-weight:700;color:#9a5b00;font-size:15px;margin-bottom:5px;} .sml-gpio .gline{display:flex;flex-wrap:wrap;gap:10px;margin:9px 0 8px;} .sml-gpio .gcard{flex:1 1 300px;background:#fff;border:1px solid #ead9b4;border-radius:3px;padding:8px 11px;} .sml-gpio .gcard b{display:block;letter-spacing:.3px;} .sml-gpio .gcard span{display:block;margin-top:3px;font-weight:700;} .sml-gpio .gpo{border-left:4px solid #c0392b;} .sml-gpio .gpo span{color:#c0392b;} .sml-gpio .gpi{border-left:4px solid #1e7a4c;} .sml-gpio .gpi span{color:#1e7a4c;} .sml-gpio .gf{font-size:12.6px;color:#775c27;margin:0;} /* ===== 产品图库:目录右侧展示区 ===== */ .sml-top{display:flex;gap:18px;align-items:flex-start;margin:0 0 1.6em;} .sml-left{flex:0 0 auto;min-width:0;max-width:46%;} /* 目录每项单行显示:左栏随目录内容自适应,既不折行,也不会压住右侧图库 */ #smltoc ul.toclist li{white-space:nowrap;} #smltoc{overflow-x:auto;} .sml-left #smltoc{margin:0;width:auto;max-width:100%;box-sizing:border-box;} .sml-gallery{position:sticky;top:14px;flex:1 1 auto;min-width:0;border:1px solid #d7e0ea;border-radius:6px;background:linear-gradient(155deg,#fcfdff 0%,#f0f4f9 100%);box-shadow:0 8px 26px rgba(31,42,55,.07);overflow:hidden;font-family:"Microsoft YaHei","PingFang SC","Hiragino Sans GB","Helvetica Neue",Arial,sans-serif;font-variant-numeric:lining-nums tabular-nums;font-feature-settings:"lnum" 1,"tnum" 1;} .sml-g-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;padding:9px 16px 8px;border-bottom:1px solid #e2e9f1;} .sml-g-kicker{font-size:9.5px;letter-spacing:1.8px;color:#0b5394;font-weight:700;line-height:1.4;} .sml-g-title{font-size:15px;font-weight:600;color:#1f2a37;line-height:1.4;margin-top:2px;letter-spacing:.2px;} .sml-g-note{font-size:10.5px;color:#7b8794;white-space:nowrap;padding-bottom:2px;} .sml-g-body{display:flex;gap:12px;padding:10px 15px 10px;align-items:stretch;} .sml-g-stage{position:relative;flex:1 1 auto;min-width:0;height:292px;background:#fff;border:1px solid #e6ebf1;border-radius:4px;overflow:hidden;} .sml-g-stage img.sml-g-main{display:block;width:100%!important;height:100%!important;max-width:none!important;object-fit:contain;mix-blend-mode:multiply;transition:opacity .16s ease;} .sml-g-badge{position:absolute;left:0;top:11px;z-index:2;background:#0b5394;color:#fff;font-size:9.5px;font-weight:600;letter-spacing:1.2px;padding:4px 10px 4px 12px;border-radius:0 2px 2px 0;box-shadow:0 2px 6px rgba(11,83,148,.2);} .sml-g-zoom{position:absolute;right:10px;top:10px;z-index:2;font-size:10px;line-height:1.4;color:#0b5394!important;text-decoration:none!important;border:1px solid #c9dcef;background:rgba(255,255,255,.92)!important;padding:3px 8px;border-radius:3px;} .sml-g-zoom:hover{background:#0b5394!important;color:#fff!important;border-color:#0b5394;} .sml-g-cap{position:absolute;left:12px;bottom:9px;z-index:2;font-size:11px;color:#4a5765;letter-spacing:.2px;background:rgba(255,255,255,.88);padding:3px 8px;border-radius:2px;} .sml-g-count{position:absolute;right:12px;bottom:10px;z-index:2;font-size:10px;color:#8a97a5;letter-spacing:1px;} .sml-g-side{flex:0 0 150px;min-width:0;display:flex;flex-direction:column;gap:5px;} .sml-g-side-hd{font-size:9.5px;letter-spacing:1.2px;color:#7b8794;font-weight:700;line-height:1.5;padding:0 1px 1px;} button.sml-g-thumb{flex:1 1 0;min-height:0;display:flex;align-items:center;gap:8px;box-sizing:border-box;margin:0;padding:4px 6px;background:#fff;border:1px solid #dbe3ec;border-radius:3px;cursor:pointer;text-align:left;font-family:inherit;line-height:1.35;transition:border-color .15s,box-shadow .15s,transform .15s;} button.sml-g-thumb:hover{border-color:#8fb2d6;transform:translateX(1px);} button.sml-g-thumb.on{border-color:#0b5394;box-shadow:inset 0 0 0 1px #0b5394;background:#f7fbff;} .sml-g-tn{display:block;flex:0 0 58px;width:58px;height:42px;background:#fbfcfe;border:1px solid #edf1f5;border-radius:2px;overflow:hidden;} .sml-g-tn img{display:block;width:100%!important;height:100%!important;max-width:none!important;object-fit:contain;mix-blend-mode:multiply;} .sml-g-tx{font-size:11px;color:#4a5765;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .sml-g-tx b{display:block;font-size:9px;color:#98a5b3;letter-spacing:1px;font-weight:600;margin-bottom:1px;} button.sml-g-thumb.on .sml-g-tx{color:#0b5394;font-weight:600;} button.sml-g-thumb.on .sml-g-tx b{color:#0b5394;} .sml-g-specs{display:flex;flex-wrap:wrap;border-top:1px solid #e2e9f1;background:rgba(255,255,255,.62);} .sml-g-spec{flex:1 1 130px;min-width:0;padding:7px 12px 8px;border-right:1px solid #e2e9f1;box-sizing:border-box;} .sml-g-spec:last-child{border-right:0;} .sml-g-spec b{display:block;font-size:11.5px;color:#0b5394;font-weight:700;line-height:1.5;letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .sml-g-spec em{display:block;font-style:normal;font-size:10px;color:#6b7785;line-height:1.5;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .sml-g-apps{display:flex;align-items:center;gap:8px;padding:6px 14px 8px;border-top:1px solid #e2e9f1;font-size:10.5px;color:#5a6674;flex-wrap:wrap;} .sml-g-apps .t{font-weight:700;color:#1f2a37;letter-spacing:.5px;margin-right:2px;} .sml-g-apps .chip{border:1px solid #d7e0ea;background:#fff;border-radius:2px;padding:2px 8px;color:#4a5765;} @media (max-width:1200px){.sml-top{flex-direction:column;}.sml-left{flex:1 1 auto;width:100%;max-width:none;}.sml-gallery{order:-1;position:static;width:100%;box-sizing:border-box;}.sml-g-note{display:none;}} @media (max-width:900px){.sml-g-body{flex-direction:column;}.sml-g-stage{height:220px;}.sml-g-side{flex:1 1 auto;flex-direction:row;flex-wrap:nowrap;}button.sml-g-thumb{flex:1 1 0;min-width:0;flex-direction:column;text-align:center;gap:3px;padding:5px 3px 6px;}.sml-g-tn{flex:none;width:100%;height:36px;}.sml-g-tx{font-size:10px;text-align:center;}.sml-g-tx b{display:none;}.sml-g-side-hd{display:none;}.sml-g-spec{flex:1 1 50%;}} @media (max-width:520px){.sml-g-stage{height:180px;}.sml-g-cap{font-size:10px;}.sml-g-zoom{font-size:10px;}} /* ===== 正文:企业级文档排版规范(单主色 / 统一字体 / 固定层级) ===== */ #bodyContent{font-family:"Microsoft YaHei","PingFang SC","Hiragino Sans GB","Helvetica Neue",Arial,sans-serif;font-size:14px;line-height:1.75;color:#1f2a37;} #bodyContent p{margin:0 0 1em;max-width:1040px;} #bodyContent a{color:#0b5394;} #bodyContent a:hover{color:#083f70;} /* 章标题:以字号/字重/留白建立力度,主色仅作竖线与短线,不用色块 */ #bodyContent h2{position:relative;font-family:inherit!important;font-size:25px!important;font-weight:700!important;line-height:1.35!important;color:#152234!important;letter-spacing:.3px;background:none!important;border:0!important;border-bottom:1px solid #dfe5ec!important;border-radius:0;padding:0 0 15px 19px!important;margin:3em 0 1.55em!important;} #bodyContent h2::before{content:"";position:absolute;left:0;top:4px;bottom:19px;width:4px;background:#0b5394;border-radius:1px;} #bodyContent h2::after{content:"";position:absolute;left:0;bottom:-1px;width:60px;height:2px;background:#0b5394;} #bodyContent h3{font-family:inherit!important;font-size:16.5px!important;font-weight:700!important;line-height:1.5!important;color:#152234!important;border:0!important;border-left:3px solid #7fa3c6!important;border-radius:0;padding:2px 0 2px 12px!important;margin:2.1em 0 .85em!important;} #bodyContent h4{font-family:inherit!important;font-size:14.5px!important;font-weight:700!important;line-height:1.5!important;color:#33475d!important;border:0!important;padding:0!important;margin:1.7em 0 .55em!important;} /* 表格:浅灰表头 + 一条主色底线 + 纯横线网格(去掉深蓝实心表头与竖线) */ #bodyContent table.inline{border-collapse:collapse;width:auto;max-width:100%;margin:1.25em 0 1.9em;font-size:13.5px;line-height:1.7;border:1px solid #e1e7ee;} #bodyContent table.inline th{background:#f2f5f9!important;color:#1f2a37!important;font-weight:700!important;font-size:12.5px;letter-spacing:.6px;padding:10px 16px!important;border:0!important;border-bottom:2px solid #0b5394!important;text-align:left;white-space:nowrap;} #bodyContent table.inline td{padding:9px 16px!important;border:0!important;border-bottom:1px solid #e9edf2!important;color:#243447;vertical-align:middle;} #bodyContent table.inline tr:last-child td{border-bottom:0!important;} #bodyContent table.inline tr:nth-child(even) td{background:#fafbfd;} #bodyContent table.inline tr:hover td{background:#f1f6fb;} #bodyContent table.inline td:first-child{font-weight:600;color:#152234;} /* 代码块:整体压低对比,只留细线与灰色语言标签 */ #bodyContent pre.code,#bodyContent pre.file{position:relative;background:#f9fafc!important;border:1px solid #e2e8ef!important;border-left:2px solid #a9bfd5!important;border-radius:3px;padding:28px 14px 12px!important;margin:.9em 0 1.3em;font:12.5px/1.65 "Cascadia Mono",Consolas,"SFMono-Regular",Menlo,monospace!important;color:#243447;overflow-x:auto;white-space:pre;} #bodyContent pre.code::before,#bodyContent pre.file::before{content:"CODE";position:absolute;left:0;right:0;top:0;height:22px;box-sizing:border-box;background:transparent;border-bottom:1px solid #e9edf2;padding:0 14px;font:600 10px/21px "Microsoft YaHei",Arial,sans-serif!important;letter-spacing:1.2px;color:#8794a4;} #bodyContent pre.code.bash::before{content:"SHELL / BASH";} #bodyContent pre.code.java::before{content:"JAVA";} #bodyContent pre.code code,#bodyContent pre.file code{background:none!important;border:0!important;padding:0!important;color:inherit!important;font-size:1em!important;} /* 行内代码 */ #bodyContent code{background:#eef2f7;border:1px solid #dfe6ee;border-radius:3px;padding:1px 5px;color:#0b5394;font-family:Consolas,Monaco,monospace;font-size:.9em;} /* 有序 / 无序列表:主色数字块与方点 */ #bodyContent ol{counter-reset:smlstep;list-style:none!important;padding-left:0!important;margin:.9em 0 1.3em;} #bodyContent ol li{counter-increment:smlstep;position:relative;padding-left:32px;margin:.45em 0;line-height:1.7;} #bodyContent ol li::before{content:counter(smlstep);position:absolute;left:0;top:2px;width:21px;height:21px;box-sizing:border-box;background:#eef4fb;border:1px solid #cfe0f2;border-radius:3px;color:#0b5394;font:600 11px/19px "Microsoft YaHei",Arial,sans-serif;text-align:center;} #bodyContent ul:not(.toclist){list-style:none!important;padding-left:0!important;margin:.9em 0 1.3em;} #bodyContent ul:not(.toclist) li{position:relative;padding-left:19px;margin:.4em 0;line-height:1.7;} #bodyContent ul:not(.toclist) li::before{content:"";position:absolute;left:3px;top:.68em;width:6px;height:6px;background:#0b5394;border-radius:1px;} /* 正文图片 */ #bodyContent .media img{border:1px solid #dfe6ee;border-radius:4px;background:#fff;padding:4px;box-shadow:0 2px 12px rgba(31,42,55,.07);max-width:100%;height:auto;box-sizing:border-box;} /* 附件下载:统一按钮 */ #bodyContent a.mediafile.mf_zip{display:inline-block!important;background:#eef4fb!important;border:1px solid #cfe0f2!important;border-left:3px solid #0b5394!important;border-radius:3px;padding:5px 12px!important;margin:.3em 0;line-height:1.5;font-weight:600!important;color:#0b5394!important;text-decoration:none!important;} #bodyContent a.mediafile.mf_zip::before{content:"\2193";margin-right:8px;font-weight:700;} #bodyContent a.mediafile.mf_zip:hover{background:#0b5394!important;color:#fff!important;border-color:#0b5394!important;} /* 提示 / 注意:统一的 NOTE 块,弱化为中性灰底,避免蓝色块重复堆叠 */ #bodyContent p.sml-note{background:#f8fafc;border:1px solid #e4eaf1;border-left:3px solid #a9bfd5;border-radius:3px;padding:8px 14px!important;margin:.9em 0 1.3em!important;color:#3b4a5c;font-size:13px;line-height:1.7;} /* ===== 产品规格数据:高规格输出(仅第 1 / 2 章,由 enhanceSpec 打标) ===== */ #bodyContent .sml-spec{max-width:1040px;box-sizing:border-box;margin:1.35em 0 2em;} #bodyContent .sml-spec table.inline{width:100%;border:0!important;font-size:13.5px;line-height:1.65;} #bodyContent .sml-spec.sml-wide table.inline{min-width:760px;} #bodyContent .sml-spec table.inline th{background:#fff!important;color:#5d6c7e!important;font-size:11px!important;letter-spacing:1.2px;font-weight:700!important;padding:9px 18px!important;border:0!important;border-bottom:1px solid #cfd9e4!important;border-top:1px solid #e1e7ee!important;text-align:left;} #bodyContent .sml-spec table.inline td{padding:9px 18px!important;border:0!important;border-bottom:1px solid #edf1f5!important;color:#243447;font-size:13.5px;font-variant-numeric:lining-nums tabular-nums;} #bodyContent .sml-spec table.inline th:first-child,#bodyContent .sml-spec table.inline td:first-child{width:22%;background:#f7f9fc!important;color:#152234!important;font-weight:700;} #bodyContent .sml-spec table.inline tr:nth-child(even) td{background:#fff!important;} #bodyContent .sml-spec table.inline tr:nth-child(even) td:first-child{background:#f7f9fc!important;} #bodyContent .sml-spec table.inline tr:hover td{background:#f4f8fd!important;} #bodyContent .sml-spec table.inline tr:hover td:first-child{background:#eef4fb!important;} #bodyContent .sml-spec table.inline tr:last-child td{border-bottom:1px solid #e1e7ee!important;} /* 主规格表:带表头元信息条的规格卡 */ #bodyContent .sml-spec.sml-featured{background:#fff;border:1px solid #e1e7ee;border-top:0;border-radius:0 0 4px 4px;padding:0 0 4px;box-shadow:0 2px 10px rgba(31,42,55,.035);} #bodyContent .sml-spec.sml-featured .sml-spec-hd{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 18px;border-top:2px solid #0b5394;background:#fbfcfe;border-bottom:1px solid #e6ebf1;} #bodyContent .sml-spec-kick{font:700 10px/1.4 "Microsoft YaHei",Arial,sans-serif;letter-spacing:1.8px;color:#0b5394;} #bodyContent .sml-spec-meta{font:600 10px/1.4 "Microsoft YaHei",Arial,sans-serif;letter-spacing:1px;color:#8794a4;white-space:nowrap;} #bodyContent .sml-spec.sml-featured table.inline th{border-top:0!important;} /* 2.1 整机外观:双列图版 */ #bodyContent .sml-spec.sml-figgrid table.inline{width:100%;table-layout:fixed;border:0!important;} #bodyContent .sml-spec.sml-figgrid table.inline tr th,#bodyContent .sml-spec.sml-figgrid table.inline tr th:first-child{width:50%;background:#fff!important;border:0!important;border-bottom:1px solid #e1e7ee!important;text-align:center!important;font-size:11px;letter-spacing:1px;color:#5d6c7e;font-weight:700;padding:9px 12px!important;} #bodyContent .sml-spec.sml-figgrid table.inline tr td,#bodyContent .sml-spec.sml-figgrid table.inline tr td:first-child{width:50%;background:#fff!important;border:0!important;border-bottom:1px solid #eef1f5!important;padding:13px 14px 14px!important;text-align:center;color:#6b7a8c;font-size:12px;line-height:1.6;font-weight:400;} #bodyContent .sml-spec.sml-figgrid td a.media{display:block;width:100%;text-align:center;} #bodyContent .sml-spec.sml-figgrid img.media{display:block;width:84%!important;max-width:84%!important;height:auto!important;margin:0 auto 8px;border:1px solid #e6ebf1!important;border-radius:4px;padding:0!important;box-shadow:0 2px 10px rgba(31,42,55,.055);background:#fff;mix-blend-mode:multiply;} #bodyContent .sml-spec.sml-figgrid tr:last-child td{border-bottom:0!important;} /* 2.2 接口示意 / 机械尺寸:独立图版 */ #bodyContent p.sml-figure{max-width:960px;box-sizing:border-box;text-align:center;background:#fff;border:1px solid #e6ebf1;border-radius:4px;padding:12px 16px;margin:1.2em 0 1.6em!important;box-shadow:0 2px 10px rgba(31,42,55,.035);} #bodyContent p.sml-figure img.media{width:auto;max-width:520px;height:auto;border:0!important;padding:0!important;box-shadow:none!important;background:#fff;} /* 大图版(?760):机械尺寸等技术图需要放大到能读清尺寸数字,窄屏仍不溢出 */ #bodyContent p.sml-figure img.media[width="760"]{max-width:min(760px,100%);} /* 2.2 接口概览:并入 2.1 同款双列图版,接口图为可点击放大的技术图 */ #bodyContent .sml-spec.sml-figgrid td a.media{cursor:zoom-in;} #bodyContent .sml-spec.sml-figgrid td a.media img.media{mix-blend-mode:normal;} /* 次级产品数据:整机规格 / 型号与配置两张主表(.sml-keep)保持原状,其余统一收一档 */ #bodyContent .sml-spec:not(.sml-keep){max-width:960px;margin:1.2em 0 1.7em;} #bodyContent .sml-spec:not(.sml-keep) table.inline{font-size:13px;line-height:1.55;} #bodyContent .sml-spec:not(.sml-keep) table.inline th{font-size:10.5px!important;padding:8px 16px!important;} #bodyContent .sml-spec:not(.sml-keep) table.inline td{padding:7px 16px!important;font-size:13px;} #bodyContent .sml-spec:not(.sml-keep) table.inline th:first-child,#bodyContent .sml-spec:not(.sml-keep) table.inline td:first-child{width:20%;} #bodyContent .sml-spec:not(.sml-keep).sml-featured .sml-spec-hd{padding:8px 16px;} #bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr th,#bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr th:first-child{padding:8px 10px!important;} #bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr td,#bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr td:first-child{padding:10px 12px 11px!important;} #bodyContent .sml-spec:not(.sml-keep).sml-figgrid img.media{width:70%!important;max-width:70%!important;} /* 宽表格独立横向滚动,避免窄屏整页横向溢出 */ .sml-tw{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1.2em 0 1.8em;} #bodyContent .sml-tw table.inline{margin:0;max-width:none;} @media (max-width:1100px){ #bodyContent p{max-width:none;} #bodyContent table.inline th{white-space:normal;padding:7px 10px!important;} #bodyContent table.inline td{padding:7px 10px!important;} #bodyContent .sml-spec,#bodyContent .sml-spec:not(.sml-keep){max-width:100%;} #bodyContent .sml-spec table.inline th,#bodyContent .sml-spec table.inline td{padding:8px 12px!important;} #bodyContent .sml-spec.sml-featured .sml-spec-hd{padding:10px 12px;} #bodyContent .sml-spec.sml-figgrid table.inline tr td,#bodyContent .sml-spec.sml-figgrid table.inline tr td:first-child{padding:10px 8px 12px!important;} #bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr td,#bodyContent .sml-spec:not(.sml-keep).sml-figgrid table.inline tr td:first-child{padding:9px 8px 11px!important;} #bodyContent p.sml-figure{max-width:100%;padding:12px 10px;} #bodyContent p.sml-figure img.media{max-width:100%;} } @media (max-width:760px){ #bodyContent .sml-spec:not(.sml-keep).sml-figgrid img.media{width:100%!important;max-width:100%!important;} } /* ===== 第 3 章起 · 文档区:统一版心 + 发布级命令行引用块 ===== */ /* 统一阅读版心:正文 / 列表 / 表格 / 提示 / 图版共用一条右边界 */ #bodyContent .sml-doc p, #bodyContent .sml-doc ol, #bodyContent .sml-doc ul:not(.toclist){max-width:min(100%,780px);} #bodyContent .sml-doc p{margin:0 0 .85em;} #bodyContent .sml-doc .sml-tw{max-width:min(100%,820px);margin:1.05em 0 1.5em;} #bodyContent .sml-doc table.inline{margin:0;} #bodyContent .sml-doc table.inline th{background:#f4f7fb!important;font-size:12px!important;letter-spacing:.4px;padding:8px 14px!important;} #bodyContent .sml-doc table.inline td{padding:7px 14px!important;font-size:13px;} /* 代码块:官网发布级「命令行引用」—— 单色、无标签条、无边框圆角、三档对齐 */ #bodyContent .sml-doc pre.code, #bodyContent .sml-doc pre.file{ display:block!important; width:fit-content!important; min-width:min(100%,480px)!important; max-width:min(100%,860px)!important; box-sizing:border-box!important; margin:1.05em 0 1.5em!important; padding:14px 20px 14px 18px!important; background:#f7f9fb!important; border:0!important; border-left:2px solid #7fa3c6!important; border-radius:0!important; box-shadow:none!important; font:13px/1.8 "Cascadia Mono",Consolas,"SFMono-Regular",Menlo,monospace,"Microsoft YaHei",sans-serif!important; color:#243447!important; overflow-x:auto!important; } /* 去掉语言标签条,只保留命令本身 */ #bodyContent .sml-doc pre.code::before, #bodyContent .sml-doc pre.file::before{content:none!important;display:none!important;} /* 语法高亮压成单色:注释淡灰且不倾斜,其余全部墨色 */ #bodyContent .sml-doc pre.code span[class], #bodyContent .sml-doc pre.file span[class]{color:inherit!important;font-style:normal!important;font-weight:inherit!important;background:none!important;text-decoration:none!important;} #bodyContent .sml-doc pre.code span[class^="co"], #bodyContent .sml-doc pre.file span[class^="co"]{color:#8a97a5!important;} #bodyContent .sml-doc pre.code code, #bodyContent .sml-doc pre.file code{font-size:1em!important;background:none!important;border:0!important;color:inherit!important;} /* 按内容宽度归档,右边界只有三条对齐线 */ #bodyContent .sml-doc pre.code.sml-cw1, #bodyContent .sml-doc pre.file.sml-cw1{width:480px!important;} #bodyContent .sml-doc pre.code.sml-cw2, #bodyContent .sml-doc pre.file.sml-cw2{width:640px!important;} #bodyContent .sml-doc pre.code.sml-cw3, #bodyContent .sml-doc pre.file.sml-cw3{width:860px!important;} /* 提示块:同样收进版心,弱化底色与边框 */ #bodyContent .sml-doc p.sml-note{ width:fit-content; min-width:min(100%,320px); max-width:min(100%,780px); box-sizing:border-box; margin:.9em 0 1.35em!important; padding:8px 16px!important; background:#f7f9fb!important; border:0!important; border-left:2px solid #7fa3c6!important; border-radius:0!important; font-size:13px;line-height:1.7;color:#4a5765; } /* 截图类图片:细线边界,无阴影 */ #bodyContent .sml-doc p > a.media > img.media{ max-width:min(100%,780px); border:1px solid #e6ebf1!important; border-radius:3px!important; box-shadow:none!important; } /* 章标题横线也收进同一版心,右边界与正文对齐 */ #bodyContent h2.sml-doc{max-width:min(100%,780px);box-sizing:border-box;} /* 小节留白收紧,标题层级更利落 */ #bodyContent h3.sml-doc{margin:1.8em 0 .7em!important;} #bodyContent h4.sml-doc{margin:1.35em 0 .5em!important;} @media (max-width:760px){ #bodyContent .sml-doc pre.code, #bodyContent .sml-doc pre.file, #bodyContent .sml-doc p.sml-note{min-width:min(100%,240px)!important;} } .sml-3d{position:absolute;inset:0;display:none;z-index:4;background:#f3f6fa;}.sml-g-stage.on3d{height:430px;}.sml-g-stage.on3d>*:not(.sml-3d){visibility:hidden;}.sml-g-stage.on3d .sml-3d{display:block;}.sml-g-side.on3d{justify-content:flex-start;}.sml-g-side.on3d button.sml-g-thumb{flex:0 0 auto;min-height:38px;}button.sml-g-thumb[data-3d] svg{display:block;width:100%;height:100%;}@media (max-width:900px){.sml-g-stage.on3d{height:330px;}.sml-g-side{flex-wrap:wrap!important;gap:4px!important;}button.sml-g-thumb{flex:1 1 calc(33.333% - 3px)!important;min-width:0;}.sml-g-side.on3d button.sml-g-thumb{min-height:44px;}.sml-g-cap{max-width:calc(100% - 78px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}} .sml-g-side{flex:0 0 168px;} /* ===== R10: seven views, taller gallery stage ===== */ .sml-g-stage{height:364px;} .sml-g-side{flex:0 0 158px;} @media (max-width:900px){.sml-g-stage{height:220px;}} @media (max-width:520px){.sml-g-stage{height:180px;}} </style></html> <html><script> (function(){ /* 页面标题取正文里的产品 H1,避免写死型号;需等 H1 渲染后再设 */ function setTitle(){ var h=document.querySelector('#bodyContent h1'); var t=h?h.textContent.trim():''; if(t) document.title=t+' - SmartInc Product Wiki'; } if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',setTitle);}else{setTitle();} })(); </script></html> <html><script> (function(){ function bind(){ var hd=document.getElementById('smltoc-hd'); if(!hd) return; hd.onclick=function(){ var u=document.getElementById('smltoc-list'); if(!u) return; var on = (u.style.display==='none'); u.style.display = on ? '' : 'none'; hd.querySelector('a').textContent = on ? '[Hide]' : '[Show]'; }; } if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',bind);}else{bind();} })(); </script></html> <html><h1 style="margin:0 0 .2em 0;padding:0;">sBOX-R13 Series</h1></html> <html><p style="font-size:13px;color:#54595d;margin:0 0 1.1em 0;">Product Series: sBOX-R13 · AIoT Edge Gateway (BOX PC) · Rockchip RK3568 · SUS201 brushed stainless steel · Fanless</p></html> <html><div class="sml-top"><div class="sml-left"><div id="smltoc"> <div class="hd" id="smltoc-hd">Contents <a>[Hide]</a></div> <ul class="toclist" id="smltoc-list"> <li class="l1"><a href="#product_specifications">1 Product Specifications</a></li> <li class="l2"><a href="#overview">1.1 Overview</a></li> <li class="l2"><a href="#general_specifications">1.2 General Specifications</a></li> <li class="l2"><a href="#structure_and_cooling">1.3 Structure and Cooling</a></li> <li class="l2"><a href="#environmental_and_reliability">1.4 Environmental and Reliability</a></li> <li class="l2"><a href="#models_and_configurations">1.5 Models and Configurations</a></li> <li class="l2"><a href="#optional_accessories">1.6 Optional Accessories</a></li> <li class="l1"><a href="#interfaces_and_dimensions">2 Interfaces and Dimensions</a></li> <li class="l2"><a href="#exterior_views">2.1 Exterior Views</a></li> <li class="l2"><a href="#interface_overview">2.2 Interface Overview</a></li> <li class="l2"><a href="#interface_pin_definitions">2.3 Interface Pin Definitions</a></li> <li class="l2"><a href="#mechanical_dimensions">2.4 Mechanical Dimensions</a></li> <li class="l3"><a href="#quick_start">3 Quick Start</a></li> <li class="l2"><a href="#system_download">3.1 System Download</a></li> <li class="l2"><a href="#flashing_tool_download">3.2 Flashing Tool Download</a></li> <li class="l2"><a href="#system_flashing">3.3 System Flashing</a></li> <li class="l2"><a href="#android_system_upgrade">3.4 Android System Upgrade</a></li> <li class="l1"><a href="#before_you_start">3.4.1 Before You Start</a></li> <li class="l1"><a href="#prepare_updateimg">3.4.2 Prepare update.img</a></li> <li class="l1"><a href="#local_upgrade_via_usb_drive">3.4.3 Local Upgrade via USB Drive</a></li> <li class="l1"><a href="#ota_update_android">3.4.4 OTA Update (Android)</a></li> <li class="l3"><a href="#android_system_usage">4 Android System Usage</a></li> <li class="l2"><a href="#enable_adb_debugging">4.1 Enable ADB Debugging</a></li> <li class="l1"><a href="#usb_adb_usage">4.1.1 USB ADB Usage</a></li> <li class="l1"><a href="#network_adb_usage">4.1.2 Network ADB Usage</a></li> <li class="l2"><a href="#wifi_usage">4.2 WiFi Usage</a></li> <li class="l2"><a href="#ethernet_usage">4.3 Ethernet Usage</a></li> <li class="l2"><a href="#g_module_usage">4.4 4G Module Usage</a></li> <li class="l1"><a href="#support_list">4.4.1 Support List</a></li> <li class="l1"><a href="#steps">4.4.2 Steps</a></li> <li class="l2"><a href="#serial_port_usage">4.5 Serial Port Usage</a></li> <li class="l1"><a href="#test_tool_comassistant">4.5.1 Test Tool ComAssistant</a></li> <li class="l1"><a href="#test_method">4.5.2 Test Method</a></li> <li class="l1"><a href="#application-layer_calls">4.5.3 Application-Layer Calls</a></li> <li class="l2"><a href="#usb_storage_and_file_transfer">4.6 USB Storage and File Transfer</a></li> <li class="l2"><a href="#audio_test">4.7 Audio Test</a></li> <li class="l2"><a href="#hdmi_and_dual_display">4.8 HDMI and Dual Display</a></li> <li class="l2"><a href="#button_and_indicator_led_test">4.9 Button and Indicator LED Test</a></li> <li class="l2"><a href="#dual_sim_usage">4.10 Dual SIM Usage</a></li> <li class="l2"><a href="#gpio_usage">4.11 GPIO Usage</a></li> <li class="l2"><a href="#api_reference_and_usage">4.12 API Reference and Usage</a></li> <li class="l1"><a href="#usage_instructions">4.12.1 Usage Instructions</a></li> <li class="l1"><a href="#hardware_and_system_information_query">4.12.2 Hardware and System Information Query</a></li> <li class="l1"><a href="#display_control_display">4.12.3 Display Control (display_)</a></li> <li class="l1"><a href="#gpio_control_gpio">4.12.4 GPIO Control (gpio_)</a></li> <li class="l1"><a href="#serial_port_control_uart">4.12.5 Serial Port Control (uart_)</a></li> <li class="l1"><a href="#system_control_sysctrl">4.12.6 System Control (sysctrl_)</a></li> <li class="l3"><a href="#linux_system_usage">5 Linux System Usage</a></li> <li class="l2"><a href="#sound_card_usage">5.1 Sound Card Usage</a></li> <li class="l2"><a href="#network_usage">5.2 Network Usage</a></li> <li class="l1"><a href="#ethernet">5.2.1 Ethernet</a></li> <li class="l1"><a href="#wifi">5.2.2 WiFi</a></li> <li class="l2"><a href="#serial_port_usage_linux">5.3 Serial Port Usage (Linux)</a></li> <li class="l2"><a href="#gpio_usage_sysfs">5.4 GPIO Usage (sysfs)</a></li> <li class="l2"><a href="#usb_and_sd_card_mounting">5.5 USB and SD Card Mounting</a></li> <li class="l2"><a href="#resolution_and_hdmi">5.6 Resolution and HDMI</a></li> <li class="l2"><a href="#remote_access_and_file_transfer">5.7 Remote Access and File Transfer</a></li> <li class="l2"><a href="#auto-run_programs_at_boot">5.8 Auto-run Programs at Boot</a></li> <li class="l1"><a href="#execute_before_login">5.8.1 Execute Before Login</a></li> <li class="l1"><a href="#execute_after_login">5.8.2 Execute After Login</a></li> <li class="l1"><a href="#execute_after_entering_the_graphical_interface">5.8.3 Execute After Entering the Graphical Interface</a></li> <li class="l2"><a href="#ui_and_display_customization">5.9 UI and Display Customization</a></li> <li class="l1"><a href="#status_bar_customization">5.9.1 Status Bar Customization</a></li> <li class="l1"><a href="#disable_the_desktop_environment">5.9.2 Disable the Desktop Environment</a></li> <li class="l1"><a href="#replace_the_boot_logo">5.9.3 Replace the Boot LOGO</a></li> <li class="l1"><a href="#switching_between_different_lcd_displays">5.9.4 Switching Between Different LCD Displays</a></li> <li class="l1"><a href="#screen_rotation">5.9.5 Screen Rotation</a></li> <li class="l2"><a href="#ota_firmware_update">5.10 OTA Firmware Update</a></li> <li class="l1"><a href="#ota_over_network">5.10.1 OTA over Network</a></li> <li class="l1"><a href="#ota_update_via_usb_drive">5.10.2 OTA Update via USB Drive</a></li> <li class="l2"><a href="#cross-compilation_environment">5.11 Cross-Compilation Environment</a></li> <li class="l1"><a href="#install_the_cross-compilation_environment_via_apt">5.11.1 Install the Cross-Compilation Environment via apt</a></li> <li class="l1"><a href="#download_a_specific_toolchain_version">5.11.2 Download a Specific Toolchain Version</a></li> <li class="l1"><a href="#toolchain_downloads">5.11.3 Toolchain Downloads</a></li> <li class="l2"><a href="#qt_application_development">5.12 Qt Application Development</a></li> <li class="l1"><a href="#import_a_docker_image_for_compilation">5.12.1 Import a Docker Image for Compilation</a></li> <li class="l1"><a href="#set_up_the_qt_build_environment_on_the_board">5.12.2 Set Up the Qt Build Environment on the Board</a></li> <li class="l2"><a href="#video_hardware_codec_support">5.13 Video Hardware Codec Support</a></li> <li class="l3"><a href="#general_methods">6 General Methods</a></li> <li class="l2"><a href="#check_cpu_temperature">6.1 Check CPU Temperature</a></li> <li class="l2"><a href="#check_the_cpu_serial_number">6.2 Check the CPU Serial Number</a></li> <li class="l2"><a href="#check_cpu_frequency">6.3 Check CPU Frequency</a></li> <li class="l2"><a href="#check_memory_capacity">6.4 Check Memory Capacity</a></li> <li class="l2"><a href="#check_storage_capacity">6.5 Check Storage Capacity</a></li> <li class="l2"><a href="#network_ping_test">6.6 Network Ping Test</a></li> <li class="l2"><a href="#set_system_time_and_save_to_the_rtc_chip">6.7 Set System Time and Save to the RTC Chip</a></li> <li class="l3"><a href="#appendix">7 Appendix</a></li> <li class="l2"><a href="#faq_troubleshooting">7.1 FAQ Troubleshooting</a></li> <li class="l2"><a href="#document_information_and_revision_history">7.2 Document Information and Revision History</a></li> <li class="l2"><a href="#technical_support">7.3 Technical Support</a></li> <li class="l2"><a href="#development_resources">7.4 Development Resources</a></li> </ul> </div></div> <div class="sml-gallery"> <div class="sml-g-head"><div><div class="sml-g-kicker">PRODUCT GALLERY</div><div class="sml-g-title">sBOX-R13 Series · Exterior</div></div><div class="sml-g-note">Ultra-thin edge gateway · switch views on the right</div></div> <div class="sml-g-body"><div class="sml-g-stage"><img id="sml-g-main" class="sml-g-main" src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_front_v.jpg" alt="Front view · all external I/O on the front panel"><div class="sml-g-badge">BOX PC</div><a id="sml-g-zoom" class="sml-g-zoom" href="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_front.jpg" target="_blank" rel="noopener">View full size ↗</a><div class="sml-3d" id="sml-3d"></div><div class="sml-g-cap" id="sml-g-cap">Front view · all external I/O on the front panel</div><div class="sml-g-count" id="sml-g-count">01 / 06</div></div> <div class="sml-g-side"><div class="sml-g-side-hd">VIEWS / 06</div> <button type="button" class="sml-g-thumb on" data-view="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_front_v.jpg" data-full="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_front.jpg" data-idx="01" data-cap="Front view · all external I/O on the front panel"><span class="sml-g-tn"><img src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_front_thumb.jpg" alt="Front view"></span><span class="sml-g-tx"><b>SLC</b>Front view</span></button> <button type="button" class="sml-g-thumb" data-view="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso_v.jpg" data-full="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso.jpg" data-idx="02" data-cap="Perspective · brushed stainless housing"><span class="sml-g-tn"><img src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso_thumb.jpg" alt="Perspective"></span><span class="sml-g-tx"><b>SLC</b>Perspective</span></button> <button type="button" class="sml-g-thumb" data-view="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso_rear_v.jpg" data-full="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso_rear.jpg" data-idx="03" data-cap="Perspective · louvred side vents"><span class="sml-g-tn"><img src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_iso_rear_thumb.jpg" alt="Rear perspective"></span><span class="sml-g-tx"><b>SLC</b>Rear perspective</span></button> <button type="button" class="sml-g-thumb" data-view="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_rear_v.jpg" data-full="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_rear.jpg" data-idx="04" data-cap="Rear view · antenna jacks and dual SIM"><span class="sml-g-tn"><img src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_rear_thumb.jpg" alt="Rear view"></span><span class="sml-g-tx"><b>SLC</b>Rear view</span></button> <button type="button" class="sml-g-thumb" data-view="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_ifdetail_v.jpg" data-full="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_ifdetail.jpg" data-idx="05" data-cap="Interface detail · silkscreen and connectors"><span class="sml-g-tn"><img src="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_ifdetail_thumb.jpg" alt="Interface detail"></span><span class="sml-g-tx"><b>SLC</b>Interface detail</span></button> <button type="button" class="sml-g-thumb" data-3d="1" data-idx="06" data-zip="/dokuwiki/lib/exe/fetch.php?media=wiki:sbox_r13_3d.zip" data-lang="en" data-size="about 1.0 MB" data-rear="1" data-parts="[["底壳(含安装支架)","Bottom Shell","#c2c6c9",0.0,0,0,0,true,0.1],["上盖","Top Cover","#d6d9dc",1.0,0,1,0,true,0.14],["内部钣金件","Inner Sheet Metal","#aeb4b9",0.7,0,1,0,false,0.16],["内衬支架","Inner Bracket","#b6bcc2",0.8,0,1,0,true,0.3],["内隔板","Inner Plate","#c6cace",0.56,0,1,0,true,0.16],["主板","Mainboard","#1d6b3a",0.3,0,1,0,true,0.95],["绝缘片","Insulator","#d8d2b8",0.18,0,1,0,false,0.22],["后置端子排","Rear Terminal Block","#2e8b47",0.24,0,0,-1,true,0.9],["电源指示灯","Power LED","#4fa3ff",0.18,0,0,1,false,0.62],["DC 座垫片","DC Jack Plate","#8e9497",0.18,0,0,1,false,0.62],["DC 电源插座","DC Jack","#23282d",0.16,0,0,1,true,0.9],["系统指示灯","System LED","#3fdd7a",0.18,0,0,1,false,0.62],["按键组","Button Set","#3a4046",0.18,0,0,1,false,0.62],["音频插座","Audio Jack","#23282d",0.15,0,0,1,true,0.9],["USB 接口","USB Port","#1a5fa8",0.16,0,0,1,true,0.9],["面板标签","Panel Label","#eef1f3",0.14,0,0,1,false,0.62],["立式扩展板","Riser Board","#1d6b3a",0.26,0,1,0,true,0.9],["面板隔片","Panel Strip","#9aa0a5",0.14,0,0,1,true,0.62],["导光柱","Light Guide","#e8c04a",0.16,0,0,1,false,0.62]]" data-cap="3D exploded view · drag to orbit / scroll to zoom / click a part"><span class="sml-g-tn"><svg viewBox="0 0 44 30" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><g fill="none" stroke="#0b5394" stroke-width="1.3" stroke-linejoin="round"><path d="M12 8 L22 3 L32 8 L22 13 Z"/><path d="M12 8 L12 20 L22 25 L22 13"/><path d="M32 8 L32 20 L22 25"/><path d="M17 5.5 L27 10.5" stroke="#8fb2d6" stroke-width="1"/></g></svg></span><span class="sml-g-tx"><b>SLC</b>3D</span></button> </div></div> <div class="sml-g-specs"><div class="sml-g-spec"><b>RK3568</b><em>quad-core Cortex-A55 · 1 TOPS NPU</em></div><div class="sml-g-spec"><b>1 × GLAN · 2 × RS485</b><em>2 × RS232 · 4 USB ports</em></div><div class="sml-g-spec"><b>198.6 × 105.2 × 26mm</b><em>1kg · fanless, bracket mounted</em></div><div class="sml-g-spec"><b>-20 ~ 70℃</b><em>SUS201 brushed stainless steel</em></div></div> <div class="sml-g-apps"><span class="t">Typical applications</span><span class="chip">Edge computing</span><span class="chip">Production-line networking</span><span class="chip">Power and energy</span><span class="chip">Transportation / in-vehicle</span></div> </div> </div></html> <html><script> (function(){ /* 图库普通视角切换:R13 建页时漏掉了 R10 里的 bind(),此处补回 */ function bindG(){ var st=document.getElementById('sml-g-main'); if(!st) return; var cap=document.getElementById('sml-g-cap'); var cnt=document.getElementById('sml-g-count'); var zoom=document.getElementById('sml-g-zoom'); var bs=document.querySelectorAll('button.sml-g-thumb'); for(var i=0;i<bs.length;i++){ if(bs[i].hasAttribute('data-3d')) continue; bs[i].addEventListener('click',function(){ for(var j=0;j<bs.length;j++){bs[j].className='sml-g-thumb';} this.className='sml-g-thumb on'; var self=this; st.style.opacity='0.35'; window.setTimeout(function(){ st.src=self.getAttribute('data-view'); st.alt=self.getAttribute('data-cap'); st.style.opacity='1'; },90); if(cap) cap.textContent=self.getAttribute('data-cap'); var tot=bs.length; if(cnt) cnt.textContent=self.getAttribute('data-idx')+' / '+(tot<10?'0'+tot:tot); if(zoom) zoom.href=self.getAttribute('data-full'); }); } } if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',bindG);}else{bindG();} })(); </script></html> ===== 1 Product Specifications ===== ==== 1.1 Overview ==== The sBOX-R13 series is a **compact edge computing gateway (BOX PC)** for AIoT deployments, built on the Rockchip **RK3568** platform in a **SUS201 brushed stainless steel, fanless, fully enclosed** housing rated for -20 ~ 70℃ and mounted by a bottom bracket. The unit uses an ultra-thin "front-panel I/O + one-piece sheet-metal top + bottom mounting bracket" layout, only 26mm thick. The front panel groups the DC input, indicator LEDs, Recover / Return pinholes, MIC, RS485&RS232 terminals, HDMI, Gigabit Ethernet and four USB ports; the rear carries the Wi-Fi / 4G antenna jacks, two Micro SIM slots, RS485 / RS232 terminals, SPK and GPIO. I/O uses a **cable-free design**: board-level connectors align directly with the housing cut-outs, minimising internal wiring. Typical applications include production-line networking, edge computing, power and energy, and transportation / in-vehicle systems. **Highlights** * Rockchip RK3568 quad-core processor (4 × Cortex-A55 @2.0GHz, 1 TOPS NPU) * Rich I/O with cable-free design: 2 × RS485 + 2 × RS232, 2 × USB3.0 (one shared with OTG) + 2 × USB2.0, 1 × HDMI, 1 × Gigabit Ethernet * Onboard 2.4G/5G dual-band Wi-Fi (802.11 a/b/g/n/ac) + Bluetooth 5.0; Mini-PCIe supports LTE 4G modules * SUS201 brushed stainless steel housing, fanless, bracket mounting * Ultra-thin chassis 198.6 × 105.2 × 26mm, 1kg net weight, -20 ~ 70℃ operating range ==== 1.2 General Specifications ==== ^ Item ^ Specification ^ | **Product Name** | sBOX-R13 | | **CPU** | Rockchip RK3568 quad-core, 4 × Cortex-A55, up to 2.0GHz | | **GPU** | G52 GPU | | **NPU** | 1 TOPS (INT8) | | **Memory** | 2GB / 4GB | | **Storage** | Onboard 32GB eMMC | | **Ethernet** | 1 × 10/100/1000Mbps auto-negotiation | | **Wireless** | Onboard 2.4G/5G dual-band Wi-Fi, 802.11 a/b/g/n/ac + Bluetooth 5.0; 1 × Mini-PCIe for LTE 4G modules (optional) | | **USB** | 2 × USB2.0, 1 × USB3.0, 1 × USB3.0 (shared with OTG) | | **Audio** | 1 × SPK (8Ω 6W, PH2.0-4P), 1 × Ø3.5 Mic in | | **Serial** | 2 × RS485 (3.5mm pitch 3P terminal), 2 × RS232 (3.5mm pitch 3PIN), ttyS1 ~ ttyS4 | | **SIM** | 2 × Micro SIM slots (one at a time) | | **Indicator LEDs** | 1 × power LED (solid green), 1 × system LED (blinking blue) | | **Display Output** | 1 × HDMI, up to 4K (3840 × 2160) | | **Buttons** | 1 × Recover pinhole, 1 × Return | | **Operating System** | Android 11; Ubuntu 22.04 | | **Power Input** | DC 12V (±0.3V) with over-current and over-voltage protection; 5.5-2.1mm barrel jack | | **Power Consumption** | ≤ 20W | **Note:** Specifications are subject to change without notice. The data in this section corresponds to the sBOX-R13 datasheet v1.0 (2026-06-18). ==== 1.3 Structure and Cooling ==== ^ Item ^ Specification ^ | **Housing** | SUS201 brushed stainless steel | | **Cooling** | Fanless, fully enclosed; the one-piece sheet-metal top acts as the primary heat-spreading surface, with heat conducted from the mainboard through a thermal interface; louvred vent slots on both side walls | | **Mounting** | Bottom mounting bracket integrated with the base, bracket outline 198.6 × 114.5mm, hole pitch 80mm, corner radius R2.15 | | **Dimensions** | 198.6 × 105.2 × 26mm (excluding bracket) | | **Net Weight** | 1kg | | **Serviceability** | The one-piece sheet-metal top cover can be removed to service the mainboard, wireless module, SIM slots and terminals; front-panel fittings are fixed directly to the base | **Note:** The unit is cooled passively; leave at least 30mm of clearance above the top plate so airflow is not blocked, and do not cover the side vent slots. ==== 1.4 Environmental and Reliability ==== ^ Item ^ Value ^ | **Operating Temperature** | -20 ~ 70℃ | | **Storage Temperature** | -20 ~ 70℃ | | **Relative Humidity** | 5 ~ 95% @40℃ (non-condensing) | | **Vibration** | 1.5Grms, IEC 60068-2-64, random 5 ~ 500Hz, 1hr/axis (with SSD) | | **Shock** | 10G, IEC 60068-2-27, half-sine, 11ms duration (with SSD) | | **EMC** | CE / FCC Class A | ==== 1.5 Models and Configurations ==== ^ Part Number ^ Product Name ^ Description ^ | B13.SLR13.38.0001 | sBOX-R13-3568-2G-32G | Standard, RK3568, DC IN 12V, 2GB memory, 32GB eMMC, 1 × GLAN, onboard dual-band Wi-Fi, 1 × Mini-PCIe for LTE 4G, 2 × RS232 + 2 × RS485, 2 × USB3.0 + 2 × USB2.0, -20 ~ 70℃ | | B13.SLR13.38.0002 | sBOX-R13-3568-4G-32G | Standard, RK3568, DC IN 12V, 4GB memory, 32GB eMMC, otherwise identical | **Note:** The two models differ only in memory capacity; interfaces and structure are identical. 4G modules, Wi-Fi antennas and power adapters are optional, see 1.6. ==== 1.6 Optional Accessories ==== ^ Option ^ Description ^ | Power Adapter | 12V 3A adapter | | Wi-Fi Antenna | Rod antenna, 3M magnetic-mount antenna | | 3G/4G Module Kit | mini PCIe: EC20 / EG25 / EC25 | ===== 2 Interfaces and Dimensions ===== ==== 2.1 Exterior Views ==== The unit follows a "front-panel I/O + rear antennas and terminals + one-piece sheet-metal top" layout: the front panel groups power, LEDs, pinhole buttons, MIC, serial terminals, HDMI, Ethernet and USB; the rear carries the antenna jacks, dual SIM slots, RS485 / RS232 terminals, SPK and GPIO; both side walls have louvred vent slots and the base has mounting ears. ^ Front View ^ Perspective ^ | {{wiki:sbox_r13_front.jpg?400}} \\ Front: all external I/O on the front panel | {{wiki:sbox_r13_iso.jpg?400}} \\ Perspective: brushed stainless housing + mounting ears | ^ Rear View ^ Rear Perspective ^ | {{wiki:sbox_r13_rear.jpg?400}} \\ Rear: antenna jacks + dual SIM + terminals | {{wiki:sbox_r13_iso_rear.jpg?400}} \\ Perspective: louvred side vents | ==== 2.2 Interface Overview ==== The callouts below match the silkscreen on the unit; click the image for the full-size version. The number of antenna jacks depends on the 4G module configuration; unused positions ship with dust caps. {{wiki:sbox_r13_if_en.png?920}} **Front Panel (external I/O area)** ^ No. ^ Silkscreen ^ Interface ^ Qty ^ Remarks ^ | 1 | DC IN | Power input | 1 | 5.5-2.1mm barrel jack, DC 12V (±0.3V), over-current and over-voltage protected | | 2 | PWR | Power LED | 1 | Solid green once DC is applied | | 3 | SYS | System LED | 1 | Blinking blue while the system runs | | 4 | Recover | Recovery button | 1 | Pinhole; hold while powering on to enter Loader mode | | 5 | Return | Back button | 1 | Pinhole; mapped to the system back action | | 6 | Mic | Microphone input | 1 | Ø3.5 three-pole jack | | 7 | RS485&RS232 | Serial terminals | 1 set | 2 × 3.5mm pitch 3P pluggable terminal, RS485-1 (ttyS1) + RS232-1 (ttyS2), see 2.3.1 | | 8 | HDMI | Display output | 1 | Up to 4K (3840 × 2160) | | 9 | RJ45 | Ethernet | 1 | 10/100/1000Mbps auto-negotiation | | 10 | USB3.0 | USB3.0 | 1 | Blue, 5Gbps | | 11 | USB3.0/OTG | USB3.0 (OTG shared) | 1 | Blue; also serves as the flashing / ADB port | | 12 | USB2.0 | USB2.0 | 2 | Black, 480Mbps | **Rear (antenna and expansion area)** ^ No. ^ Silkscreen ^ Interface ^ Qty ^ Remarks ^ | 1 | Wi-Fi | Wi-Fi/Bluetooth antenna jack | 1 | SMA female, gold, for the 2.4G/5G antenna | | 2 | SIM1 / SIM2 | Micro SIM slots | 2 | One at a time, see 4.10 | | 3 | RS485 | RS485-2 | 1 | 3.5mm pitch 3P, A3 / B3 / G3, ttyS3 | | 4 | RS232 | RS232-2 | 1 | 3.5mm pitch 3PIN, R4 / T4 / G4, ttyS4 | | 5 | SPK | Speaker output | 1 | PH2.0-4P, 8Ω 6W, L+ / L- / R- / R+ | | 6 | GPIO | GPIO terminal | 1 | 16-pin, silkscreen numbered 1 ~ 16 | | 7 | 4G | 4G antenna jack | 1 | SMA female, gold, main antenna for the Mini-PCIe 4G module | **Note:** RS485 and RS232 each occupy one group on the front panel and one on the rear; the ttyS1 ~ ttyS4 numbers in the silkscreen are the Linux device node numbers, see 4.5 and 5.3. ==== 2.3 Interface Pin Definitions ==== === 2.3.1 RS485 / RS232 Terminals (3.5mm pitch 3P) === ^ Type ^ PIN 1 ^ PIN 2 ^ PIN 3 ^ Device Node ^ Location ^ | RS485-1 | A1 | B1 | G1 (GND) | /dev/ttyS1 | Front panel | | RS485-2 | A3 | B3 | G3 (GND) | /dev/ttyS3 | Rear | | RS232-1 | R2 (RXD) | T2 (TXD) | G2 (GND) | /dev/ttyS2 | Front panel | | RS232-2 | R4 (RXD) | T4 (TXD) | G4 (GND) | /dev/ttyS4 | Rear | **Note:** The terminals are 3.5mm pitch pluggable types. The actual port count follows the silkscreen on the unit; this table uses A1 B1 G1 / A3 B3 G3 / R2 T2 G2 / R4 T4 G4. RS485 is half-duplex, and swapping A / B will cause communication failure. === 2.3.2 SPK (PH2.0-4P, 8Ω 6W) === ^ PIN ^ Silkscreen ^ Definition ^ | 1 | L+ | Left channel + | | 2 | L- | Left channel - | | 3 | R- | Right channel - | | 4 | R+ | Right channel + | **Note:** For a single speaker, connect only R+ / R- (or L+ / L-), leaving the other pair unconnected. Reverse wiring will not damage the amplifier but causes phase cancellation and reduced volume. === 2.3.3 GPIO (16-pin Terminal) === The rear GPIO is a 16-pin terminal, silkscreen numbered 1 ~ 16 (1 / 2 at one end, 15 / 16 at the other). ^ Item ^ Description ^ | Pin Count | 16 (1 ~ 16) | | Level | 3.3V TTL | | Direction | Project-defined; all inputs by default in the factory firmware | | Access Method | Android: see 4.11; Linux: see 5.4 (sysfs) | | Pin Mapping | The mapping between terminal position and SoC GPIO number depends on the firmware configuration; refer to the bundled GPIO table or the SDK configuration provided by us | **Note:** GPIO pins connect directly to the SoC without isolation. Do not drive relays, solenoid valves or other inductive loads directly; use an external driver stage. ==== 2.4 Mechanical Dimensions ==== Chassis 198.6 × 105.2 × 26mm (excluding bracket); base mounting ears give an overall outline of 198.6 × 114.5mm, hole pitch 80mm, corner radius R2.15. Unit: mm. {{wiki:sbox_r13_dim_en.png?920}} ^ Item ^ Dimension ^ | **Chassis W × D × H** | 198.6 × 105.2 × 26.0mm (excluding bracket) | | **Mounting Ear Outline** | 198.6 × 114.5mm | | **Mounting Hole Pitch (vertical)** | 80.0mm | | **Hole Offset** | 12.6mm | | **Ear Corner Radius** | R2.15 | | **Net Weight** | 1kg | **Note:** Tighten all mounting-ear screws into the chassis so the unit is not carried by the bracket alone, and keep the top plate unobstructed since it is the heat-spreading surface. ===== 3 Quick Start ===== ==== 3.1 System Download ==== **Android System** * Android 11 firmware (with root access): contact Sales / Technical Support for the download link **Linux System** * Ubuntu 20.04 firmware (with Qt 5.12.8, GStreamer): contact Sales / Technical Support for the download link * Debian 11 firmware: provided separately per project requirements ==== 3.2 Flashing Tool Download ==== Both tools are official Rockchip releases, uploaded as attachments on this site; download links are at the end of each item: * **USB Driver**: After extraction, double-click DriverInstall.exe to complete the installation: {{wiki:driverassitant_v5.11.zip|DriverAssitant_v5.11 Driver Installation Package (9.4 MB)}} * **Flashing Tool**: After extraction, double-click RKDevTool.exe to launch the tool: {{wiki:rkdevtool_release_v3.32.zip|RKDevTool_Release_v3.32 Flashing Tool (5.5 MB)}} **Note:** If the driver is not installed successfully, an unknown device appears in Device Manager; reinstall the driver before flashing. ==== 3.3 System Flashing ==== Linux and Android use the same Rockchip tools for flashing; the unit requires no disassembly: connect via the **USB3.0 port** (lower row) and enter flashing mode via the **Recover pinhole**. **① Connect the USB3.0 Port** Take a USB3.0 male-to-male cable; connect one end to the blue **USB3.0** port in the lower row of the rear interface area and the other end to a PC USB port: {{wiki:burn_otg_v2.png?560}} **② Install the Rockchip USB Driver** Enter the driver package directory and double-click DriverInstall.exe: {{wiki:flash2.png?560}} When the "Rockchip Driver Assistant" dialog appears, click "Install Driver" and wait for the progress bar to complete: {{wiki:flash3.png?560}} **Note:** If the device is not recognized due to a driver error or after switching PCs, click "Uninstall Driver" in Driver Assistant first, then click "Install Driver" again. **③ Open the Flashing Tool** Extract the tool package and double-click RKDevTool.exe: {{wiki:flash4.png?560}} **④ Put the Unit into Loader Mode** Power off the unit first, hold the rear **Recover** hole with a pin without releasing, then connect DC 12V to power on, and release after about 2 seconds: {{wiki:burn_recover_v2.png?560}} **⑤ Confirm the Device Is Recognized** After entering Loader mode, check the status bar at the bottom of RKDevTool: **No Devices Found** means the unit is not recognized yet, while **Found One LOADER Device** means it is ready to flash: {{wiki:en_flash_select_firmware.png?560}} If "No Devices Found" keeps showing, go back to step ④ and re-enter, or change the USB port and data cable. **⑥ Select Firmware and Upgrade** Switch to the "Upgrade Firmware" tab, first click "Firmware" to select update.img, then click "Upgrade": {{wiki:en_flash_loader_found.png?560}} After flashing reaches 100%, the device reboots automatically; first boot takes about 30 ~ 60 seconds. **Note:** - If the device is not recognized when switching from Android to Linux (or vice versa), run "Enter Maskrom" in "Advanced Features" and re-flash - Do not cut power or unplug the cable during flashing; otherwise the unit may fail to boot and must be re-flashed after re-entering Loader ==== 3.4 Android System Upgrade ==== There are two upgrade paths; pick one according to site conditions: **local upgrade via USB drive** (offline, no network needed) and **OTA online update** (downloaded and installed by the preinstalled app once the unit is online). Both upgrade the full system image and reboot the unit automatically afterwards. ^ Path ^ Applies to ^ Prerequisites ^ Steps ^ | **Local upgrade via USB drive** | Android (Linux: see 5.10) | update.img + FAT32 USB drive | 3.4.3 | | **OTA online update** | Android | Unit online + preinstalled update app | 3.4.4 | === 3.4.1 Before You Start === - Confirm the firmware matches the unit model and SoC (naming rules in 1.3) - Back up on-site data: the upgrade rewrites the system partition, so apps and settings may be reset - Keep the power supply stable; **never cut power or unplug** during the upgrade - The first boot after upgrading takes about 30 ~ 60 s, which is normal === 3.4.2 Prepare update.img === Choose one of the two firmware sources: - Obtain a ready-made update.img from SmartInc (see 3.1 for how to get it) - Build it yourself with the SDK: run a full build in the SDK root directory to generate the rockdev/Image-xxx/ directory, then run ./mkupdate.sh (or make otapackage) <code bash> # Build the full image ./build.sh updateimg ls -lh rockdev/update.img </code> USB drive requirements: FAT32 format, available capacity ≥ 4GB (≤ 32GB recommended), place update.img in the root directory with the filename unchanged. === 3.4.3 Local Upgrade via USB Drive === - Copy update.img to the root directory of the USB drive - Insert the USB drive into a USB port on the unit (either USB3.0 / USB2.0 port works) - After the system detects the update package, confirm as prompted in the pop-up; keep the power supply on during the update, and the unit reboots automatically when done **Note:** If no upgrade prompt appears after inserting the USB drive, first check the filename and USB drive format, then reboot the unit and retry; for online update see 3.4.4. === 3.4.4 OTA Update (Android) === OTA update on Android is performed by the preinstalled **update** app; the unit must be connected to the Internet first. - Open the app list and find "update" - Tap "UPDATE NOW" and follow the prompts to download and install - Keep the power supply and network connected during the update; the unit reboots automatically when done The update icon in the app list: {{wiki:ota_app_drawer.jpg?560}} SmartInc OTA update interface: {{wiki:ota_updater.png?560}} **Note:** This section covers Android online OTA update; for offline USB drive upgrade see 3.4.3; for Linux OTA update see 5.10. ===== 4 Android System Usage ===== This chapter **applies only to the Android system** (Android 11). Equivalent functions under Linux (Ubuntu / Debian) are grouped in Chapter 5; interfaces, tools and commands are not mixed between the two chapters; Android application-layer API calls are all documented in 4.12. ==== 4.1 Enable ADB Debugging ==== === 4.1.1 USB ADB Usage === - Use a USB data cable to connect the **USB3.0 port** of the unit (blue port on the lower row) to the PC - Under "Settings → About tablet", tap "Build number" 7 times consecutively to enable Developer options - Enter "Settings → System → Advanced → Developer options" and enable "USB debugging" - On the PC, run adb devices; on first connection, tap "Allow" in the pop-up on the unit <code bash> adb devices # List of devices attached # 0123456789ABCDEF device </code> === 4.1.2 Network ADB Usage === When the unit and PC are on the same network segment, debug wirelessly without a data cable. <code bash> adb connect 192.168.8.55:5555 adb devices </code> ==== 4.2 WiFi Usage ==== - Go to "Settings → Network & Internet → WLAN" and turn on the switch - Select the target hotspot and enter the password (onboard 2.4G/5G dual-band, 802.11 a/b/g/n/ac) - After connecting, check the IP address in "Network details" - If the signal is weak, adjust the angle of the rear **Wi-Fi/BT** SMA antenna, or use a suction-cup antenna instead <code bash> adb shell dumpsys wifi | grep -i "curState" adb shell ifconfig wlan0 </code> ==== 4.3 Ethernet Usage ==== The unit has a single network port (LAN, Gigabit auto-negotiation); under Android the device name is **eth0**. All commands below run in adb shell; changing settings requires su privileges. **View Device** <code bash> ip link show </code> **Usage (Dynamic IP)** <code bash> su ifconfig eth0 up ifconfig eth0 dhcp # Some firmware requires dhcpcd eth0 instead </code> **Usage (Static IP)** <code bash> su ifconfig eth0 down ifconfig eth0 192.168.8.55 netmask 255.255.255.0 ifconfig eth0 up </code> **Test** <code bash> ping -c 4 192.168.8.1 </code> **Note:** To make a static IP take effect automatically at boot, configure a static eth0 address in the system, or set the Ethernet static IP via ConnectivityManager at the application layer. ==== 4.4 4G Module Usage ==== 4G is an **optional feature**: an LTE module is fitted in the Mini-PCIe slot and dials automatically after power-on, with no manual configuration. === 4.4.1 Support List === The standard unit ships without a 4G module; the models below are available as options. The USB ID is used to confirm in the lsusb output that the module has been recognised: ^ Model ^ Standard ^ Form Factor ^ USB ID ^ | Quectel EC20 | LTE 4G | Mini-PCIe | 2c7c:0125 | | Quectel EG25-G | LTE 4G | Mini-PCIe | 2c7c:0125 | | Quectel EC25 | LTE 4G | Mini-PCIe | 2c7c:0125 | === 4.4.2 Steps === **Install and verify** - Power off, remove the top cover, seat the Mini-PCIe 4G module and tighten its screw, then connect the module antenna (main antenna to the rear 4G jack) - Insert the SIM card with the notch facing out and the contacts facing the board; the two slots are used one at a time, see 4.10 - After power-on, confirm the SIM is recognised under "Settings → Network & internet → Mobile network" - Enable mobile data; a 4G icon in the status bar means the link is up <code bash> adb shell lsusb # Bus 002 Device 002: ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 </code> **Check signal and network registration (AT commands)** The module AT port is usually /dev/ttyUSB2 and requires root: <code bash> echo -e "AT+CPIN?\r\n" > /dev/ttyUSB2 # Is the SIM seated echo -e "AT+CSQ\r\n" > /dev/ttyUSB2 # Signal strength, 0~99 is normal echo -e "AT+COPS?\r\n" > /dev/ttyUSB2 # Registered on the operator network echo -e "AT+CGREG?\r\n" > /dev/ttyUSB2 # Packet data ready </code> **Note:** Insert or remove the SIM card only with the power **off**; hot-plugging may leave the module unrecognised until the next power cycle. If the 4G antenna is not connected or is on the wrong jack, signal strength still reads normally but no data connection is established. ==== 4.5 Serial Port Usage ==== The unit provides 2 × RS485 and 2 × RS232; Android node and terminal definitions are as follows (the rear silkscreen label takes precedence): ^ Interface ^ Device Node ^ Pin Definition ^ | RS485-1 | /dev/ttyS1 | A1 / B1 / G1 | | RS485-2 | /dev/ttyS3 | A3 / B3 / G3 | | RS232-1 | /dev/ttyS2 | R2 / T2 / G2 | | RS232-2 | /dev/ttyS4 | R4 / T4 / G4 | === 4.5.1 Test Tool ComAssistant === Serial port testing under Android uses **ComAssistant** (a serial assistant app) throughout: - Install and open ComAssistant; on first run, grant storage and serial port device permissions - Select the target node in the device list: RS485 uses /dev/ttyS1 or /dev/ttyS3; RS232 uses /dev/ttyS2 or /dev/ttyS4 - Set the parameters to 115200, 8 data bits, 1 stop bit, no parity (8N1) - Tap "Open serial port", enter content in the send area and tap "Send"; during loopback or mutual transmission, observe the receive area at the same time **Note:** ComAssistant requires Root privileges to access /dev/ttyS*; if opening fails, first run su and ls -l /dev/ttyS* in adb shell to check node permissions. === 4.5.2 Test Method === - RS232 loopback: short R and T of the same 232 node with a jumper cap - RS232 — RS232 mutual transmission: cross wiring (R↔T, common GND) - RS232 — RS485 mutual transmission: via a 232-to-485 converter module - RS232 — RS232-to-USB — serial port assistant on the PC - RS485 — RS485-to-USB — serial port assistant on the PC **Precautions** - The unit has a 2.5mm 3P pluggable terminal (no DB9); use a crimp terminal or adapter cable. Adapter cable pinouts may differ between manufacturers; reversing A / B or R / T directly causes communication failure - RS485 is half-duplex; direction is switched automatically by hardware, so observe the frame interval when switching between transmit and receive === 4.5.3 Application-Layer Calls === Do not open nodes directly via shell in the app; use the NodkaAPI uart_ interface (see 4.12.5): <code java> NodkaAPI api = NodkaAPI.nodkaAPICreate(context); api.uart_open("/dev/ttyS2", 115200); api.uart_send("/dev/ttyS2", "hello".getBytes()); api.uart_receive("/dev/ttyS2", new UartReceiveDataCallback() { @Override public void onReceiveData(byte[] data) { // Process the received data } }); api.uart_close("/dev/ttyS2"); </code> ==== 4.6 USB Storage and File Transfer ==== The unit provides 2 × USB3.0 (one shared with OTG, supporting Device mode) and 2 × USB2.0. **USB Drive** - Insert the USB drive; "USB storage device" appears on the left side of the file manager - If you can browse the USB drive contents after opening it, the drive is recognized correctly - Before unplugging, unmount it in "Settings → Storage" to avoid data corruption <code bash> adb shell ls /storage # Mount points such as udisk0 or 91A3-2B1C are visible adb shell lsusb </code> **Note:** The USB3.0/OTG port in Device mode (flashing / ADB) cannot act as Host at the same time; before inserting a USB drive, confirm the system has exited flashing mode. For manual mounting under Linux see 5.5. ==== 4.7 Audio Test ==== Unit audio is output via **SPK (PH2.0-4P, 8Ω 6W)** and input via **MIC (Ø3.5)**; connect an external speaker when no built-in speaker is present. **Speaker Output Test** - Connect an 8Ω speaker to the SPK terminal (L+ / L- / R+ / R-) **Microphone Recording Test** - Insert a Ø3.5 microphone or use the onboard MIC - Open the built-in "Recorder" app, record about 5 seconds and play it back to confirm the audio is clear with no noise **View Audio Path** <code bash> adb shell dumpsys media.audio_flinger | grep -i "Output thread" adb shell getprop | grep -i audio </code> **Note:** If there is no sound, first confirm the SPK terminals L+ / L- / R+ / R- match the speaker wire sequence, then use adb shell tinymix to check whether the amplifier path is open. Under Linux, use aplay / arecord (see 5.1). ==== 4.8 HDMI and Dual Display ==== The unit supports simultaneous output to the internal screen + HDMI, up to 3840 × 2160 on HDMI. **Set HDMI Output** - Connect an HDMI monitor and go to "Settings → Display → HDMI" - Select the resolution and refresh rate (1920 × 1080 @ 60Hz recommended) and confirm the image is stable with no flicker - Select the display mode: Mirror (Clone) or Extended (Expand) ^ Mode ^ Description ^ | Mirror (Clone) | The internal screen and HDMI show the same image, with the lower resolution of the two | | Extended (Expand) | The two screens show independent images; the app must specify DisplayId | **View via Command Line** <code bash> adb shell wm size adb shell wm density adb shell dumpsys display | grep -i "mDisplayId" </code> **Note:** In the app, use interfaces such as display_setScreenRotation / display_setScreenBrightness to control the display (see 4.12.3). Under Linux, use xrandr or weston.ini (see 5.6). ==== 4.9 Button and Indicator LED Test ==== ^ Item ^ Location ^ Phenomenon / Action ^ Verdict ^ | PWR Indicator LED | Right of the DC jack on the front panel | Solid green after DC 12V is connected | LED on indicates normal power supply | | SYS Indicator LED | Right of PWR | Blinking blue after system boot completes | Blinking LED indicates the system is running | | Recover | Pinhole right of the DC jack | Hold with power off + release 2 seconds after power-on | RKDevTool detects the LOADER device | | Return | Pinhole right of Recover | Press once while the system is running | Triggers the system back action, equivalent to the Android back key | **Recover Quick Self-Test** Hold the Recover pinhole with power off, then power on; a LOADER device appearing in RKDevTool indicates normal operation (see 3.3 for flashing steps). **Note:** Both Recover and Return are pinhole structures; use a needle with diameter ≤ 1.5mm to avoid damaging the internal tact switch. Return only works once the system is running — holding it during power-on has no effect. ==== 4.10 Dual SIM Usage ==== The rear panel provides **two Micro SIM slots (SIM1 / SIM2)** for two operator SIM cards. The slots are used **one at a time**: the system recognises only one card, and simultaneous dual-SIM operation is not supported. **Inserting a card** - With the power off, insert following the silkscreen: notch facing out, contacts facing the board, until a slight click is felt - Both slots accept standard Micro SIM (3FF); Nano SIM requires an adapter - After power-on, check the recognised slot and operator under "Settings → About device → SIM status" **Checking the active slot** <code bash> adb shell getprop | grep -i "gsm.sim" # Current SIM state adb shell dumpsys telephony.registry | grep -i "mServiceState" </code> **Note:** SIM cards must be inserted or removed with the power **off**. With both slots populated, the system uses one according to the priority set in the factory firmware; to switch, power off and keep only the target card. The slots are push-in types — do not probe them with tweezers or sharp objects, which can damage the contacts. ==== 4.11 GPIO Usage ==== The unit's GPIO is **an optional breakout** (rear GPIO socket / internal pin header). For the odd/even pin orientation of the 16-pin terminal, system GPIO numbers and terminal mapping, see **2.3**; these details are not repeated in this section. Android apps operate via the NodkaAPI gpio_ interface without shell (see 4.12.4): <code java> NodkaAPI api = NodkaAPI.nodkaAPICreate(context); api.gpio_export(95); // Export the pin api.gpio_direction(95, "out"); // Set as output api.gpio_write(95, 1); // Output high level int v = api.gpio_read(95); // Read back the level api.gpio_unExport(95); // Unexport the pin </code> **Note:** GPIO numbers are global kernel gpiochip numbers and may shift as a whole across firmware versions; run gpio_export first on unexported pins before operating. For Linux command-line (/sys/class/gpio) operations see 5.4. ==== 4.12 API Reference and Usage ==== For Android app development, hardware and system capabilities are wrapped as Java interfaces, so apps need not directly read/write /dev and /sys nodes. The Linux side does not provide this set of interfaces; use the command-line approach in Chapter 5. **Interface Source Package Download** {{wiki:androidapi1.5.zip|AndroidAPI 1.5 Interface Source Package (18.7 MB)}} The package contains AndroidAPI.jar, libandroid-jni.so, AndroidAPI-sources.jar, Javadoc documentation, the AndroidAPIDemo sample project and APK, the platform.jks signing file and readme.txt. Serial port, GPIO and system control interfaces require system signature or Root privileges. === 4.12.1 Usage Instructions === **Interface Categories** ^ Prefix ^ Category ^ Description ^ | devinfo_ | Hardware and system information query | System version, CPU, memory, storage, SN, etc. | | display_ | Display control | Brightness, rotation, resolution, navigation bar and status bar | | gpio_ | GPIO control | Export, direction, read/write level | | uart_ | Serial port control | Open, send/receive, close serial port | | sysctrl_ | System control | Scheduled power on/off, immediate reboot, silent install | **1. Create the instance in Application's onCreate** <code java> public class APIApplication extends Application { private NodkaAPI mNodkaAPI; @Override public void onCreate() { super.onCreate(); mNodkaAPI = NodkaAPI.nodkaAPICreate(this); } public NodkaAPI getNodkaAPI() { return mNodkaAPI; } } </code> **2. Retrieve it in an Activity or Fragment** <code java> private NodkaAPI mNodkaAPI = APIApplication.getApplication().getNodkaAPI(); </code> **Note:** Set android:name to APIApplication in AndroidManifest.xml; serial port, GPIO and system control interfaces require system signature or Root privileges. === 4.12.2 Hardware and System Information Query === ^ Method Name ^ Method Description ^ | devinfo_getAndroidVersion() | Get Android system version information | | devinfo_getAvailMem() | Get available memory capacity | | devinfo_getBuildNumber() | Get system build number information | | devinfo_getCpuCores() | Get CPU core count | | devinfo_getCPUCurFreqKHz() | Get current CPU frequency | | devinfo_getCPUMaxFreqKHz() | Get maximum CPU frequency | | devinfo_getCPUMinFreqKHz() | Get minimum CPU frequency | | devinfo_getCPUTemp() | Get CPU temperature | | devinfo_getDeviceModel() | Get device model information | | devinfo_getKernelVersion() | Get kernel version information | | devinfo_getSerialNum() | Get device SN | | devinfo_getStorageAvailableSize() | Get available local storage capacity | | devinfo_getStorageTotalSize() | Get local storage capacity (excluding system partition) | | devinfo_getTotalMem() | Get total memory capacity | === 4.12.3 Display Control (display_) === ^ Method Name ^ Method Description ^ | display_getNavBar() | Get whether the navigation bar and status bar are shown | | display_getScreenBrightness() | Get screen brightness | | display_getScreenRotation() | Get screen rotation direction | | display_getWindowHeight() | Get screen resolution height | | display_getWindowWidth() | Get screen resolution width | | display_setNavBar(Boolean enable) | Set whether to show the navigation bar and status bar | | display_setNavBarSlideShow(Boolean enable) | Set whether to show the navigation bar and status bar when sliding | | display_setScreenBrightness(int screenBrightness) | Set screen brightness | | display_setScreenRotation(int rotation) | Set screen rotation direction | === 4.12.4 GPIO Control (gpio_) === ^ Method Name ^ Method Description ^ | gpio_direction(int gpioNumber, String direction) | Set the direction of the specified GPIO (input / output) | | gpio_export(int gpioNumber) | Export the specified GPIO pin | | gpio_read(int gpioNumber) | Read the level of the specified GPIO | | gpio_unExport(int gpioNumber) | Unexport the specified GPIO pin | | gpio_write(int gpioNumber, int value) | Set the output level of the specified GPIO | See 4.11 for pin numbers. === 4.12.5 Serial Port Control (uart_) === ^ Method Name ^ Method Description ^ | uart_close(String uartNode) | Close the uart device, e.g. /dev/ttyS2 | | uart_getAvailableDevices() | Get available UART device nodes (returns a List<String>) | | uart_IsOpen(String uartNode) | Check whether the uart device is open | | uart_open(String uartNode, int baudrate) | Open the uart device and set the baud rate | | uart_receive(String uartNode, UartReceiveDataCallback callback) | Receive serial port data, returned via data callback | | uart_send(String uartNode, byte[] buffer) | Send serial port data | | uart_stopReceive(String uartNode) | Stop receiving data; no more callbacks after this call | See 4.5 for nodes and test methods. === 4.12.6 System Control (sysctrl_) === ^ Method Name ^ Method Description ^ | sysctrl_cancelReboot() | Cancel device reboot | | sysctrl_cancelShutdown() | Cancel scheduled shutdown | | sysctrl_powerOn(String time, boolean repeat) | Set the device power-on time | | sysctrl_reboot(String time, boolean repeat) | Set the device reboot time | | sysctrl_rebootNow() | Reboot the device immediately | | sysctrl_shutdown(String time, boolean repeat) | Set the device shutdown time | | sysctrl_shutdownNow() | Shut down immediately | | sysctrl_installApk(String apkPath) | Silently install an application | ===== 5 Linux System Usage ===== This chapter **applies only to Linux systems** (Ubuntu 20.04 / Debian 11, Buildroot for some projects). For the corresponding functions on Android, see Chapter 4. Except for **5.11 Cross-compilation** and **5.12.1 Docker Compilation**, which run on the **development host**, all commands in this chapter are executed in the on-board terminal or via SSH. The criteria for buttons, indicator LEDs and the touch screen are the same as in Chapter 4 (see 4.9, 4.10) and are not repeated here. Sections from 5.8 onward are system customization items commonly used for factory projects. ==== 5.1 Sound Card Usage ==== <code bash> aplay -l # List sound cards and devices aplay /nodka_test/LR_audio.wav -D hw:0,0 # Play via the specified sound card device arecord -d 5 -f cd -r 44100 -c 2 -t wav test.wav aplay test.wav </code> Volume adjustment: <code bash> alsamixer amixer -c 0 set 'Playback' 80% </code> **Note:** Unit playback outputs from the SPK terminal (PH2.0-4P); connect an external 8Ω speaker. MIC uses the Ø3.5 interface. ==== 5.2 Network Usage ==== === 5.2.1 Ethernet === **View network ports** <code bash> ifconfig -a ip link show </code> **Set a static IP via command line** 1. Open the network configuration file with vim: vim /etc/network/interfaces 2. Modify the IP, netmask and gateway according to the on-site network (the unit has a single network port; configure only eth0) <code bash> auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.2.110 netmask 255.255.255.0 gateway 192.168.2.1 </code> 3. Save and exit (press Esc in vim, type :wq), then reboot the system for the configuration to take effect. **Note:** On Ubuntu 20.04, NetworkManager manages the network by default, so the configuration in /etc/network/interfaces may not take effect; in this case use the nmcli method in 5.2.2, or disable NetworkManager first and then use the method in this section. **Set DNS** <code bash> vi /etc/resolv.conf nameserver 114.114.114.114 </code> **Network priority** <code bash> # Temporary change; the smaller the value, the higher the priority sudo ifmetric eth0 100 # Permanent modification sudo nmcli connection modify "Wired connection name" connection.autoconnect-priority 1 sudo nmcli connection modify "Wired connection name" ipv4.route-metric 100 sudo nmcli connection modify "Wired connection name" connection.autoconnect yes sudo systemctl restart NetworkManager </code> **Verification** <code bash> ping -c 4 192.168.2.1 ping -c 4 www.baidu.com </code> **Note:** In the graphical interface (Debian desktop), set the IP, netmask and gateway directly in "About NetworkManager Applet → Edit Connections…"; when no existing connection is available, click + in the bottom right to create one. === 5.2.2 WiFi === **Query and enable the wireless NIC** <code bash> ifconfig -a # Wireless NIC is usually wlan0 ifconfig wlan0 up # Enable the wireless NIC iw dev wlan0 scan # Scan for hotspots to get SSID, signal strength, and encryption method </code> **Connect to a wireless network** <code bash> nmcli d wifi connect "SSID" password "PASSWORD" </code> **Static IP** <code bash> sudo nmcli connection modify NODKA ipv4.addresses 172.10.21.111/24 # IP / subnet mask sudo nmcli connection modify NODKA ipv4.gateway 172.10.21.1 # Gateway sudo nmcli connection modify NODKA ipv4.dns "114.114.114.114,61.177.7.1,8.8.8.8" # DNS sudo nmcli connection modify NODKA ipv4.method manual # Static sudo nmcli device disconnect wlan0 sudo nmcli device connect wlan0 </code> **Dynamic IP (DHCP)** <code bash> sudo nmcli connection modify NODKA ipv4.method auto sudo nmcli connection modify NODKA ipv4.addresses "" # Clear the static IP sudo nmcli connection modify NODKA ipv4.gateway "" # Clear the gateway sudo nmcli connection modify NODKA ipv4.dns "" # Clear DNS (optional) sudo nmcli connection down NODKA sudo nmcli connection up NODKA </code> **Configure as an AP hotspot** <code bash> IFNAME="wlan0" # Wireless NIC node CON_NAME="One" # Hotspot name nmcli con add type wifi ifname $IFNAME con-name $CON_NAME autoconnect yes ssid $CON_NAME nmcli con modify $CON_NAME 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared nmcli con up $CON_NAME </code> **Note:** If the signal is weak, adjust the angle of the rear Wi-Fi/BT antenna or use a suction-cup antenna instead; after connecting, use ip addr show wlan0 to view the assigned address. ==== 5.3 Serial Port Usage (Linux) ==== On Linux, the serial port nodes are the same as on Android: RS485 is /dev/ttyS1 or /dev/ttyS3; RS232 is /dev/ttyS2 or /dev/ttyS4 (refer to the rear silkscreen label). **Test tools** - GUI: CuteCom (sudo apt install cutecom); select /dev/ttyS2, 115200, 8N1, then open - Command line: built-in com_send / com_recv <code bash> # Send com_send /dev/ttyS2 115200 # Receive (open another terminal) com_recv /dev/ttyS2 115200 </code> **Read/write nodes directly** <code bash> stty -F /dev/ttyS2 115200 cs8 -cstopb -parenb echo "hello" > /dev/ttyS2 # Send cat /dev/ttyS2 # Receive </code> **Test method** For loopback, peer-to-peer and adapter wiring, see **4.5.2**; these are OS-independent and are not repeated in this section. **Precautions** - The unit uses a 2.5mm 3P pluggable terminal (no DB9); use with crimp terminals or an adapter cable; reversing the wire order (A / B, R / T) will directly cause communication failure - RS485 is half-duplex; direction is switched automatically by hardware, so observe the frame interval when switching between transmit and receive - If permission is denied, add the current user to the dialout group: sudo usermod -aG dialout $USER (takes effect after re-login) ==== 5.4 GPIO Usage (sysfs) ==== On Linux, access is unified through /sys/class/gpio. For terminal pin assignment rules and system GPIO numbers, see **2.3**; this section only provides the operation commands. **1. Check whether the relevant IO is exported** <code bash> cd /sys/class/gpio ls </code> **2. Configure GPO (system configuration)** <code bash> for i in {95,94,21,22,140,141}; do echo out >gpio$i/direction; done for i in {13,14,96,93,108,107}; do echo out >gpio$i/direction; done </code> **3. Set GPO high / low** Output high level: <code bash> for i in {95,94,21,22,140,141}; do echo 1 >gpio$i/value; done for i in {13,14,96,93,108,107}; do echo 1 >gpio$i/value; done </code> Read back the current level: <code bash> for i in {95,94,21,22,140,141}; do cat /sys/class/gpio/gpio$i/value; done </code> Output low level: <code bash> for i in {95,94,21,22,140,141}; do echo 0 >gpio$i/value; done for i in {13,14,96,93,108,107}; do echo 0 >gpio$i/value; done </code> **4. Configure GPI (system configuration)** <code bash> for i in {13,14,96,93,108,107}; do echo in >gpio$i/direction; done </code> **5. Get GPI value** <code bash> for i in {13,14,96,93,108,107}; do cat /sys/class/gpio/gpio$i/value; done for i in {95,94,21,22,140,141,13,14,96,93,108,107}; do cat /sys/class/gpio/gpio$i/direction; done </code> **Note:** GPIO numbers follow the kernel's global gpiochip numbering and may shift as a whole across firmware versions; if the corresponding node does not exist under /sys/class/gpio, first run echo NUMBER > /sys/class/gpio/export to export it, then proceed. ==== 5.5 USB and SD Card Mounting ==== **USB drive detection** <code bash> dmesg | tail -20 # After insertion, kernel messages show the device name sda / sda1 lsblk # List block devices and mount points </code> **Mount and unmount** <code bash> mkdir -p /mnt/USB1 mount /dev/sda1 /mnt/USB1 df -h umount /mnt/USB1 </code> **SD Card** <code bash> fdisk -l # SD card device name is usually /dev/mmcblk1p1 mount /dev/mmcblk1p1 /mnt/sdcard umount /mnt/sdcard </code> **Note:** ext4 / vfat can be mounted directly; NTFS requires ntfs-3g, exFAT requires exfat-fuse. See 4.6 for how to view the drives on Android. ==== 5.6 Resolution and HDMI ==== The internal screen resolution is fixed by the model (see 1.3 Model and Configuration); HDMI external output can be adjusted with xrandr. **X11 desktop** <code bash> xrandr # List outputs and available modes xrandr --output HDMI-1 --mode 1920x1080 --rate 60 xrandr -o left # Rotate left 90° xrandr -o right # Rotate right 90° xrandr -o inverted # Flip 180° xrandr -o normal # Restore </code> **Temporarily add a custom resolution** <code bash> cvt 800 750 # 800x750 59.86 Hz (CVT) ... Modeline "800x750_60.00" 48.50 800 840 920 1040 750 753 763 779 -hsync +vsync xrandr --newmode "800x750_60.00" 48.50 800 840 920 1040 750 753 763 779 -hsync +vsync xrandr --addmode HDMI-1 800x750_60.00 xrandr --output HDMI-1 --mode 800x750_60.00 </code> **Wayland / Weston (when using a Wayland session)** Ubuntu 20.04 uses Xorg by default, so the xrandr method applies; if you switch to a Wayland session, xrandr is not supported under Wayland — edit /etc/xdg/weston/weston.ini: <code bash> [output] name=HDMI-A-1 mode=1920x1080 </code> Reboot the system or restart the weston service for the changes to take effect. **Dual display mode** For the definitions of the clone (mirror) and extended modes, see **4.8**. On Linux, use the desktop display settings or xrandr to control the on/off and position of the two outputs. ==== 5.7 Remote Access and File Transfer ==== <code bash> sudo apt update && sudo apt install -y openssh-server sudo systemctl enable --now ssh ip addr show </code> Transfer from a PC: <code bash> scp ./update.img root@192.168.8.55:/home/root/ </code> Graphical tools: WinSCP / FileZilla, protocol SFTP, port 22. ==== 5.8 Auto-run Programs at Boot ==== There are three methods, grouped by startup timing; choose as needed, and the methods can be combined: **before login → at login → after entering the graphical interface**. Place the same program in only one of them. === 5.8.1 Execute Before Login === Suitable for background services that do not depend on the desktop and must run at boot. - Edit the /etc/rc.local file - Add the program call before exit 0 - Save and exit (press Esc, type :wq and press Enter) <code bash> sudo vim /etc/rc.local # Add before exit 0 /path/to/myprogram & exit 0 </code> **Note:** /path/to/myprogram is the full program path; the trailing & runs the program in the background; otherwise, it blocks the subsequent login process. The last line of the file must be exit 0 for the script to be executed. **Note:** Ubuntu 20.04 does not enable /etc/rc.local by default; make sure rc-local.service is enabled. For systemd-only setups, use a custom service or the startup script in 5.8.3 instead. === 5.8.2 Execute After Login === It applies only to the current user and runs once the user has logged in. - Edit the user profile file ~/.profile - Append the startup command at the end of the file - Save and exit - Run source ~/.profile to apply the changes immediately <code bash> vim ~/.profile # Append at the end of the file /path/to/myprogram & source ~/.profile </code> **Note:** ~/.profile applies only to the current user; to apply to all users, use /etc/profile instead. === 5.8.3 Execute After Entering the Graphical Interface === Use this for applications that need to display a UI only after the desktop is up (e.g. a full-screen main program). **Debian (LXDE)** - Edit the autostart file - Append the startup command at the end - Save and exit; reboot or re-login for the changes to take effect <code bash> vim /root/.config/lxsession/LXDE/autostart # Append at the end /path/to/myprogram > /dev/null 2>&1 & </code> **Ubuntu** On Ubuntu, this is handled uniformly by a startup script; write the command into /nodka_test/autorun.sh (this script runs automatically after the desktop starts). <code bash> sudo vim /nodka_test/autorun.sh # Append at the end /path/to/myprogram > /dev/null 2>&1 & </code> **Note:** > /dev/null 2>&1 discards program output to avoid filling the partition with logs; & ensures background execution. ==== 5.9 UI and Display Customization ==== === 5.9.1 Status Bar Customization === The LXDE panel (taskbar / menu bar) configuration is stored in: <code> $HOME/.config/lxpanel/LXDE/panels/panel </code> Open it with a text editor to add/remove plugins and adjust position and size; after editing, run lxpanelctl restart or log in again for the changes to take effect. === 5.9.2 Disable the Desktop Environment === Default contents of the desktop autostart file /root/.config/lxsession/LXDE/autostart: <code> @lxpanel --profile LXDE @pcmanfm --desktop --profile LXDE @xscreensaver -no-splash pulseaudio -D /nodka_test/autorun.sh </code> ^ Line ^ Function ^ | @lxpanel --profile LXDE | Start the LXDE panel (taskbar and menu) | | @pcmanfm --desktop --profile LXDE | Let PCManFM manage the desktop, handling wallpaper and icons | | @xscreensaver -no-splash | Screen saver | | pulseaudio -D | Start the audio service | | /nodka_test/autorun.sh | Autostart script executed after the desktop is up | To disable the desktop and show only the application UI, simply comment out the first three lines: <code> #@lxpanel --profile LXDE #@pcmanfm --desktop --profile LXDE #@xscreensaver -no-splash pulseaudio -D /nodka_test/autorun.sh </code> **Note:** After commenting out the panel and PCManFM, the desktop has no taskbar and no wallpaper icons, showing only the autostart program window; this is suitable for units shipped with a full-screen application. === 5.9.3 Replace the Boot LOGO === The boot LOGO is stored in the resource partition. Execute steps ① ~ ⑥ in order in the Linux terminal on the unit (root privileges required): for steps requiring commands, the description corresponds to the code block immediately following; see the table below for the file location in step ④. **① Prepare the BMP image** Prepare a BMP image and set its size to the screen resolution (e.g. HDMI 1920×1080). **② Copy the bmpconvert tool and grant execute permission** {{wiki:bmpconvert.zip|Download the bmpconvert conversion tool (2.3 KB, unzip to get the script)}}. Then unzip the tool and copy it to /usr/bin: <code bash> sudo cp bmpconvert /usr/bin/ sudo chmod +x /usr/bin/bmpconvert </code> **③ Mount the resource partition** <code bash> sudo mount /dev/block/by-name/resource /mnt </code> **④ Place the boot LOGO file** Place the BMP image into /mnt with the file name corresponding to the screen type: ^ Screen Type ^ File Location ^ | HDMI / eDP / LVDS | /mnt/logo.bmp, /mnt/logo_kernel.bmp | | MIPI | /mnt/logo_mipi.bmp, /mnt/logo_kernel_mipi.bmp | **⑤ Convert Images with bmpconvert** For HDMI / eDP / LVDS screens, run: <code bash> sudo bmpconvert /mnt/logo.bmp sudo bmpconvert /mnt/logo_kernel.bmp </code> For MIPI screens, use the corresponding file name instead: <code bash> sudo bmpconvert /mnt/logo_mipi.bmp sudo bmpconvert /mnt/logo_kernel_mipi.bmp </code> **Error handling:** If step ⑤ produces the following output, the system only has python3 and lacks the python command: <code> root@rk3568: bmpconvert /mnt/logo.bmp /usr/bin/env: 'python': No such file or directory root@rk3568: bmpconvert /mnt/logo_kernel.bmp /usr/bin/env: 'python': No such file or directory </code> Create the python symlink first, then rerun the two commands in step ⑤: <code bash> sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 sudo bmpconvert /mnt/logo.bmp sudo bmpconvert /mnt/logo_kernel.bmp </code> **⑥ Reboot the system** <code bash> sudo reboot </code> **Note:** logo.bmp is displayed during the U-Boot stage and logo_kernel.bmp during the kernel boot stage; replace both. Back up the original files under /mnt before making changes. === 5.9.4 Switching Between Different LCD Displays === **HDMI**: Supported by default; default output 1920×1080, no configuration needed. **eDP / LVDS**: The display parameters must match the panel. Run dis in the terminal to open the display settings interface, select the matching parameters and click Save; reboot to apply. <code bash> dis </code> {{wiki:cm_lcd_sml.png?620}} Display Settings interface: Select parameters matching the panel and click Save. === 5.9.5 Screen Rotation === **Debian: Modify the Xorg Configuration** - First use xrandr to check the screen node name (e.g. eDP-1, HDMI-1) - Edit /etc/X11/xorg.conf.d/20-modesetting.conf - Change the Option "Rotate" value and reboot <code> Section "Monitor" Identifier "eDP-1" # Screen node name, query with xrandr Option "Rotate" "inverted" # Rotation direction, see the table below EndSection </code> ^ Value ^ Rotation Angle ^ | normal | 0° (default) | | right | 90° clockwise | | inverted | 180° clockwise | | left | 270° clockwise | **Ubuntu: Use xrandr** <code bash> xrandr --output HDMI-1 --rotate left # Rotate left 90° xrandr --output HDMI-1 --rotate right # Rotate right 90° xrandr --output HDMI-1 --rotate inverted # Rotate 180° xrandr --output HDMI-1 --rotate normal # Restore default </code> **Note:** Add the rotation command to the end of /nodka_test/autorun.sh to apply it automatically at boot. **Touch Rotation** After screen rotation, touch coordinates will be misaligned; modify CalibrationMatrix in /usr/share/X11/xorg.conf.d/40-libinput.conf accordingly: <code> Section "InputClass" Identifier "libinput touchscreen catchall" Option "CalibrationMatrix" "-1 0 1 0 -1 1 0 0 1" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "libinput" EndSection </code> ^ Screen Orientation ^ CalibrationMatrix ^ | 0° (default) | 1 0 0 0 1 0 0 0 1 | | 90° (clockwise) | 0 1 0 -1 0 1 0 0 1 | | 180° (upside down) | -1 0 1 0 -1 1 0 0 1 | | 270° (90° counterclockwise) | 0 -1 1 1 0 0 0 0 1 | ==== 5.10 OTA Firmware Update ==== === 5.10.1 OTA over Network === The upgrade is performed by the on-board /usr/bin/ota script. Edit the script as needed, set the FTP address and account, place the corresponding firmware at the FTP download location, then run ota. The files to modify and the corresponding code are as follows. **① Edit the upgrade script /usr/bin/ota** <code bash> sudo vim /usr/bin/ota </code> **② Set the following three items in the script** <code> URL=ftp://<firmware server address> USERNAME=<username> PASSWORD=<password> </code> **③ Save and run the upgrade** <code bash> ota </code> Follow the prompts to complete the upgrade. **Note:** The server address, account and firmware directory are provided by us; do not power off during the upgrade; the device reboots automatically when complete. === 5.10.2 OTA Update via USB Drive === Under Linux, the on-board /usr/bin/ota script performs the OTA update, with the USB drive as temporary firmware storage. Follow steps ① ~ ⑤ in order: for steps requiring commands, the description corresponds one-to-one with the code block immediately following it; ③④ are condition checks and require no commands. **① Unmount the USB drive** <code bash> sudo umount /dev/sdb </code> **② Format the USB drive as ext4** <code bash> sudo mkfs.ext4 /dev/sdb </code> **③ Confirm the system supports OTA update** The board must already have the /usr/bin/ota script (see 5.10.1 for script configuration). **④ Confirm USB drive specifications** The USB drive must be formatted as Linux ext4 with more than 8G of free space; otherwise the upgrade package cannot be written. **⑤ Plug in the network cable and USB drive, then run the upgrade** <code bash> ota </code> Follow the prompts to complete the upgrade; do not power off during the process; the device reboots automatically when complete. **Note:** /dev/sdb is a common device node for USB drives; the actual node depends on the lsblk output. This section describes the Linux OTA update (ext4, ≥8G, ota command); it is a separate process from the Android USB drive upgrade in 3.4 (FAT32, update.img) and the Android OTA update in 3.4.4; do not mix them. ==== 5.11 Cross-Compilation Environment ==== === 5.11.1 Install the Cross-Compilation Environment via apt === On a Debian / Ubuntu host, a single command installs the aarch64 cross toolchain; then confirm the version with -v: <code bash> sudo apt install -y crossbuild-essential-arm64 aarch64-linux-gnu-gcc -v </code> === 5.11.2 Download a Specific Toolchain Version === For a specific version, download the corresponding toolchain from ARM (developer.arm.com/downloads/-/gnu-a), extract it, then add the bin directory to PATH: <code bash> export PATH=$PATH:/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin/ aarch64-none-linux-gnu-gcc --version </code> **Note:** Write it to ~/.bashrc or /etc/profile to make it permanent; replace the path with the actual extraction directory. === 5.11.3 Toolchain Downloads === Common cross-compilation toolchains and how to obtain them: * **aarch64-linux-gnu-gcc cross toolchain**: Provided in the SDK prebuilts directory * **arm-linux-gnueabihf cross toolchain**: For compiling 32-bit user-space programs * **x86 host arm64 cross-compilation toolchain**: Released by ARM, for compiling aarch64 (arm64) programs on an x86_64 host **Download:** [[https://pan.baidu.com/s/1OjJVuzDB3hFMgO6yS3EAZw|gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz]] — Baidu Netdisk, <html><span class="sml-code">extraction code hkku</span></html> **Note:** This toolchain requires no installation; extract it and add the bin directory inside the archive to PATH; call aarch64-none-linux-gnu-gcc when compiling. ==== 5.12 Qt Application Development ==== Preinstalled environments: **Debian 11 → Qt 5.15.2**, **Ubuntu 20.04 → Qt 5.12.8**. Choose between the two methods as applicable. === 5.12.1 Import a Docker Image for Compilation === Use a ready-made build image; the host does not need Qt installed, isolation is good, and it suits batch compilation. **Download:** [[ftp://drv.nodka.com/arm_download/nodka_docker_qt_build_20230223.tar|nodka_docker_qt_build_20230223.tar]] — company FTP (drv.nodka.com) - Import the image - Start the container and mount the application directory to /mnt (replace source with the actual path) - Inside the container, enter /mnt and run qmake and make <code bash> sudo docker load < nodka_docker_qt_build_20230223.tar sudo docker run --rm --mount type=bind,source=/home/APP_PATH,target=/mnt/ -i -t 09a37c1b2fc3 /bin/bash cd /mnt qmake make </code> **Note:** The image is large; after import the image and the original tar each take a copy, so reserve at least 10 GB of free disk. Chrome / Edge no longer open ftp links directly — use Windows Explorer, FileZilla or a download manager instead. The container ID (09a37c1b2fc3) is taken from the actual docker images output. === 5.12.2 Set Up the Qt Build Environment on the Board === **1. Install Qt Creator** <code bash> sudo apt-get install qtcreator sudo apt-get install qt5-default </code> If qt5-default has been removed from the official repository, use the following set of dependencies instead: <code bash> sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtcreator </code> **2. Add qmake** Qt Creator → Tools → Options → Kits → Qt Versions → Add, select the on-board qmake: <code> /usr/local/qt5.12-arm/bin/qmake </code> {{wiki:qt_set_qmake.png?620}} Add the on-board qmake path in Qt Versions. **3. Configure the Cross-Compiler** In the same window, switch to Compilers → Add → GCC and add g++ and gcc respectively: <code> g++: /usr/bin/aarch64-linux-gnu-g++ gcc: /usr/bin/aarch64-linux-gnu-gcc </code> g++ compiler location: {{wiki:qt_set_compiler_gpp.png?620}} gcc compiler location: {{wiki:qt_set_compiler_gcc.png?620}} Add the cross-compiler; when the host has crossbuild-essential-arm64 installed, the compiler is under /usr/bin; with a third-party toolchain, enter its installation path. **4. Configure the Debugger (optional, for online debugging)** <code bash> sudo apt install -y gdb-multiarch </code> The board must have /usr/bin/gdbserver; if not, install gdbserver (included in Buildroot, no installation needed). Add /usr/bin/gdb-multiarch in Debuggers in Qt Creator. {{wiki:qt_set_debugger.png?620}} **5. Configure Devices** Enter the board IP and username root; set a static IP for the board to avoid disconnections during debugging. {{wiki:qt_set_device.png?620}} **6. Configure Kits** Combine the Qt version, compiler, debugger and device above into one Kit. When the target system is Ubuntu, also fill in the sysroot path in the Kit. {{wiki:qt_set_kits_std.png?620}} In Kits, combine the Qt version, compiler, debugger and device. ==== 5.13 Video Hardware Codec Support ==== The on-board VPU supports H.264 / H.265 hardware encoding and decoding; the system ships with GStreamer plugins and OpenGL ES / OpenCL runtime libraries. **GStreamer Encoding/Decoding** The system includes test scripts; run them directly to verify hardware decoding and encoding: <code bash> /rockchip-test/video/test_dec-gst.sh # Hardware decode test /rockchip-test/video/test_enc-gst.sh # Hardware encode test </code> **OpenGL ES** Use glmark2 to benchmark and verify the GPU: <code bash> glmark2-es2 </code> **WebGL** Open Chromium, enter the following address in the address bar, and check WebGL and hardware acceleration status: <code> chrome://gpu </code> **OpenCL** <code bash> clinfo </code> {{wiki:cm_clinfo.png?620}} clinfo output: confirm platform, device and OpenCL version information. ===== 6 General Methods ===== This chapter covers query commands, which are basically the same under Android (adb shell) and in the Linux terminal; differences are noted in individual entries where applicable. ==== 6.1 Check CPU Temperature ==== <code bash> cat /sys/class/thermal/thermal_zone0/temp # Output is in millidegrees Celsius; 45200 means 45.2℃ </code> ==== 6.2 Check the CPU Serial Number ==== <code bash> cat /proc/device-tree/serial-number # On Android getprop ro.serialno </code> ==== 6.3 Check CPU Frequency ==== <code bash> cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies </code> ==== 6.4 Check Memory Capacity ==== <code bash> free -h cat /proc/meminfo | head -3 </code> ==== 6.5 Check Storage Capacity ==== <code bash> df -h lsblk </code> ==== 6.6 Network Ping Test ==== <code bash> ping -c 4 192.168.8.1 ping -c 4 www.baidu.com ping -c 1 -W 1 8.8.8.8 </code> ==== 6.7 Set System Time and Save to the RTC Chip ==== <code bash> # Check the system time date # Set the system time and write it to the RTC chip sudo date -s "2025-04-08 17:01:01" sudo hwclock -w sudo hwclock -r </code> **Verification**: Power off and disconnect power for more than 5 seconds, then power on and use date to check whether the time is retained. **Note:** Network time synchronization is enabled by default; perform the RTC test with the external network disconnected. **Time Zone Settings** <code bash> ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime reboot </code> In the GUI, select the time zone under "Preferences → Time and Date"; to set another time zone, replace Asia/Shanghai in the command with the corresponding city. ===== 7 Appendix ===== ==== 7.1 FAQ Troubleshooting ==== ^ Symptom ^ Possible Cause ^ Solution ^ | The flashing tool keeps showing "No device found" | Not in Loader mode / USB driver error / cable issue | Follow step ④ in 3.3 to re-enter Loader mode; uninstall and reinstall the driver; change the USB port and data cable | | Unknown device appears in Device Manager | Rockchip USB driver not installed properly | See 3.2; reinstall DriverInstall | | ADB cannot connect | USB debugging not enabled / wrong USB port | See 4.1; confirm connection to the blue USB3.0 lower port | | The serial port cannot be opened or returns no data | Wrong node / no permission / A-B or R-T reversed | See 4.5, 5.3; check the node and wiring against the silkscreen label | | GPIO read/write no response | Not exported / numbering offset varies with firmware | See 2.3, 5.4; export first, then operate | | Touch not responding or coordinates misaligned | Loose touch USB cable / CalibrationMatrix not updated after rotation | See 4.10, 5.9.5 | | After screen rotation the UI is normal but touch is reversed | libinput calibration matrix not updated | See the touch rotation table in 5.9.5 | | Boot LOGO not applied | Only one of the images replaced / bmpconvert not run | See 5.9.3; replace and convert both logo images | | Static IP configuration not effective | NetworkManager and ifupdown coexist | See the note in 5.2.1 | | No prompt during USB drive upgrade | File name is not update.img / format is not FAT32 | See 3.4.2; rename and reformat as FAT32 | ==== 7.2 Document Information and Revision History ==== ^ Item ^ Content ^ | Applicable Products | sBOX-R13 (RK3568 single platform) | | Main Control Platform | Rockchip RK3568 (4 × Cortex-A55 @2.0GHz, 1 TOPS NPU) | | Applicable Systems | Android 11, Ubuntu 22.04 | | Document Version | v1.0 | | Update Date | 2026-11-14 | ^ Version ^ Date ^ Revision Details ^ | v1.0 | 2026-11-14 | First release: product specifications, interface definitions and mechanical dimensions per the sBOX-R13 datasheet v1.0 (2026-06-18); platform chapters follow the RK3568 manual | For previous versions, contact Technical Support. ==== 7.3 Technical Support ==== * Firmware, flashing tools, SDK and specifications: contact Sales or Technical Support * When reporting an issue, provide: unit SN (see 6.2 for how to view it), system version, reproduction steps and screenshots * If an exception occurs after modifying the system yourself, reflash the factory firmware first (see 3.3) before deciding whether it is a hardware issue ==== 7.4 Development Resources ==== Datasheets, drivers, SDK, firmware and flashing tools are maintained per model; contact Sales or Technical Support to obtain them. **Note:** Flashing, ADB, serial and GPIO procedures are described in chapters 3–7 of this page; for interface count and location see 2.2. <html><style> #pt-lang{padding:0 10px 0 6px;white-space:nowrap;line-height:1.2;} #pt-lang label{font-size:11px;color:#54595d;margin-right:5px;vertical-align:middle;} #sml-lang{font-size:11px;padding:2px 4px;border:1px solid #c8ccd1;border-radius:3px;background:#fff;color:#202122;vertical-align:middle;cursor:pointer;max-width:112px;} #sml-lang:focus{outline:2px solid #36c;outline-offset:1px;} </style></html> <html><script> (function(){ /* 中英页面配对表:新增产品时在两处(中文页ID / 英文页ID)各加一行,四份脚本保持一致 */ var PAIR={ '首页':'en:home', 'arm触控一体机:sbox-r13系列':'en:sbox-r13', 'arm触控一体机:sbox-r10系列':'en:sbox-r10', 'arm触控一体机:stpc-sxxx-3568b系列':'en:stpc-exxx-3568b', 'arm触控一体机:stpc-exxx-c系列':'en:stpc-exxx-c', 'arm触控一体机:stpc-exxx-3568b系列':'en:stpc-sxxx-3568b' }; var UI={ '更新个人信息':'Preferences','个人设置':'Preferences','我的讨论':'My talk', '显示源文件':'Show source','创建该页面':'Create this page', '该主题尚不存在':'This topic does not yet exist', '您访问的页面并不存在。':'This page does not exist yet.', '用于Dokuwiki的vector主题':'Vector template for DokuWiki', '可打印版本':'Printable version','打印/导出':'Print / export', '最近更改':'Recent changes','媒体管理器':'Media manager', '网站地图':'Sitemap','永久链接':'Permanent link','引用此文':'Cite this page', '搜索这个文本':'Search this text','您的足迹:':'You are here:', '最后更改:':'Last modified:','修订记录':'History', '登录':'Log in','登出':'Log out','退出':'Log out','管理':'Admin', '文章':'Page','讨论':'Discussion','阅读':'Read','编辑':'Edit', '导航':'Navigation','首页':'Home','帮助':'Help','联系我们':'Contact us', '工具':'Tools','搜索':'Search',' 由 ':' by ' }; var TITLE={'en:home':'Home','en:sbox-r13':'sBOX-R13 Series','en:sbox-r10':'sBOX-R10 Series','en:stpc-exxx-3568b':'sTPC-EXXX-3568B Series','en:stpc-exxx-c':'sTPC-EXXX-C Series','en:stpc-sxxx-3568b':'sTPC-SXXX-3568B Series'}; var CUR=(window.JSINFO&&JSINFO.id)||''; var ZH='',EN='',HERE=''; for(var k in PAIR){ if(CUR===k){ZH=k;EN=PAIR[k];HERE='zh';break;} if(CUR===PAIR[k]){ZH=k;EN=CUR;HERE='en';break;} } if(!HERE) return; /* 语言偏好只在本标签页内记忆:新开标签、重新进入一律回到中文,避免“上次选了 English,下次进来还是英文” */ function pref(){try{return sessionStorage.getItem('sml_lang')||'zh';}catch(e){return 'zh';}} function setPref(v){try{sessionStorage.setItem('sml_lang',v);}catch(e){}} /* 清掉旧版本写下的持久偏好,老访客不再被自动导向英文 */ try{localStorage.removeItem('sml_lang');}catch(e){} function url(id){return '/dokuwiki/doku.php?id='+encodeURIComponent(id);} /* 仅在同一标签页内选过 English 时才接续到英文页;首次进入默认中文,不跳转 */ (function(){ if(HERE!=='zh'||pref()!=='en') return; if(location.search.indexOf('sml=1')>-1) return; location.replace(url(EN)+'&sml=1'); })(); function translate(root){ var keys=Object.keys(UI).sort(function(a,b){return b.length-a.length;}); var w=document.createTreeWalker(root,NodeFilter.SHOW_TEXT,null,false),n,buf=[]; while(n=w.nextNode()){ if(!n.nodeValue||!n.nodeValue.trim()) continue; var p=n.parentNode; if(p&&(p.nodeName==='SCRIPT'||p.nodeName==='STYLE'||p.nodeName==='OPTION')) continue; buf.push(n); } for(var i=0;i<buf.length;i++){ var v=buf[i].nodeValue,o=v; for(var j=0;j<keys.length;j++) v=v.split(keys[j]).join(UI[keys[j]]); if(v!==o) buf[i].nodeValue=v; } var els=root.querySelectorAll('[title],[alt],[placeholder]'),attrs=['title','alt','placeholder']; for(var e=0;e<els.length;e++){ for(var a=0;a<attrs.length;a++){ var val=els[e].getAttribute(attrs[a]); if(!val) continue; var nv=val; for(var j2=0;j2<keys.length;j2++) nv=nv.split(keys[j2]).join(UI[keys[j2]]); if(nv!==val) els[e].setAttribute(attrs[a],nv); } } } function boot(){ /* 旧英文入口 Main_En 已停用:从左侧导航移除本项及其换行 */ (function(){ var box=document.getElementById('p-navigation'); if(!box) return; var as=box.getElementsByTagName('a'); for(var i=as.length-1;i>=0;i--){ var a=as[i], h=a.getAttribute('href')||''; if(!/main_en/i.test(h) && a.textContent.trim()!=='Main_En') continue; var p=a.parentNode; if(!p) continue; var n=a.nextSibling; while(n && n.nodeType===3 && !String(n.nodeValue).trim()){var t=n;n=n.nextSibling;p.removeChild(t);} if(n && n.nodeName==='BR') p.removeChild(n); p.removeChild(a); } })(); if(HERE==='en'||pref()==='en'){ var sels=['#head','#panel','.catlinks','#footer']; for(var i=0;i<sels.length;i++){ var el=document.querySelector(sels[i]); if(el) translate(el); } var th=document.querySelector('#dw__toc h3'); if(th){ var w=document.createTreeWalker(th,NodeFilter.SHOW_TEXT,null,false),n; while(n=w.nextNode()) n.nodeValue=n.nodeValue.split('目录').join('Contents'); } document.documentElement.setAttribute('lang','en'); document.documentElement.setAttribute('xml:lang','en'); if(TITLE[CUR]) document.title=document.title.replace(CUR,TITLE[CUR]); } var ul=document.querySelector('#p-personal > ul'); if(!ul||document.getElementById('pt-lang')) return; var li=document.createElement('li'); li.id='pt-lang'; var lab=document.createElement('label'); lab.htmlFor='sml-lang'; lab.textContent=(HERE==='en'||pref()==='en')?'Language':'语言'; var sel=document.createElement('select'); sel.id='sml-lang'; sel.setAttribute('aria-label',(HERE==='en'||pref()==='en')?'Language':'语言'); var o1=document.createElement('option'); o1.value='zh'; o1.textContent='简体中文'; var o2=document.createElement('option'); o2.value='en'; o2.textContent='English'; sel.appendChild(o1); sel.appendChild(o2); sel.value=(HERE==='en')?'en':pref(); li.appendChild(lab); li.appendChild(sel); ul.appendChild(li); sel.addEventListener('change',function(){ var v=this.value; setPref(v); var t=(v==='en')?EN:ZH; if(t&&t!==CUR) location.href=url(t); else location.reload(); }); } if(document.readyState==='loading') document.addEventListener('DOMContentLoaded',boot); else boot(); })(); </script></html> <html><style> /* ===== 手机/窄屏布局修正(<=820px)===== */ @media (max-width:820px){ /* 结构顺序:模板里 head/panel 排在正文之后,用 flex order 提到最前 */ #page-container{display:flex!important;flex-direction:column;} #page-base,#head-base{display:none!important;} #head{order:-30!important;} #panel{order:-20!important;} #content{order:0!important;} #footer{order:10!important;} /* 顶部:不再绝对定位,个人工具 / 页签 / 搜索依次竖排 */ #head{position:static!important;width:auto!important;padding:6px 12px 8px!important;background:#fff!important;} #p-personal{position:static!important;margin:0!important;text-align:right;} #p-personal ul{display:flex!important;justify-content:flex-end;flex-wrap:wrap;gap:0 12px;float:none!important;} #p-personal li{float:none!important;margin:4px 0!important;} #left-navigation{position:static!important;left:auto!important;top:auto!important;margin:6px 0 0!important;display:block!important;} #right-navigation{float:none!important;margin:4px 0 0!important;display:block!important;overflow:hidden;} div.vectorTabs{float:none!important;display:block!important;background:none!important;padding:0!important;} div.vectorTabs ul{display:flex!important;flex-wrap:wrap!important;float:none!important;margin:0!important;} div.vectorTabs ul li{float:none!important;} div.vectorTabs ul{background:none!important;border:0!important;gap:6px;} div.vectorTabs ul li{background:none!important;border:0!important;} div.vectorTabs ul li a{font-size:12px!important;height:auto!important;padding:5px 10px!important;line-height:1.5!important; border:1px solid #dbe3ec!important;border-radius:4px;color:#0645ad!important;background:#fff!important;text-decoration:none!important;display:inline-block;} div.vectorTabs ul li.selected a{background:#eaf3ff!important;border-color:#8fb2d6!important;color:#0b5394!important;} #p-search{float:none!important;margin:8px 0 4px!important;} #p-search form{margin:0!important;} div#simpleSearch{width:100%!important;box-sizing:border-box;margin:0!important;height:38px!important;} #searchInput{width:100%!important;box-sizing:border-box;height:34px!important;font-size:14px!important;} #p-search input[type=submit],#p-search button{height:34px!important;} /* 左侧栏:改为顶部横向入口条,隐藏 logo 图 */ #panel{position:static!important;top:auto!important;width:auto!important;padding:8px 12px 4px!important;background:#f6f8fa!important;border-bottom:1px solid #c8ccd1;} #p-logo{display:none!important;} #p-namespaces,#panel #p-coll-print_export{display:none!important;} div#panel div.portal{display:flex!important;flex-wrap:wrap;align-items:baseline;gap:0 6px;padding:0 0 3px!important;border:0!important;} div#panel div.portal h5{padding:0!important;margin:0!important;font-size:11px!important;letter-spacing:.4px; border:0!important;flex:0 0 auto;line-height:1.9;color:#54595d!important;} div#panel div.portal .body{flex:1 1 auto;min-width:0;} #panel .body ul{display:flex!important;flex-wrap:wrap;gap:2px 14px;margin:0!important;padding:0!important;list-style:none;float:none!important;} #panel .body li{float:none!important;display:inline-block;margin:0!important;} #panel .body p{margin:0!important;line-height:1.9;} #panel .body p br{display:none!important;} #panel .body p a{display:inline-block;margin:2px 14px 2px 0;} #panel .body a{font-size:12px!important;} /* 正文:去掉左侧留白,占满屏宽 */ #content{margin-left:0!important;padding:12px 12px 30px!important;width:auto!important;box-sizing:border-box;} #bodyContent{width:auto!important;max-width:none!important;font-size:14px!important;line-height:1.75;} #bodyContent h1{font-size:20px!important;line-height:1.35;} #bodyContent h2{font-size:17px!important;} #bodyContent h3{font-size:15px!important;} #bodyContent img{max-width:100%;height:auto;} /* 代码块:长行折行,避免整页被撑宽 */ #bodyContent pre,#bodyContent div.code,#bodyContent .code,#bodyContent table.code,.syntaxhighlighter{white-space:pre-wrap!important;word-break:break-word;overflow-wrap:anywhere;overflow-x:auto!important;max-width:100%!important;box-sizing:border-box;} /* 表格与滚动容器 */ #bodyContent .sml-tw{width:100%!important;max-width:100%!important;} #bodyContent table.inline{max-width:100%;} /* 宽表自身横向滑动:避免多列表格撑破整页(含 include 插件内的表) */ #bodyContent table.inline{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;box-sizing:border-box;} #footer{margin-left:0!important;padding:8px 12px 20px!important;} /* 目录:整块占满,标题左对齐 */ #smltoc{display:block!important;width:100%!important;box-sizing:border-box;margin:0 0 1.2em!important;padding:10px 12px!important;overflow-x:auto;-webkit-overflow-scrolling:touch;} #smltoc .hd{text-align:left!important;} } @media (max-width:520px){ /* 图库:小屏收起角标,缩略图改为纯图四格 */ .sml-g-badge{display:none!important;} .sml-g-cap{left:8px!important;bottom:6px!important;font-size:10px!important;max-width:calc(100% - 86px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .sml-g-count{right:8px!important;bottom:7px!important;font-size:9px!important;} button.sml-g-thumb{padding:3px!important;gap:0!important;} .sml-g-tx{display:none!important;} .sml-g-tn{flex:1 1 auto!important;width:auto!important;height:42px!important;} .sml-g-spec{padding:6px 9px 7px!important;} /* 2.1 图版:小屏改单列,图片放到最大 */ #bodyContent .sml-spec.sml-figgrid table.inline tr{display:block;border:0!important;} #bodyContent .sml-spec.sml-figgrid table.inline th{display:none!important;} #bodyContent .sml-spec.sml-figgrid table.inline td{display:block;width:100%!important;box-sizing:border-box;} #bodyContent .sml-spec.sml-figgrid img.media{width:100%!important;max-width:100%!important;} } </style></html> <html><script> /* sBOX 3D exploded viewer(嵌入版,无外部依赖) 用法:SML3D(hostElement, {url:'...zip', lang:'zh', ...}) */ window.SML3D = (function(){ "use strict"; /* ===== 默认零件表(仅 sTPC-S156-3568B;其它机型由 cfg.parts 传入) ===== */ var PARTS_S156 = [ /* 0 */ {n:'机身中框', e:'Mid Frame', col:'#b8c2cd', k:0.00, d:[0,0,0]}, /* 1 */ {n:'视窗玻璃', e:'Front Glass', col:'#1e2a36', k:1.55, d:[0,0,1]}, /* 2 */ {n:'显示模组', e:'Display Module', col:'#3f4d5c', k:1.05, d:[0,0,1]}, /* 3 */ {n:'后盖', e:'Rear Cover', col:'#d4dae1', k:1.45, d:[0,0,-1]}, /* 4 */ {n:'主板载板', e:'Carrier Board', col:'#2f6f59', k:0.55, d:[0,0,1]}, /* 5 */ {n:'屏线组件', e:'Panel Cable', col:'#c9a227', k:0.55, d:[0,0,1]}, /* 6 */ {n:'天线/顶条', e:'Antenna Bar', col:'#7b5ea7', k:0.60, d:[0,0,-1]}, /* 7 */ {n:'固定卡扣', e:'Clip', col:'#8e99a6', k:0.30, d:[0,0,-1]}, /* 8 */ {n:'固定卡扣', e:'Clip', col:'#8e99a6', k:0.30, d:[0,0,-1]}, /* 9 */ {n:'紧固件', e:'Fastener', col:'#8e99a6', k:0.30, d:[0,0,-1]}, /*10 */ {n:'下侧接口座', e:'I/O Block', col:'#a45a52', k:0.45, d:[0,0,-1]}, /*11 */ {n:'接地弹片', e:'Ground Spring', col:'#9aa4b0', k:0.20, d:[0,0,-1]}, /*12 */ {n:'竖向排线', e:'Vertical FPC', col:'#c9a227', k:0.45, d:[0,0,-1]}, /*13 */ {n:'接地弹片', e:'Ground Spring', col:'#9aa4b0', k:0.20, d:[0,0,-1]}, /*14 */ {n:'喇叭', e:'Speaker', col:'#a45a52', k:0.45, d:[0,0,-1]}, /*15 */ {n:'主板组件', e:'Main Board', col:'#2f6f5c', k:0.75, d:[0,0,-1]}, /*16 */ {n:'前面框', e:'Front Bezel', col:'#cbd3dc', k:1.75, d:[0,0,1]} ]; var REAR_S156 = 3; /* 后盖索引 */ var UI = { zh:{open:'打开上盖', close:'装回上盖', xray:'透视', parts:'零件', front:'前视', back:'后视', side:'侧视', iso:'等轴', reset:'重置', exp:'拆解', hint:'拖拽旋转 · 滚轮缩放 · 点击零件查看', load:'加载 3D 模型', loading:'正在载入 3D 模型…', size:'约 1.3 MB', all:'全部显示', faces:'面数', dim:'尺寸', err:'模型载入失败', sorry:'当前浏览器不支持 WebGL,请用 Chrome / Edge 打开'}, en:{open:'Open lid', close:'Close lid', xray:'X-ray', parts:'Parts', front:'Front', back:'Rear', side:'Side', iso:'Iso', reset:'Reset', exp:'Explode', hint:'Drag to orbit · Scroll to zoom · Click a part', load:'Load 3D model', loading:'Loading 3D model…', size:'about 1.3 MB', all:'Show all', faces:'Faces', dim:'Size', err:'Failed to load model', sorry:'WebGL is not available; please use Chrome or Edge'} }; var CSS = '' + '.v3d{position:absolute;inset:0;overflow:hidden;background:radial-gradient(120% 105% at 50% 0%,#fdfefe 0%,#eaeef3 52%,#d9dfe7 100%);font:400 12px/1.45 "Segoe UI","Microsoft YaHei",sans-serif;}' + '.v3d canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none;}' + '.v3d canvas:active{cursor:grabbing;}' + '.v3d .tbar{position:absolute;left:9px;top:9px;display:flex;gap:5px;flex-wrap:wrap;max-width:calc(100% - 18px);}' + '.v3d .tb{font:inherit;font-size:11.5px;padding:3px 9px;border:1px solid #c6d0da;background:rgba(255,255,255,.94);color:#26313c;border-radius:3px;cursor:pointer;white-space:nowrap;}' + '.v3d .tb:hover{background:#eef6fd;border-color:#84aede;}' + '.v3d .tb.on{background:#0b5394;border-color:#0b5394;color:#fff;}' + '.v3d .tb.hot{border-color:#0b7a75;color:#0b7a75;}' + '.v3d .tb.hot.on{background:#0b7a75;color:#fff;}' + '.v3d .ebar{position:absolute;left:9px;right:9px;bottom:8px;display:flex;align-items:center;gap:8px;padding:5px 9px;background:rgba(255,255,255,.9);border:1px solid #dbe2ea;border-radius:3px;}' + '.v3d .ebar input{flex:1;height:3px;-webkit-appearance:none;appearance:none;background:#cfd8e2;border-radius:2px;outline:none;}' + '.v3d .ebar input::-webkit-slider-thumb{-webkit-appearance:none;width:13px;height:13px;border-radius:50%;background:#0b5394;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.25);}' + '.v3d .ebar .lb{font-size:11px;color:#4a5765;white-space:nowrap;}' + '.v3d .ebar .pv{font-size:11px;color:#0b5394;font-variant-numeric:tabular-nums;min-width:30px;text-align:right;}' + '.v3d .hint{position:absolute;right:9px;bottom:44px;font-size:10.5px;color:#6b7681;background:rgba(255,255,255,.82);padding:2px 7px;border-radius:2px;}' + '.v3d .plist{position:absolute;right:9px;top:44px;width:150px;max-height:calc(100% - 96px);overflow:auto;background:rgba(255,255,255,.96);border:1px solid #cbd4de;border-radius:4px;padding:5px;display:none;box-shadow:0 6px 18px rgba(20,40,60,.14);}' + '.v3d .plist.on{display:block;}' + '.v3d .pi{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:3px;cursor:pointer;font-size:11.5px;color:#26313c;}' + '.v3d .pi:hover{background:#eef6fd;}' + '.v3d .pi.sel{background:#dbeafb;box-shadow:inset 2px 0 0 #0b5394;}' + '.v3d .pi.off{opacity:.36;}' + '.v3d .pi i{width:9px;height:9px;border-radius:2px;flex:0 0 9px;border:1px solid rgba(0,0,0,.2);}' + '.v3d .pi span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}' + '.v3d .tip{position:absolute;padding:5px 9px;background:rgba(23,32,42,.92);color:#fff;font-size:11px;border-radius:3px;pointer-events:none;display:none;max-width:190px;line-height:1.5;}' + '.v3d .tip.on{display:block;}' + '.v3d .tip b{color:#8fc2ff;font-weight:600;}' + '.v3d .cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;background:rgba(255,255,255,.92);}' + '.v3d .cover .b{font:inherit;font-size:12.5px;padding:7px 16px;border:1px solid #0b5394;background:#0b5394;color:#fff;border-radius:3px;cursor:pointer;}' + '.v3d .cover .b:hover{background:#0a4880;}' + '.v3d .cover .s{font-size:11px;color:#78838f;}' + '.v3d .bar{width:150px;height:3px;background:#dde4ec;border-radius:2px;overflow:hidden;}' + '.v3d .bar>i{display:block;height:100%;width:6%;background:#0b5394;transition:width .18s;}'; /* ===== 数学 ===== */ function persp(f,a,n,r){var t=1/Math.tan(f/2),d=1/(n-r);return new Float32Array([t/a,0,0,0,0,t,0,0,0,0,(r+n)*d,-1,0,0,2*r*n*d,0]);} function look(e,c,u){ var zx=e[0]-c[0],zy=e[1]-c[1],zz=e[2]-c[2],zl=Math.hypot(zx,zy,zz)||1;zx/=zl;zy/=zl;zz/=zl; var xx=u[1]*zz-u[2]*zy,xy=u[2]*zx-u[0]*zz,xz=u[0]*zy-u[1]*zx,xl=Math.hypot(xx,xy,xz)||1;xx/=xl;xy/=xl;xz/=xl; var yx=zy*xz-zz*xy,yy=zz*xx-zx*xz,yz=zx*xy-zy*xx; return new Float32Array([xx,yx,zx,0,xy,yy,zy,0,xz,yz,zz,0, -(xx*e[0]+xy*e[1]+xz*e[2]),-(yx*e[0]+yy*e[1]+yz*e[2]),-(zx*e[0]+zy*e[1]+zz*e[2]),1]); } function mmul(a,b){var o=new Float32Array(16);for(var c=0;c<4;c++)for(var r=0;r<4;r++){var s=0;for(var k=0;k<4;k++)s+=a[k*4+r]*b[c*4+k];o[c*4+r]=s;}return o;} function nmat(n){ if(n.matrix)return new Float32Array(n.matrix); var t=n.translation||[0,0,0],q=n.rotation||[0,0,0,1],s=n.scale||[1,1,1]; var x=q[0],y=q[1],z=q[2],w=q[3],x2=x+x,y2=y+y,z2=z+z,xx=x*x2,xy=x*y2,xz=x*z2,yy=y*y2,yz=y*z2,zz=z*z2,wx=w*x2,wy=w*y2,wz=w*z2; return new Float32Array([(1-(yy+zz))*s[0],(xy+wz)*s[0],(xz-wy)*s[0],0,(xy-wz)*s[1],(1-(xx+zz))*s[1],(yz+wx)*s[1],0,(xz+wy)*s[2],(yz-wx)*s[2],(1-(xx+yy))*s[2],0,t[0],t[1],t[2],1]); } function ap(m,v){return [m[0]*v[0]+m[4]*v[1]+m[8]*v[2]+m[12],m[1]*v[0]+m[5]*v[1]+m[9]*v[2]+m[13],m[2]*v[0]+m[6]*v[1]+m[10]*v[2]+m[14]];} function hex(h){return [parseInt(h.slice(1,3),16)/255,parseInt(h.slice(3,5),16)/255,parseInt(h.slice(5,7),16)/255];} /* ===== 载入 ===== */ function unzip(ab){ var d=new DataView(ab); if(d.getUint32(0,true)!==0x04034b50)throw new Error('zip'); if(d.getUint16(8,true)!==0)throw new Error('zip mode'); var cs=d.getUint32(18,true),nl=d.getUint16(26,true),el=d.getUint16(28,true),st=30+nl+el; return ab.slice(st,st+cs); } function parseGLB(ab){ var d=new DataView(ab); if(d.getUint32(0,true)!==0x46546C67)throw new Error('glb'); var len=d.getUint32(8,true),o=12,j=null,b=null; while(o<len){ var cl=d.getUint32(o,true),ct=d.getUint32(o+4,true);o+=8; var c=ab.slice(o,o+cl); if(ct===0x4E4F534A)j=JSON.parse(new TextDecoder().decode(c)); else if(ct===0x004E4942)b=c; o+=cl; } return {json:j,bin:b}; } var CT={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}; function acc(g,i){ var a=g.json.accessors[i],v=g.json.bufferViews[a.bufferView],T=CT[a.componentType]; var it=a.type==='VEC3'?3:a.type==='VEC2'?2:a.type==='SCALAR'?1:4; var off=(v.byteOffset||0)+(a.byteOffset||0),st=v.byteStride||0; if(st&&st!==it*T.BYTES_PER_ELEMENT){ var o=new T(a.count*it); for(var k=0;k<a.count;k++)o.set(new T(g.bin,off+k*st,it),k*it); return o; } return new T(g.bin,off,a.count*it); } function build(g){ var ps=[],pos=[],nrm=[],idx=[],vb=0,ib=0; var sc=g.json.scenes[g.json.scene||0],stack=[]; (sc.nodes||[]).forEach(function(n){stack.push([n,new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])]);}); while(stack.length){ var cur=stack.pop(),ni=g.json.nodes[cur[0]],M=mmul(cur[1],nmat(ni)); if(ni.mesh!==undefined){ g.json.meshes[ni.mesh].primitives.forEach(function(p){ var P=acc(g,p.attributes.POSITION),N=p.attributes.NORMAL!==undefined?acc(g,p.attributes.NORMAL):null, I=p.indices!==undefined?acc(g,p.indices):null; var start=ib,vc=P.length/3,i,mn=[1e9,1e9,1e9],mx=[-1e9,-1e9,-1e9]; for(i=0;i<P.length;i+=3){ var v=ap(M,[P[i],P[i+1],P[i+2]]); pos.push(v[0],v[1],v[2]); for(var a=0;a<3;a++){if(v[a]<mn[a])mn[a]=v[a];if(v[a]>mx[a])mx[a]=v[a];} } for(i=0;i<vc;i++){ if(N){var w=ap(M,[N[i*3],N[i*3+1],N[i*3+2]]),l=Math.hypot(w[0],w[1],w[2])||1;nrm.push(w[0]/l,w[1]/l,w[2]/l);} else nrm.push(0,1,0); } if(I)for(i=0;i<I.length;i++)idx.push(I[i]+vb); else for(i=0;i<vc;i++)idx.push(i+vb); ps.push({pi:ps.length,start:start,count:idx.length-start,mn:mn,mx:mx, c:[(mn[0]+mx[0])/2,(mn[1]+mx[1])/2,(mn[2]+mx[2])/2], size:[mx[0]-mn[0],mx[1]-mn[1],mx[2]-mn[2]],vis:true}); vb+=vc;ib=idx.length; }); } (ni.children||[]).forEach(function(ch){stack.push([ch,M]);}); } var box=[1e9,1e9,1e9,-1e9,-1e9,-1e9]; ps.forEach(function(p){for(var a=0;a<3;a++){box[a]=Math.min(box[a],p.mn[a]);box[a+3]=Math.max(box[a+3],p.mx[a]);}}); return {parts:ps,pos:new Float32Array(pos),nrm:new Float32Array(nrm),idx:new Uint32Array(idx),box:box, center:[(box[0]+box[3])/2,(box[1]+box[4])/2,(box[2]+box[5])/2], diag:Math.hypot(box[3]-box[0],box[4]-box[1],box[5]-box[2])}; } /* ===== 主函数 ===== */ return function(host,cfg){ cfg=cfg||{}; var L=UI[cfg.lang==='en'?'en':'zh']; var PARTS=cfg.parts||PARTS_S156, REAR=cfg.rear!==undefined?cfg.rear:REAR_S156; if(!document.getElementById('sml3d-css')){ var st=document.createElement('style');st.id='sml3d-css';st.textContent=CSS;document.head.appendChild(st); } var root=document.createElement('div');root.className='v3d'; root.innerHTML='' +'<canvas></canvas>' +'<div class="tbar">' +'<button class="tb" data-v="front">'+L.front+'</button>' +'<button class="tb" data-v="back">'+L.back+'</button>' +'<button class="tb" data-v="side">'+L.side+'</button>' +'<button class="tb on" data-v="iso">'+L.iso+'</button>' +'<button class="tb hot" data-a="cover">'+L.open+'</button>' +'<button class="tb" data-a="xray">'+L.xray+'</button>' +'<button class="tb" data-a="parts">'+L.parts+'</button>' +'</div>' +'<div class="plist"></div>' +'<div class="hint">'+L.hint+'</div>' +'<div class="ebar"><span class="lb">'+L.exp+'</span><input type="range" min="0" max="100" value="0"><span class="pv">0%</span></div>' +'<div class="tip"></div>' +'<div class="cover"><button class="b">'+L.load+'</button><span class="s">'+(cfg.size||L.size)+'</span></div>'; host.appendChild(root); var cv=root.querySelector('canvas'); var gl=cv.getContext('webgl2',{antialias:true,alpha:true,premultipliedAlpha:false}); if(!gl){root.querySelector('.cover').innerHTML='<span class="s">'+L.sorry+'</span>';return {};} var VS=['#version 300 es','in vec3 aP;in vec3 aN;uniform mat4 uP,uV;uniform vec3 uO;out vec3 vP;out vec3 vN;', 'void main(){vec3 p=aP+uO;vP=p;vN=aN;gl_Position=uP*uV*vec4(p,1.0);}'].join('\n'); var FS=['#version 300 es','precision highp float;in vec3 vP;in vec3 vN;uniform vec3 uC,uE;uniform float uS,uD,uX,uA;uniform mat4 uV;out vec4 f;', 'void main(){vec3 N=normalize(vN),V=normalize(uE-vP);if(dot(N,V)<0.0)N=-N;', 'mat3 R=mat3(uV);vec3 Nv=normalize(R*N),Vv=normalize(R*V);vec3 L1=normalize(vec3(-0.42,0.58,0.70)),L2=normalize(vec3(0.60,-0.30,0.74));', 'float k1=max(dot(Nv,L1),0.0),k2=max(dot(Nv,L2),0.0);vec3 H=normalize(L1+Vv);', 'float sp=pow(max(dot(Nv,H),0.0),46.0)*0.30;float rm=pow(1.0-max(dot(Nv,Vv),0.0),3.0)*0.20;', 'vec3 c=uC*(0.34+0.52*k1+0.20*k2)+vec3(sp)+vec3(rm)*0.55;', 'if(uS>0.5)c=mix(c,vec3(0.12,0.40,0.85),0.34);if(uX>0.5)c=mix(c,vec3(0.40,0.48,0.58),0.55);else if(uD>0.5)c=mix(c,vec3(0.72,0.76,0.81),0.62);', 'float a=1.0;if(uD>0.5)a*=mix(0.40,1.0,uX);f=vec4(c,a*uA);}'].join('\n'); function sh(t,s){var o=gl.createShader(t);gl.shaderSource(o,s);gl.compileShader(o); if(!gl.getShaderParameter(o,gl.COMPILE_STATUS))throw new Error(gl.getShaderInfoLog(o));return o;} var pr=gl.createProgram(); gl.attachShader(pr,sh(gl.VERTEX_SHADER,VS));gl.attachShader(pr,sh(gl.FRAGMENT_SHADER,FS)); gl.bindAttribLocation(pr,0,'aP');gl.bindAttribLocation(pr,1,'aN');gl.linkProgram(pr);gl.useProgram(pr); var U={};['uP','uV','uO','uC','uE','uS','uD','uX','uA'].forEach(function(n){U[n]=gl.getUniformLocation(pr,n);}); var cam={th:0.60,ph:0.19,dist:3,tgt:[0,0,0],fov:34*Math.PI/180}; var model=null,explode=0,sel=-1,xray=false,coverHidden=false; var buf={}; function eye(){var cp=Math.cos(cam.ph);return [cam.tgt[0]+cam.dist*cp*Math.sin(cam.th),cam.tgt[1]+cam.dist*Math.sin(cam.ph),cam.tgt[2]+cam.dist*cp*Math.cos(cam.th)];} function fitDist(){ var w=cv.clientWidth||1,h=cv.clientHeight||1,as=w/h; var fv=cam.fov,fh=2*Math.atan(Math.tan(fv/2)*as),R=model.diag/2*1.06; return R/Math.sin(Math.min(fv,fh)/2); } /* 视角平滑过渡 */ var tw=null; function tween(to){ var from={th:cam.th,ph:cam.ph,dist:cam.dist}; var t0=performance.now(); if(to.th!==undefined&&Math.abs(to.th-cam.th)>Math.PI)cam.th+=(cam.th>to.th?1:-1)*2*Math.PI; from.th=cam.th; tw={from:from,to:to,t0:t0,dur:420}; if(!tw.run){tw.run=true;(function step(){ if(!tw){return;} var k=Math.min(1,(performance.now()-tw.t0)/tw.dur),e=k<0.5?2*k*k:1-Math.pow(-2*k+2,2)/2; cam.th=tw.from.th+(tw.to.th-tw.from.th)*e; cam.ph=tw.from.ph+(tw.to.ph-tw.from.ph)*e; cam.dist=tw.from.dist+(tw.to.dist-tw.from.dist)*e; draw(); if(k<1)requestAnimationFrame(step);else tw=null; })();} } function off(p){ var m=PARTS[p.pi]||{k:0.5,d:[0,0,1]}; var g=explode*model.diag*0.20*(m.k===undefined?0.5:m.k); return [m.d[0]*g,m.d[1]*g,m.d[2]*g]; } function col(p){return (PARTS[p.pi]&&PARTS[p.pi].col)||'#9aa4b0';} function draw(){ var dpr=Math.min(window.devicePixelRatio||1,2),w=cv.clientWidth||1,h=cv.clientHeight||1; if(cv.width!==w*dpr||cv.height!==h*dpr){cv.width=w*dpr;cv.height=h*dpr;} gl.viewport(0,0,cv.width,cv.height); gl.clearColor(0,0,0,0);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); if(xray){gl.disable(gl.DEPTH_TEST);}else{gl.enable(gl.DEPTH_TEST);}gl.disable(gl.CULL_FACE);gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA); var e=eye(); gl.uniformMatrix4fv(U.uP,false,persp(cam.fov,w/h,model.diag*0.01,model.diag*12)); gl.uniformMatrix4fv(U.uV,false,look(e,cam.tgt,[0,1,0])); gl.uniform3fv(U.uE,e); gl.bindBuffer(gl.ARRAY_BUFFER,buf.p);gl.enableVertexAttribArray(0);gl.vertexAttribPointer(0,3,gl.FLOAT,false,0,0); gl.bindBuffer(gl.ARRAY_BUFFER,buf.n);gl.enableVertexAttribArray(1);gl.vertexAttribPointer(1,3,gl.FLOAT,false,0,0); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,buf.i); var any=sel>=0; model.parts.forEach(function(p){ if(!p.vis)return; var c=hex(col(p)); gl.uniform3f(U.uC,c[0],c[1],c[2]); gl.uniform3fv(U.uO,off(p)); gl.uniform1f(U.uS,p.pi===sel?1:0); gl.uniform1f(U.uD,(any&&p.pi!==sel)?1:0); var _m=PARTS[p.pi];gl.uniform1f(U.uA, xray ? (p.pi===sel ? 1.0 : ((_m&&_m.xa!==undefined)?_m.xa:(Math.max(p.size[0],p.size[1],p.size[2])>0.075?0.20:0.62))) : 1.0); gl.uniform1f(U.uX,xray&&p.pi!==sel?1:0); gl.drawElements(gl.TRIANGLES,p.count,gl.UNSIGNED_INT,p.start*4); }); } /* 交互 */ var drag=null; cv.addEventListener('pointerdown',function(e){cv.setPointerCapture(e.pointerId);drag={x:e.clientX,y:e.clientY,m:0,b:e.button};}); cv.addEventListener('pointermove',function(e){ if(!drag)return; var dx=e.clientX-drag.x,dy=e.clientY-drag.y;drag.x=e.clientX;drag.y=e.clientY;drag.m+=Math.abs(dx)+Math.abs(dy); if(drag.b===2||e.shiftKey){ var k=cam.dist*0.0016; cam.tgt[0]-=Math.cos(cam.th)*dx*k;cam.tgt[2]+=Math.sin(cam.th)*dx*k;cam.tgt[1]+=dy*k; }else{ cam.th-=dx*0.008;cam.ph=Math.max(-1.45,Math.min(1.45,cam.ph+dy*0.006)); } draw(); }); cv.addEventListener('pointerup',function(e){if(drag&&drag.m<6&&drag.b===0)pick(e);drag=null;}); cv.addEventListener('contextmenu',function(e){e.preventDefault();}); cv.addEventListener('wheel',function(e){ e.preventDefault(); cam.dist*=1+Math.sign(e.deltaY)*0.09; cam.dist=Math.max(model.diag*0.3,Math.min(model.diag*3.2,cam.dist)); draw(); },{passive:false}); function pick(e){ var r=cv.getBoundingClientRect(); var nx=((e.clientX-r.left)/r.width)*2-1,ny=1-((e.clientY-r.top)/r.height)*2; var o=eye(),f=[cam.tgt[0]-o[0],cam.tgt[1]-o[1],cam.tgt[2]-o[2]],fl=Math.hypot(f[0],f[1],f[2]); f=[f[0]/fl,f[1]/fl,f[2]/fl]; var rt=[f[1]*0-f[2]*1,f[2]*0-f[0]*0,f[0]*1-f[1]*0],rl=Math.hypot(rt[0],rt[1],rt[2])||1; rt=[rt[0]/rl,rt[1]/rl,rt[2]/rl]; var up=[rt[1]*f[2]-rt[2]*f[1],rt[2]*f[0]-rt[0]*f[2],rt[0]*f[1]-rt[1]*f[0]]; var hh=Math.tan(cam.fov/2),hw=hh*(r.width/r.height); var d=[f[0]+rt[0]*nx*hw+up[0]*ny*hh,f[1]+rt[1]*nx*hw+up[1]*ny*hh,f[2]+rt[2]*nx*hw+up[2]*ny*hh]; var dl=Math.hypot(d[0],d[1],d[2]);d=[d[0]/dl,d[1]/dl,d[2]/dl]; var best=-1,bt=1e12; model.parts.forEach(function(p){ if(!p.vis)return; var of=off(p),cx=p.c[0]+of[0],cy=p.c[1]+of[1],cz=p.c[2]+of[2]; var oc=[cx-o[0],cy-o[1],cz-o[2]],tca=oc[0]*d[0]+oc[1]*d[1]+oc[2]*d[2]; var rad=Math.hypot(p.size[0],p.size[1],p.size[2])/2; if(tca<0)return; if((oc[0]*oc[0]+oc[1]*oc[1]+oc[2]*oc[2])-tca*tca>rad*rad)return; for(var i=p.start;i<p.start+p.count;i+=3){ var a=model.idx[i]*3,b=model.idx[i+1]*3,c=model.idx[i+2]*3; var t=rt3(o,d, [model.pos[a]+of[0],model.pos[a+1]+of[1],model.pos[a+2]+of[2]], [model.pos[b]+of[0],model.pos[b+1]+of[1],model.pos[b+2]+of[2]], [model.pos[c]+of[0],model.pos[c+1]+of[1],model.pos[c+2]+of[2]]); if(t>0&&t<bt){bt=t;best=p.pi;} } }); select(best,e); } function rt3(o,d,a,b,c){ var e1=[b[0]-a[0],b[1]-a[1],b[2]-a[2]],e2=[c[0]-a[0],c[1]-a[1],c[2]-a[2]]; var p=[d[1]*e2[2]-d[2]*e2[1],d[2]*e2[0]-d[0]*e2[2],d[0]*e2[1]-d[1]*e2[0]]; var det=e1[0]*p[0]+e1[1]*p[1]+e1[2]*p[2]; if(Math.abs(det)<1e-9)return -1; var iv=1/det,t=[o[0]-a[0],o[1]-a[1],o[2]-a[2]]; var u=(t[0]*p[0]+t[1]*p[1]+t[2]*p[2])*iv; if(u<0||u>1)return -1; var q=[t[1]*e1[2]-t[2]*e1[1],t[2]*e1[0]-t[0]*e1[2],t[0]*e1[1]-t[1]*e1[0]]; var v=(d[0]*q[0]+d[1]*q[1]+d[2]*q[2])*iv; if(v<0||u+v>1)return -1; return (e2[0]*q[0]+e2[1]*q[1]+e2[2]*q[2])*iv; } var plist=root.querySelector('.plist'),tip=root.querySelector('.tip'); function nm(p){var m=PARTS[p.pi];if(!m)return (cfg.lang==='en'?'Part ':'零件 ')+(p.pi+1);return cfg.lang==='en'?m.e:m.n;} function buildList(){ plist.innerHTML=''; model.parts.slice().sort(function(a,b){return b.size[0]*b.size[1]-a.size[0]*a.size[1];}).forEach(function(p){ var mm=PARTS[p.pi]; if(mm&&mm.list===false) return; var el=document.createElement('div'); el.className='pi';el.dataset.pi=p.pi; el.innerHTML='<i style="background:'+col(p)+'"></i><span>'+nm(p)+'</span>'; el.addEventListener('click',function(ev){ if(ev.altKey){p.vis=!p.vis;sync();draw();return;} select(p.pi===sel?-1:p.pi); }); el.addEventListener('dblclick',function(){p.vis=!p.vis;sync();draw();}); plist.appendChild(el); }); sync(); } function sync(){ plist.querySelectorAll('.pi').forEach(function(el){ var p=model.parts[+el.dataset.pi]; el.classList.toggle('off',!p.vis);el.classList.toggle('sel',p.pi===sel); }); } function select(pi,e){ sel=pi;sync();draw(); if(pi<0||!e){tip.classList.remove('on');return;} var p=model.parts[pi],s=p.size.map(function(v){return Math.round(v*1000);}); tip.innerHTML='<b>'+nm(p)+'</b><br>'+L.dim+' '+s[0]+' × '+s[1]+' × '+s[2]+' mm<br>'+L.faces+' '+(p.count/3|0); var r=host.getBoundingClientRect(); tip.style.left=Math.min(r.width-200,e.clientX-r.left+12)+'px'; tip.style.top=Math.min(r.height-70,e.clientY-r.top+12)+'px'; tip.classList.add('on'); } /* 工具栏 */ root.querySelectorAll('.tb').forEach(function(b){ b.addEventListener('click',function(){ var v=b.dataset.v,a=b.dataset.a; if(v){ root.querySelectorAll('.tb[data-v]').forEach(function(x){x.classList.remove('on');}); b.classList.add('on'); var to={ph:v==='iso'?0.28:0.02,dist:fitDist()}; if(v==='front')to.th=0; if(v==='back')to.th=Math.PI; if(v==='side')to.th=-Math.PI/2; if(v==='iso')to.th=0.60; cam.tgt=[model.center[0],model.center[1],model.center[2]]; tween(to);return; } if(a==='parts'){plist.classList.toggle('on');b.classList.toggle('on');return;} if(a==='xray'){xray=!xray;b.classList.toggle('on',xray);draw();return;} if(a==='cover'){ coverHidden=!coverHidden; model.parts[REAR].vis=!coverHidden; b.classList.toggle('on',coverHidden); b.textContent=coverHidden?L.close:L.open; if(coverHidden){ explode=0.5;root.querySelector('.ebar input').value=50;root.querySelector('.pv').textContent='50%'; tween({th:Math.PI*0.80,ph:0.24,dist:fitDist()*1.02}); }else{ explode=0;root.querySelector('.ebar input').value=0;root.querySelector('.pv').textContent='0%'; tween({th:0.60,ph:0.28,dist:fitDist()}); } sync();draw();return; } }); }); var sld=root.querySelector('.ebar input'); sld.addEventListener('input',function(){ explode=+sld.value/100;root.querySelector('.pv').textContent=sld.value+'%'; if(coverHidden&&explode<0.15){coverHidden=false;model.parts[REAR].vis=true; var cb=root.querySelector('.tb[data-a=cover]');cb.classList.remove('on');cb.textContent=L.open;} draw(); }); /* 加载 */ var started=false; function start(){ if(started)return;started=true; var cover=root.querySelector('.cover'); cover.innerHTML=L.loading+'<div class="bar"><i></i></div>'; var bar=cover.querySelector('.bar>i'); fetch(cfg.url).then(function(r){ if(!r.ok)throw new Error('HTTP '+r.status); var tot=+r.headers.get('content-length')||0,got=0,ch=[],rd=r.body.getReader(); return (function pump(){ return rd.read().then(function(x){ if(x.done)return; ch.push(x.value);got+=x.value.length; if(tot)bar.style.width=Math.min(94,6+90*got/tot)+'%'; return pump(); }); })().then(function(){ var b=new Uint8Array(got),o=0;ch.forEach(function(c){b.set(c,o);o+=c.length;}); return b.buffer; }); }).then(function(ab){ model=build(parseGLB(unzip(ab))); buf.p=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buf.p);gl.bufferData(gl.ARRAY_BUFFER,model.pos,gl.STATIC_DRAW); buf.n=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buf.n);gl.bufferData(gl.ARRAY_BUFFER,model.nrm,gl.STATIC_DRAW); buf.i=gl.createBuffer();gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,buf.i);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,model.idx,gl.STATIC_DRAW); bar.style.width='100%'; cover.style.display='none'; cam.tgt=[model.center[0],model.center[1],model.center[2]]; cam.dist=fitDist(); window.__parts=model.parts; if(cfg.only!==undefined){model.parts.forEach(function(q){q.vis=q.pi===cfg.only;});} buildList();draw(); if(cfg.boom!==undefined){ explode=cfg.boom; root.querySelector('.ebar input').value=Math.round(explode*100); root.querySelector('.pv').textContent=Math.round(explode*100)+'%'; } if(cfg.hideCover){ coverHidden=true;model.parts[REAR].vis=false; var cb=root.querySelector('.tb[data-a=cover]'); cb.classList.add('on');cb.textContent=L.close; sync(); } if(cfg.view){cam.th=cfg.view==='back'?Math.PI:cfg.view==='side'?-Math.PI/2:0.60; cam.ph=cfg.view==='iso'?0.28:0.02;} draw(); }).catch(function(err){ cover.innerHTML='<span class="s">'+L.err+':'+err.message+'</span>'; }); } root.querySelector('.cover .b').addEventListener('click',start); host.__sml3dStart=start; window.addEventListener('resize',function(){if(model)draw();}); return {start:start,ondraw:draw}; }; })(); </script></html> <html><script> /* 3D 拆解视角:捕获阶段接管图库按钮,不改动本页原有的切换脚本 */ (function () { var host = document.getElementById('sml-3d'); if (!host) return; var stage = host.parentNode, side = document.querySelector('.sml-g-side'); var v3 = null, on = false; function parseParts(btn) { try { var a = JSON.parse(btn.getAttribute('data-parts') || '[]'); return a.map(function (r) { return {n: r[0], e: r[1], col: r[2], k: r[3], d: r.length > 5 ? [r[4], r[5], r[6]] : [0, 0, r[4]], list: r[7] !== false}; }); } catch (e) { return null; } } function enter(btn) { on = true; stage.className = 'sml-g-stage on3d'; if (side) side.className = 'sml-g-side on3d'; if (!v3) { if (!window.SML3D) return; v3 = window.SML3D(host, { url: btn.getAttribute('data-zip'), lang: btn.getAttribute('data-lang'), size: btn.getAttribute('data-size'), parts: parseParts(btn), rear: +btn.getAttribute('data-rear') }); v3.start(); } } function leave() { if (!on) return; on = false; stage.className = 'sml-g-stage'; if (side) side.className = 'sml-g-side'; } document.addEventListener('click', function (e) { var t = e.target; while (t && t !== document && !(t.tagName === 'BUTTON' && /sml-g-thumb/.test(t.className))) t = t.parentNode; if (!t || t === document) return; if (t.hasAttribute('data-3d')) { e.preventDefault(); e.stopPropagation(); var bs = document.querySelectorAll('button.sml-g-thumb'); for (var i = 0; i < bs.length; i++) bs[i].className = (bs[i] === t ? 'sml-g-thumb on' : 'sml-g-thumb'); var cap = document.getElementById('sml-g-cap'), cnt = document.getElementById('sml-g-count'); if (cnt) cnt.textContent = t.getAttribute('data-idx') + ' / ' + (bs.length < 10 ? '0' + bs.length : bs.length); if (cap) cap.textContent = t.getAttribute('data-cap'); enter(t); } else { leave(); } }, true); })(); </script></html>
您的足迹:
•
sbox-r10
•
stpc-exxx-c
•
sbox-r13
登录
文章
讨论
阅读
显示源文件
修订记录
搜索
导航
首页
帮助
联系我们
打印/导出
可打印版本
工具
最近更改
媒体管理器
网站地图
永久链接
引用此文