{"id":255,"date":"2021-02-10T20:34:00","date_gmt":"2021-02-10T11:34:00","guid":{"rendered":"https:\/\/sakae-shokai.com\/?p=255"},"modified":"2021-02-10T18:36:49","modified_gmt":"2021-02-10T09:36:49","slug":"esp32%e3%81%ae%e3%83%95%e3%82%a1%e3%83%bc%e3%83%a0%e3%82%a6%e3%82%a7%e3%82%a2%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88","status":"publish","type":"post","link":"https:\/\/sakae-shokai.com\/wordpress\/?p=255","title":{"rendered":"ESP32\u306e\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8"},"content":{"rendered":"\n<p>\u65b0\u54c1\u306eESP32\u3092\u4ed5\u5165\u308c\u3066\u3042\u3063\u305f\u306e\u3067\u3001microPython\u4ed5\u69d8\u306b\u3059\u308b\u305f\u3081\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u3057\u307e\u3057\u305f\u3002\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u306b\u3064\u3044\u3066\u306f<a href=\"http:\/\/micropython.org\/download\/esp32\/\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"http:\/\/micropython.org\/download\/esp32\/\">http:\/\/micropython.org\/download\/esp32\/<\/a>\u306b\u6700\u65b0\u7248\u304c\u3042\u308a\u307e\u3059\u3057\u3001\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306e\u4ed5\u65b9\u3082\u8aac\u660e\u304c\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u5143\u304b\u3089\u5165\u3063\u3066\u3044\u308b\u30d5\u30a1\u30fc\u30e0\u3092\u6d88\u53bb\u3057\u307e\u3059\u3002\u30d5\u30a1\u30fc\u30e0\u306e\u5165\u308c\u66ff\u3048\u306fesptool.py\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u4eca\u65e5\u306fUSB\u306e\u30dd\u30fc\u30c8\u306fCOM4\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Users\\>esptool.py --chip esp32 --port com4 erase_flash\nesptool.py v2.2\nConnecting....\nChip is ESP32D0WDQ5 (revision (unknown 0xa))\nUploading stub...\nRunning stub...\nStub running...\nErasing flash (this may take a while)...\nChip erase completed successfully in 10.3s\nHard resetting...<\/code><\/pre>\n\n\n\n<p>\u6b21\u306b\u3042\u3089\u304b\u3058\u3081\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Users\\>esptool.py --chip esp32 --port com4 write_flash -z 0x1000 c:\\micropython\\esp32-idf3-20210202-v1.14.bin\nesptool.py v2.2\nConnecting.....\nChip is ESP32D0WDQ5 (revision (unknown 0xa))\nUploading stub...\nRunning stub...\nStub running...\nConfiguring flash size...\nAuto-detected Flash size: 4MB\nCompressed 1445632 bytes to 925476...\nWrote 1445632 bytes (925476 compressed) at 0x00001000 in 82.8 seconds (effective 139.7 kbit\/s)...\nHash of data verified.\n\nLeaving...\nHard resetting...<\/code><\/pre>\n\n\n\n<p>ampy\u3067\u78ba\u8a8d\u3057\u3088\u3046\u3068\u3057\u307e\u3057\u305f\u304c\u3001\u4e0a\u624b\u304f\u3044\u304b\u305a\u3001TeraTerm\u3067\u30b7\u30ea\u30a2\u30eb\u63a5\u7d9a\u3057\u3066\u30d5\u30a1\u30fc\u30e0\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3061\u3083\u3093\u3068\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ts Jun  8 2016 00:22:57\n\nrst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\nconfigsip: 0, SPIWP:0xee\nclk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\nmode:DIO, clock div:2\nload:0x3fff0018,len:4\nload:0x3fff001c,len:5008\nho 0 tail 12 room 4\nload:0x40078000,len:10600\nho 0 tail 12 room 4\nload:0x40080400,len:5684\nentry 0x400806bc\nMicroPython v1.14 on 2021-02-02; ESP32 module with ESP32\nType \"help()\" for more information.\n&gt;&gt;&gt;<\/code><\/pre>\n\n\n\n<p>\u4e0a\u306b\u3042\u308b\u3088\u3046\u306b\u3001help()\u30b3\u30de\u30f3\u30c9\u3092\u305f\u305f\u304f\u3068\u3001\u4e00\u5bf8\u3057\u305f\u4f8b\u6587\u304c\u51fa\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt;&gt; help()\nWelcome to MicroPython on the ESP32!\n\nFor generic online docs please visit http:\/\/docs.micropython.org\/\n\nFor access to the hardware use the 'machine' module:\n\nimport machine\npin12 = machine.Pin(12, machine.Pin.OUT)\npin12.value(1)\npin13 = machine.Pin(13, machine.Pin.IN, machine.Pin.PULL_UP)\nprint(pin13.value())\ni2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))\ni2c.scan()\ni2c.writeto(addr, b'1234')\ni2c.readfrom(addr, 4)\n\nBasic WiFi configuration:\n\nimport network\nsta_if = network.WLAN(network.STA_IF); sta_if.active(True)\nsta_if.scan()                             # Scan for available access points\nsta_if.connect(\"&lt;AP_name&gt;\", \"&lt;password&gt;\") # Connect to an AP\nsta_if.isconnected()                      # Check for successful connection\n\nControl commands:\n  CTRL-A        -- on a blank line, enter raw REPL mode\n  CTRL-B        -- on a blank line, enter normal REPL mode\n  CTRL-C        -- interrupt a running program\n  CTRL-D        -- on a blank line, do a soft reset of the board\n  CTRL-E        -- on a blank line, enter paste mode\n\nFor further help on a specific object, type help(obj)\nFor a list of available modules, type help('modules')<\/code><\/pre>\n\n\n\n<p>OS\u306e\u30ea\u30ea\u30fc\u30b9\u60c5\u5831\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u3092\u8868\u793a\u3057\u305f\u3068\u3053\u308d\u3001boot.py\u51fa\u6765\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt;&gt; import os\n&gt;&gt;&gt; os.uname()\n(sysname='esp32', nodename='esp32', release='1.14.0', version='v1.14 on 2021-02-02', machine='ESP32 module with ESP32')\n&gt;&gt;&gt; os.listdir()\n&#91;'boot.py']<\/code><\/pre>\n\n\n\n<p>\u518d\u5ea6\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089\u3001ampy\u3092\u7528\u3044\u3066\u30ea\u30b9\u30c8\u8868\u793a\u3092\u3057\u305f\u3089\u7121\u4e8b\u306bboot.py\u3082\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u7121\u4e8b\u306bmicroPython\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Users\\>ampy -p com4 ls\nboot.py<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u65b0\u54c1\u306eESP32\u3092\u4ed5\u5165\u308c\u3066\u3042\u3063\u305f\u306e\u3067\u3001microPython\u4ed5\u69d8\u306b\u3059\u308b\u305f\u3081\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u3057\u307e\u3057\u305f\u3002\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u306b\u3064\u3044\u3066\u306fhttp:\/\/micropython.org\/download\/esp32\/\u306b\u6700\u65b0 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sakae-shokai.com\/wordpress\/?p=255\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;ESP32\u306e\u30d5\u30a1\u30fc\u30e0\u30a6\u30a7\u30a2\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":234,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,16,8],"tags":[18,19],"class_list":["post-255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-micropython","category-archive","tag-esp32","tag-micropython"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255"}],"version-history":[{"count":8,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":266,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/255\/revisions\/266"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=\/wp\/v2\/media\/234"}],"wp:attachment":[{"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sakae-shokai.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}