{"id":1137,"date":"2022-08-22T10:40:27","date_gmt":"2022-08-22T02:40:27","guid":{"rendered":"https:\/\/aichh.com\/?p=1137"},"modified":"2022-08-22T14:06:26","modified_gmt":"2022-08-22T06:06:26","slug":"%e5%b0%8fk%e6%99%ba%e8%83%bd%e6%8f%92%e5%ba%a7%e6%8e%a7%e5%88%b6","status":"publish","type":"post","link":"https:\/\/aichh.com\/1137.html","title":{"rendered":"\u5c0fK\u667a\u80fd\u63d2\u5ea7\u63a7\u5236"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><h1 class=\"article-title\">\u547d\u4ee4\u884c\u63a7\u5236<\/h1>\n<p>\u63d2\u5ea7\u7535\u6e90\u63a7\u5236\uff1a<\/p>\n<pre>root@OpenWrt:\/sys\/class\/leds# echo 0 &gt; \/sys\/class\/leds\/tp-link:blue:relay\/brightness\r\nroot@OpenWrt:\/sys\/class\/leds# echo 1 &gt; \/sys\/class\/leds\/tp-link:blue:relay\/brightness<\/pre>\n<p>\u63d2\u5ea7\u5c0f\u591c\u706f\u63a7\u5236:<\/p>\n<pre>echo 0 &gt; \/sys\/class\/leds\/i-konke:yellow:light\/brightness\r\necho 1 &gt; \/sys\/class\/leds\/i-konke:yellow:light\/brightness<\/pre>\n<p>\u63d2\u5ea7USB\u53e3\u63a7\u5236:<\/p>\n<pre>echo 0 &gt; \/sys\/class\/leds\/i-konke:green:usb\/brightness\r\necho 0 &gt; \/sys\/class\/leds\/i-konke:green:usb\/brightness<\/pre>\n<p>\u63d2\u5ea7USB\u53e3\u5b9a\u65f6\u8bbe\u7f6e:<\/p>\n<pre>\/etc\/dropbear\/accessory\/timer\/online\r\n\u683c\u5f0f:\r\n1022 y 2017-07-03-19:00:00 y 2017-07-03-04:10:00 y 2,3,4,5,6 usb<\/pre>\n<p>&nbsp;<\/p>\n<h1 class=\"article-title\">\u7f51\u9875\u63a7\u5236-\u65e0\u63a7\u5236\u9762\u677f<\/h1>\n<p>\u65b0\u589ejson.cgi<br \/>\n\u5207\u6362\u5230www\/cgi-bin\u76ee\u5f55,\u65b0\u589ejson.cgi<\/p>\n<pre>cd \/www\r\nmkdir cgi-bin\r\ncd cgi-bin\r\nvi json.cgi<\/pre>\n<p>!\/bin\/sh<br \/>\necho \u201cContent-Type: application\/javascript\u201d<\/p>\n<p>echo \u201cCache-Control: no-cache, must-revalidate\u201d<\/p>\n<p>echo \u201cExpires: Sat, 26 Jul 1997 05:00:00 GMT\u201d<\/p>\n<p>echo<\/p>\n<p>VERSION=0.0.1<\/p>\n<p>RELAY_CTRL=\/sys\/class\/leds\/tp-link:blue:relay\/brightness<\/p>\n<p>TIMINGS=tail -n+3 \/etc\/online.txt | sed ':a;N;$!ba;s\/n\/\",\"\/g'<\/p>\n<p>IP_ADDRESS=ifconfig wlan0 | sed ':a;N;$!ba;s\/n\/\",\"\/g' | grep -E -o '[0-9]+.[0-9]+.[0-9]+.[0-9]+' | head -n 1<\/p>\n<p>get=$(echo \"$QUERY_STRING\u201d | sed -n \u2018s\/^.get=(1).*$\/1\/p\u2019 | sed \u201cs\/%20\/ \/g\u201d)<\/p>\n<p>set=$(echo \"$QUERY_STRING\u201d | sed -n \u2018s\/^.set=(1).*$\/1\/p\u2019 | sed \u201cs\/%20\/ \/g\u201d)<\/p>\n<p>callback=$(echo \"$QUERY_STRING\u201d | sed -n \u2018s\/^.callback=(1).*$\/1\/p\u2019 | sed \u201cs\/%20\/ \/g\u201d)<\/p>\n<p>case \u201c$get\u201d in<\/p>\n<p>state)<\/p>\n<p>case \"`cat $RELAY_CTRL`\" in<\/p>\n<p>0) echo \"$callback({\"state\":\"off\"})\"<\/p>\n<p>;;<\/p>\n<p>1) echo \"$callback({\"state\":\"on\"})\"<\/p>\n<p>;;<\/p>\n<p>esac<br \/>\n;;<\/p>\n<p>timing)<\/p>\n<p>echo \"$callback({\"timings\":[\"$TIMINGS\"]})\"<br \/>\n;;<\/p>\n<p>esac<\/p>\n<p>case \u201c$set\u201d in<\/p>\n<p>on)<\/p>\n<p>echo 1 &gt; $RELAY_CTRL<\/p>\n<p>echo \"$callback({\"ok\":true})\"<br \/>\n;;<\/p>\n<p>off)<\/p>\n<p>echo 0 &gt; $RELAY_CTRL<\/p>\n<p>echo \"$callback({\"ok\":true})\"<br \/>\n;;<\/p>\n<p>esac<\/p>\n<p>if [ -z \u201c$get\" ] &amp;&amp; [ -z \"$set\u201d ]; then<\/p>\n<p>echo \u201c$callback({\"info\":{\"name\":\"kankun-json\",\"version\":\"$VERSION\",\"ipAddress\":\"$IP_ADDRESS\"},\"links\":{\"meta\":{\"state\":\"http:\/\/$IP_ADDRESS\/cgi-bin\/json.cgi?get=state\",\"timing\":\"http:\/\/$IP_ADDRESS\/cgi-bin\/json.cgi?get=timing\"},\"actions\":{\"on\":\"http:\/\/$IP_ADDRESS\/cgi-bin\/json.cgi?set=on\",\"off\":\"http:\/\/$IP_ADDRESS\/cgi-bin\/json.cgi?set=off\"}}})\u201d<\/p>\n<p>fi<\/p>\n<p>\u8bbe\u7f6e\u6743\u9650:<\/p>\n<pre>chmod -R 0755 \/www\/\r\nchmod +x \/www\/cgi-bin\/json.cgi<\/pre>\n<p>\u63a5\u7740\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee:<br \/>\n<a href=\"http:\/\/ip\/cgi-bin\/json.cgi\">http:\/\/ip\/cgi-bin\/json.cgi<\/a><br \/>\n\u5982\u679c\u51fa\u73b0\u4ee5\u4e0b\u63d0\u793a\u4ee3\u8868json.cgi\u5b89\u88dd\u6210\u529f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"666983272\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/666983272.jpg\" width=\"1024\" height=\"266\"><\/p>\n<h1 class=\"article-title\">\u7f51\u9875\u63a7\u5236-\u63a7\u5236\u9762\u677f1<\/h1>\n<p>\u4e0b\u8f7ddash\u9762\u677f\u5230\u63d2\u5ea7\u4e2d<\/p>\n<p>\u94fe\u63a5: https:\/\/pan.baidu.com\/s\/1xzW8mIDEItPotaNXcamPwg?pwd=qxh9 \u63d0\u53d6\u7801: qxh9<br \/>\n\u628a\u4e0b\u8f7d\u7684\u6587\u4ef6\u901a\u8fc7scp\u4e0a\u4f20\u5230\u63d2\u5ea7\u7684\/www\/\u76ee\u5f55\u4e2d\uff0c<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"4043170328-1\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/4043170328-1.jpg\" width=\"1024\" height=\"505\"><br \/>\nchmod +x \/www\/cgi-bin\/*<br \/>\n\u7136\u540e\u4fee\u6539switches.json\u4e2d\u7684\u63d2\u5ea7\u5730\u5740:<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"2079307833\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/2079307833.jpg\" width=\"448\" height=\"233\"><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee,\u5373\u53ef\u51fa\u73b0dash\u9875\u9762\uff0c\u53ef\u4ee5\u968f\u610f\u63a7\u5236\u63d2\u5ea7\u5f00\u5173\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"731035515-1\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/731035515-1.jpg\" width=\"1024\" height=\"274\"><\/p>\n<p>&nbsp;<\/p>\n<h1 class=\"article-title\">API\u63a7\u5236<\/h1>\n<p>\u521b\u5efarelay.cgi \u7528\u7f51\u9875\u754c\u9762\u5207\u6362\u5c0fK\u7684 on \/ off<br \/>\n\u9996\u5148\u767b\u9646\u5c0fK\u667a\u80fd\u63d2\u5ea7:<\/p>\n<pre>cd \/www\r\nmkdir cgi-bin\r\ncd cgi-bin\r\nvi relay.cgi<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"468457343\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/468457343.jpg\" width=\"706\" height=\"544\"><\/p>\n<pre>!\/bin\/sh\r\necho \u201cContent-Type: text\/plain\u201d\r\necho \u201cCache-Control: no-cache, must-revalidate\u201d\r\necho \u201cExpires: Sat, 26 Jul 1997 05:00:00 GMT\u201d\r\necho\r\n\r\nRELAY_CTRL=\/sys\/class\/leds\/tp-link:blue:relay\/brightness\r\n\r\ncase \u201c$QUERY_STRING\u201d in\r\nstate)\r\ncase \u201ccat $RELAY_CTRL\u201d in\r\n0) echo \u201cOFF\u201d\r\n;;\r\n1) echo \u201cON\u201d\r\n;;\r\nesac\r\n;;\r\non)\r\necho 1 &gt; $RELAY_CTRL\r\necho ON OK\r\n;;\r\noff)\r\necho 0 &gt; $RELAY_CTRL\r\necho OFF OK\r\n;;\r\nesac<\/pre>\n<p>\u63a5\u4e0b\u6765\u4fee\u6539\u4e00\u4e0b\u76ee\u5f55\u6743\u9650\u3002<br \/>\nchmod -R 0755 \/www\/<br \/>\nchmod +x \/www\/cgi-bin\/relay.cgi<br \/>\n\u63a5\u4e0b\u6765\u4f60\u53ef\u4ee5\u53bb\u7528\u7f51\u9875\u6d4f\u89c8\u5668\u7b80\u5355\u63a7\u5236\u5c0fK on &amp; off \u4e86\u3002\u5982\u9700\u8fdc\u7a0b\u63a7\u5236\u81ea\u884c\u6620\u5c04\u5230\u5916\u7f51\u5373\u53ef\u3002<br \/>\n\u6253\u5f00\u00a0<a href=\"http:\/\/ip\/cgi-bin\/relay.cgi?on\">http:\/\/ip\/cgi-bin\/relay.cgi?on<\/a><br \/>\n\u5173\u95ed\u00a0<a href=\"http:\/\/ip\/cgi-bin\/relay.cgi?off\">http:\/\/ip\/cgi-bin\/relay.cgi?off<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"2749701009\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/2749701009.jpg\" width=\"563\" height=\"191\"><\/p>\n<h1 class=\"article-title\">\u5237\u673a\u5b9e\u73b0\u4e50\u8054\u7f51\u63a5\u5165<\/h1>\n<p>\u76ee\u7684:\u628a\u5c0fK\u6539\u9020\u5230\u516c\u5f00\u7684\u7269\u8054\u7f51\u5e73\u53f0\u4e50\u8054\u7f51(www.lewei50.com)\u3002<\/p>\n<p>\u6ce8\u610f:\u5237\u673a\u6709\u98ce\u9669\uff0c\u53d8\u7816\u81ea\u8d1f\u3002<\/p>\n<p>1.\u5c06\u4f60\u7684\u5c0fk\u4e00\u4ee3\uff0c\u6309\u5f00\u5173\u952e3\u30014\u79d2\uff0c\u6307\u793a\u706f\u53d8\u84dd\uff08\u6062\u590d\u9ed8\u8ba4\u8bbe\u7f6e\uff09\u3002<\/p>\n<p>2\uff0c\u641c\u7d22\u540d\u4e3a0K_SP3_??????\u7684ssid\uff0c\u9ed8\u8ba4\u65e0\u5bc6\u7801\uff0c\u4f7f\u7528\u7b14\u8bb0\u672c\u8fde\u63a5\uff0c\u4f1a\u5f97\u5230192.168.10.*\u6bb5\u7684ip\uff0c\u5c0fK\u7684\u5730\u5740\u662f192.168.10.253<\/p>\n<p>3\uff0c\u8fd9\u91cc\u4e0b\u8f7d\u4fee\u6539\u8fc7\u76844M\u56fa\u4ef6,\u5e76\u5c06\u540d\u5b57\u6539\u6210firmware4M.bin\u3002<a href=\"https:\/\/github.com\/yangbo1979\/SmartPlug\">https:\/\/github.com\/yangbo1979\/SmartPlug<\/a><\/p>\n<p>\u4e0b\u8f7d\u94fe\u63a5: https:\/\/pan.baidu.com\/s\/1e7-t5VwGsRDT6gOSZLrBNQ?pwd=ftir \u63d0\u53d6\u7801: ftir<\/p>\n<p>4\uff0c\u767b\u5f55\u5c0fK\u7684\u9ed8\u8ba4\u7528\u6237\u540d\u662froot\uff0c\u5bc6\u7801\u4e3aadmin\u3002\u901a\u8fc7winscp\u8fd9\u4e2a\u8f6f\u4ef6\u4f7f\u7528scp\u534f\u8bae\u5c06\u6587\u4ef6\u4f20\u5230\u5c0fK\u7684\/tmp\u76ee\u5f55\u4e0b<\/p>\n<p>5\uff0c\u6267\u884cmtd -r write \/tmp\/firmware4M.bin firmware\uff0c\u5237\u5165bin\u3002<\/p>\n<p>6\uff0c\u8bbe\u5907\u4f1a\u81ea\u52a8\u91cd\u542f<\/p>\n<p>7\uff0c\u91cd\u542f\u540e\uff0c\u4f1a\u6709OpenWrt-xu1\uff08\u6216OpenWrt-Lewei\uff0c\u8bb0\u4e0d\u6e05\u4e86)\u7684\u65e0\u7ebf\u7f51\uff0c\u5bc6\u780112345678\uff0c\u8054\u4e4b<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"2942884924\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/2942884924.jpg\" width=\"267\" height=\"62\"><br \/>\n8\uff0c\u8fde\u4e0a\u8fd9\u4e2a\u65e0\u7ebf\u7f51\uff0c\u4f60\u4f1a\u83b7\u5f97192.168.2.*\u7684IP\uff0c\u6253\u5f00\u7f51\u9875192.168.2.1\uff0c<br \/>\n\u767b\u5f55\u7528\u6237\u540droot,\u5bc6\u7801admin<br \/>\n\u5728wifi\u9875\u9762\u914d\u7f6e\u597d\u65e0\u7ebf\u7f51\uff0c\u5e76\u4e14\u5728system\u9875\u9762\u7684\u6700\u540elewei sn\u6807\u7b7e\u4e0b\uff0c\u8f93\u5165\u7f51\u5173\u53f7\u548cuserkey\uff0cswitchId\u5904\u586b\u4f60\u5728\u4e50\u8054\u7f51\u8bbe\u7f6e\u7684\u63a7\u5236\u5668\u6807\u8bc6\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"3055807620\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/3055807620.jpg\" width=\"558\" height=\"309\"><br \/>\n\u70b9\u201csave and apply\u201d\u540e\u8bbe\u5907\u4f1a\u81ea\u52a8\u91cd\u542f<br \/>\n9.\u7f51\u7ad9\u4e0a\u914d\u7f6e\u5bf9\u5e94\u8bbe\u5907\u7684\u6807\u8bc6\uff0c\u8981\u8bbe\u7f6e\u201cAPI\u5730\u5740\u201d\u4e3a\u957f\u8fde\u63a5\u5730\u5740\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"2499504866\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/2499504866.jpg\" width=\"558\" height=\"114\"><br \/>\n\u6ce8\uff1a\u8bbe\u5907\u4e0a\u7684\u5f00\u5173\u5355\u6309\u662f\u76f4\u63a5\u5f00\u5173\u3002\u63095s\u5de6\u53f3\u4e3a\u6062\u590d\u7f51\u7edc\u914d\u7f6e\u4e3a\u5355ap\u6a21\u5f0f\uff0c\u65ad\u7535\u91cd\u5f00\u540e\u53ef\u4ee5\u6062\u590d\u65e0\u7ebf\u7f51\u914d\u7f6e\u3002\u630910s\u5de6\u53f3\u4e3a\u624b\u52a8\u91cd\u542f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" title=\"316296736\" src=\"https:\/\/aichh.com\/wp-content\/uploads\/2022\/08\/316296736.jpg\" width=\"621\" height=\"76\"><\/p>\n<p>\u5b8c\u6210\uff01\uff01\u4f60\u73b0\u5728\u6709\u4e86\u4e00\u4e2a\u5c5e\u4e8e\u201c\u81ea\u5df1\u63a7\u5236\u201d\u7684\u667a\u80fd\u63d2\u5ea7\u4e86\uff01<\/p>\n<p>\u5982\u679c\u4e50\u8054\u7f51\u8fde\u4e0d\u4e0a\u600e\u4e48\u529e?\u8bf7\u770b\u4e0b\u9762:<br \/>\n\u89c2\u5bdf\u5c0fk\u7684\u65e5\u5fd7\u53d1\u73b0\u5237\u5b8c\u56fa\u4ef6\u4ee5\u540e\uff0c\u8981\u767b\u5f55\u5230\u5c0fk\u4e0a\uff0c\u53bb xutest\u8fd9\u4e2a\u76ee\u5f55\u91cc\uff0c\u627e\u5230tcp_lewei.lua\u8fd9\u4e2a\u6587\u4ef6<br \/>\n\u7136\u540e\u53bb\u4fee\u6539function tcp_lewei()\u8fd9\u4e2a\u51fd\u6570\u7684\u5934\u4e24\u884c\uff0c\u6539\u6210\u4e0b\u9762\u8fd9\u4e24\u4e2a<\/p>\n<pre>local tcp_host = \u201ctcp.lewei50.com\u201d\r\nlocal tcp_port = 9960<\/pre>\n<p>Enjoy it\uff5e<\/p>\n<p>&nbsp;<\/p>\n<p>VIA\uff1a<a href=\"https:\/\/www.lijian.me\/\" target=\"_blank\" rel=\"noopener\">\u674e\u5b50\u535a\u5ba2<\/a><\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u547d\u4ee4\u884c\u63a7\u5236 \u63d2\u5ea7\u7535\u6e90\u63a7\u5236\uff1a root@OpenWrt:\/sys\/class\/leds# echo 0 &gt; \/sys\/class\/leds\/tp-link:blue:relay\/brightnes \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[304,305,303],"class_list":["post-1137","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","tag-class","tag-leds","tag-sys"],"views":218,"_links":{"self":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/comments?post=1137"}],"version-history":[{"count":7,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1137\/revisions"}],"predecessor-version":[{"id":1161,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1137\/revisions\/1161"}],"wp:attachment":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/media?parent=1137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/categories?post=1137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/tags?post=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}