{"id":156,"date":"2021-01-29T16:53:15","date_gmt":"2021-01-29T08:53:15","guid":{"rendered":"http:\/\/geno.picp.net:9090\/?p=156"},"modified":"2022-06-14T14:37:51","modified_gmt":"2022-06-14T06:37:51","slug":"quark-n%e7%9a%84wifi%e6%96%ad%e7%ba%bf%e8%87%aa%e5%8a%a8%e9%87%8d%e8%bf%9e","status":"publish","type":"post","link":"https:\/\/blog.glab.online\/?p=156","title":{"rendered":"Quark N\u7684WiFi\u65ad\u7ebf\u81ea\u52a8\u91cd\u8fde"},"content":{"rendered":"\n<p>Quark N\u4f7f\u7528\u4e86\u51e0\u5929\uff0c\u53d1\u73b0\u5b58\u5728Wifi\u65ad\u7ebf\u540e\u65e0\u6cd5\u91cd\u8fde\u95ee\u9898\uff0c\u641c\u7d22\u6587\u7ae0\u89e3\u51b3\u3002<\/p>\n\n\n\n<p>\u5b9e\u73b0 WiFi \u65ad\u7ebf\u81ea\u52a8\u91cd\u8fde\u3002\u539f\u7406\u662f\u7528 Python \u76d1\u6d4b\u7f51\u7edc\u662f\u5426\u65ad\u7ebf\uff0c\u5982\u679c\u65ad\u7ebf\u5219\u91cd\u542f\u7f51\u7edc\u670d\u52a1\u3002<\/p>\n\n\n\n<p>1.Python \u4ee3\u7801 autowifi.py\uff0c\u653e\u5728 \/home\/pi \u76ee\u5f55\u4e0b\uff08\u5938\u514b\u955c\u50cf\u91cc\u9762WorkSpace\/net\u76ee\u5f55\u4e0b\u5df2\u7ecf\u6709\u6b64\u811a\u672c\uff09:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/python\nimport os, time\n \nwhile True:\n    if '192' not in os.popen('ifconfig | grep 192').read():\n        print '\\n****** wifi is down, restart... ******\\n'\n        os.system('sudo \/etc\/init.d\/networking restart')\n    time.sleep(5*60) #5 minutes<\/pre>\n\n\n\n<p>2.Shell\u811a\u672cautowifi.sh\uff0c\u4e5f\u653e\u5728 \/home\/pi \u76ee\u5f55\u4e0b:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/sh\npython \/home\/pi\/autowifi.py &amp;amp;<\/pre>\n\n\n\n<p>3.\u5f00\u673a\u81ea\u52a8\u542f\u52a8\u4ee5\u4e0a\u811a\u672c\uff1a\u5728\u7ec8\u7aef\u7a97\u53e3\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo cp -f \/home\/pi\/autowifi.sh \/etc\/init.d\/\nsudo chmod +x \/etc\/init.d\/autowifi.sh\nsudo chown root:root \/etc\/init.d\/autowifi.sh\nsudo update-rc.d autowifi.sh defaults<\/pre>\n\n\n\n<p>\u6bcf5\u5206\u949f\u68c0\u6d4b\u4e00\u6b21\uff0c\u82e5 WiFi \u65ad\u7ebf\uff0c\u5219\u81ea\u52a8\u91cd\u65b0\u8fde\u63a5\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u89c9\u5f975mins\u65f6\u95f4\u592a\u77ed\u6216\u8005\u592a\u957f\uff0c\u53ef\u4ee5\u81ea\u884c\u4fee\u6539\u53c2\u6570\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quark N\u5b9e\u73b0 WiFi \u65ad\u7ebf\u81ea\u52a8\u91cd\u8fde<\/p>\n","protected":false},"author":1,"featured_media":240,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":0,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}