{"id":173,"date":"2024-08-01T19:18:19","date_gmt":"2024-08-01T10:18:19","guid":{"rendered":"http:\/\/uto.lab-somehow.net\/?p=173"},"modified":"2024-08-01T19:23:39","modified_gmt":"2024-08-01T10:23:39","slug":"wi-fi%e3%81%ae%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%83%9d%e3%82%a4%e3%83%b3%e3%83%88%e3%82%92%e3%81%a4%e3%81%8f%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86","status":"publish","type":"post","link":"http:\/\/uto.lab-somehow.net\/?p=173","title":{"rendered":"Wi-Fi\u306e\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u73fe\u5728\u3001IoT-EX\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u30de\u30a4\u30b3\u30f3\u3092\u5229\u7528\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9032\u3081\u3066\u3044\u307e\u3059\u3002\u4eca\u56de\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5229\u7528\u3057\u3066\u3044\u308bRaspberry Pi Pico W\u3092\u4f7f\u3063\u3066\u3001\u7121\u7dda\u901a\u4fe1\u306e\u6a5f\u80fd\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7121\u7dda\u901a\u4fe1\u306e2\u3064\u306e\u30e2\u30fc\u30c9<\/h2>\n\n\n\n<p>Raspberry Pi Pico W\u3067\u306f\u3001AP\u30e2\u30fc\u30c9\uff08\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u30e2\u30fc\u30c9\uff09\u3068STA\u30e2\u30fc\u30c9\uff08\u30b9\u30c6\u30fc\u30b7\u30e7\u30f3\u30e2\u30fc\u30c9\uff09\u306e2\u3064\u306e\u7121\u7dda\u901a\u4fe1\u30e2\u30fc\u30c9\u3092\u9078\u629e\u3057\u3066\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>AP\u30e2\u30fc\u30c9: Wi-Fi\u306e\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u6a5f\u80fd<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"1024\" src=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode-957x1024.png\" alt=\"\" class=\"wp-image-182\" srcset=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode-957x1024.png 957w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode-281x300.png 281w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode-768x821.png 768w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode-700x749.png 700w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/APmode.png 1166w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/figure>\n\n\n\n<p><strong>STA\u30e2\u30fc\u30c9: Wi-Fi\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u3057\u3066\u6a5f\u80fd<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1017\" src=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-1024x1017.png\" alt=\"\" class=\"wp-image-183\" srcset=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-1024x1017.png 1024w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-300x298.png 300w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-150x150.png 150w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-768x762.png 768w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-1536x1525.png 1536w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode-700x695.png 700w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/STAmode.png 1934w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4eca\u56de\u306f\u3001Raspberry Pi Pico W\u3068PC\u3060\u3051\u3067\u5b8c\u7d50\u3059\u308bAP\u30e2\u30fc\u30c9\u3092\u5229\u7528\u3057\u3001\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u4f5c\u6210\u3067\u304d\u308b\u3068\u3053\u308d\u307e\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>Raspberry Pi Pico W\u3092AP\u30e2\u30fc\u30c9\u3067\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306e\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import utime\nimport network\n\ntry:\n\n    # AP\u306e\u4f5c\u6210\n    ap = network.WLAN(network.AP_IF)\n    ap.active(True)\n    ap.config(essid='abipico', password='pico123')\n    utime.sleep(1)\n\n    # AP\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\n    for _ in range(10):\n        if ap.active():\n            break\n        utime.sleep(1)\n    print('AP Status:', ap.status())\n\n    while True:\n        utime.sleep(1)\n\nexcept KeyboardInterrupt:\n    print('Program interrupted by user')\nexcept Exception as e:\n    print('An error occurred:', e)\nfinally:\n    if 'ap' in locals() and ap.active():\n        ap.active(False)\n        # \u5c11\u3057\u5f85\u6a5f\u3057\u3066\u5b8c\u5168\u306b\u505c\u6b62\u3059\u308b\u306e\u3092\u5f85\u3064\n        utime.sleep(3)\n        ap.config(essid='', password='')  # SSID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30ea\u30bb\u30c3\u30c8\n\n        # 10\u79d2\u9593\u306e\u9593\u3067ap.active(False)\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\n        for _ in range(10):\n            if not ap.active():\n                print('AP has stopped successfully.')\n                break\n            else:\n                print('Waiting for AP to stop...')\n                utime.sleep(1)\n        else:\n            print('AP did not stop within the expected time.')\n        print('Processs: Stopped AP')\n\n    print('Cleaned up resources')<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u505c\u6b62\u3057\u305f\u5f8c\u518d\u5ea6\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u304f\u306a\u308b\u5834\u5408\u306f\u3001\u6b63\u3057\u304f\u505c\u6b62\u3067\u304d\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u6b63\u3057\u304f\u52d5\u4f5c\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u4fee\u6b63\u5f8c\u3001Raspberry Pi Pico\u3092\u518d\u8d77\u52d5\u3057\u3066\u304b\u3089\u52d5\u4f5c\u78ba\u8a8d\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n<p>\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057PC\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u63a5\u7d9a\u53ef\u80fd\u306aWi-Fi\u306e\u4e00\u89a7\u306b\u300cabipico\u300d\u3068\u3044\u3046SSID\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"443\" height=\"493\" src=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-list-1.png\" alt=\"\" class=\"wp-image-179\" srcset=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-list-1.png 443w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-list-1-270x300.png 270w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/figure>\n\n\n\n<p>\u307e\u305f\u3001Wi-Fi\u306e\u4fe1\u53f7\u3092\u8868\u793a\u3059\u308b\u30b9\u30de\u30db\u30a2\u30d7\u30ea\u304b\u3089\u3082SSID\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"1024\" src=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-768x1024.png\" alt=\"\" class=\"wp-image-180\" srcset=\"http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-768x1024.png 768w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-225x300.png 225w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-1152x1536.png 1152w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-1536x2048.png 1536w, http:\/\/uto.lab-somehow.net\/wp-content\/uploads\/2024\/08\/wifi-analyzer-700x933.png 700w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3001Raspberry Pi Pico W\u3092\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u5229\u7528\u3057\u307e\u3057\u305f\u3002Raspberry Pi Pico W\u306b\u306f\u3055\u307e\u3056\u307e\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u30dc\u30bf\u30f3\u3084\u30de\u30a4\u30af\u306a\u3069\uff09\u3092\u63a5\u7d9a\u3067\u304d\u308b\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u306a\u5fdc\u7528\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u518d\u63a5\u7d9a\u304c\u3046\u307e\u304f\u3044\u304b\u306a\u304b\u3063\u305f\u308a\u3068\u82e6\u6226\u3057\u307e\u3057\u305f\u304c\u3001\u666e\u6bb5\u4f55\u6c17\u306a\u304f\u5229\u7528\u3057\u3066\u3044\u308bWi-Fi\u306e\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u81ea\u5206\u3067\u4f5c\u3063\u3066\u63a5\u7d9a\u3067\u304d\u308b\u72b6\u614b\u306b\u3059\u308b\u306e\u306f\u3001\u306a\u304b\u306a\u304b\u304a\u3082\u3057\u308d\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u6587\u732e<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.micropython.org\/en\/v1.23.0\/library\/network.html\">MicroPython libraries network \u2014 network configuration<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.micropython.org\/en\/v1.23.0\/library\/network.WLAN.html\">MicroPython libraries network \u2014 network configuration class WLAN \u2013 control built-in WiFi interfaces<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b \u73fe\u5728\u3001IoT-EX\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u30de\u30a4\u30b3\u30f3\u3092\u5229\u7528\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9032\u3081\u3066\u3044\u307e\u3059\u3002\u4eca\u56de\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5229\u7528\u3057\u3066\u3044\u308bRaspberry Pi Pico W\u3092\u4f7f\u3063\u3066\u3001\u7121\u7dda\u901a\u4fe1\u306e\u6a5f\u80fd\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002 \u7121\u7dda\u901a\u4fe1\u306e2\u3064\u306e\u30e2&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=173"}],"version-history":[{"count":8,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/posts\/173\/revisions"}],"predecessor-version":[{"id":186,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=\/wp\/v2\/posts\/173\/revisions\/186"}],"wp:attachment":[{"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/uto.lab-somehow.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}