{"id":23112081,"url":"https://github.com/zack-wang/upy-esp8266-gpiod","last_synced_at":"2026-04-16T10:35:51.268Z","repository":{"id":137130122,"uuid":"176069268","full_name":"zack-wang/upy-esp8266-gpiod","owner":"zack-wang","description":"Create robust ESP8266-GPIOs for door controller with MicroPython","archived":false,"fork":false,"pushed_at":"2019-04-15T01:40:06.000Z","size":3113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T23:44:34.310Z","etag":null,"topics":["esp8266","gpio","micropython","mqtt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zack-wang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-17T07:25:14.000Z","updated_at":"2019-04-15T01:40:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"954cc0df-9fb6-4079-a1cc-ab905fed68f6","html_url":"https://github.com/zack-wang/upy-esp8266-gpiod","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zack-wang/upy-esp8266-gpiod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zack-wang%2Fupy-esp8266-gpiod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zack-wang%2Fupy-esp8266-gpiod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zack-wang%2Fupy-esp8266-gpiod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zack-wang%2Fupy-esp8266-gpiod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zack-wang","download_url":"https://codeload.github.com/zack-wang/upy-esp8266-gpiod/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zack-wang%2Fupy-esp8266-gpiod/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31882677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp8266","gpio","micropython","mqtt"],"created_at":"2024-12-17T02:16:49.352Z","updated_at":"2026-04-16T10:35:51.250Z","avatar_url":"https://github.com/zack-wang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# upy-esp8266-gpiod\n這個專案啟發來自於 **MicroPython** http://docs.micropython.org/en/latest/esp8266/tutorial/intro.html#intro\n以及它的函式庫 https://github.com/micropython/micropython-lib/tree/master/umqtt.robust\n\n## 我是在ubuntu18的桌上型電腦做這些實驗,\n\n### 首先要確定你的\"USB轉TTL線\"運作是否正常,刪除flash \n![uart-wiring](/images/usb_ttl_esp8266.jpg)\n\n```\nesptool.py --port /dev/ttyUSB0 erase_flash\n```\n\n### 下載最新的韌體,\n```\nwget http://micropython.org/resources/firmware/esp8266-20190125-v1.10.bin\n```\n\n### 燒錄韌體（又稱flashing)\n```\nsudo esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20190125-v1.10.bin\n```\n\n### 使用picocom連線到micropython操作系統\n```\nsudo picocom /dev/ttyUSB0 -b115200\n```\n\n### 啟動wifi station mode(以下是在micropython內）\n```\nimport network\nsta=network.WLAN(network.STA_IF)\nsta.active(True)\nsta.connect('ESSID','WIFI_PASSWORD')\nsta.ifconfig()\n```\n假如連線正常時,你會看到它（esp8266)的ip,gateway等資料\n\n### 啟用WebRepl,就是用wifi與瀏覽器直接連上esp8266(在micropython內）\n```\nimport webrepl_setup\n```\n它會要求你輸入密碼,很重要,仔細做\n\n### 用你的電腦瀏覽器連上esp8266\n```\nhttp://micropython.org/webrepl/?\n```\n把 ws://192.168.4.1:8266/ 換成上面拿到esp的ip地址 例如 ws://10.40.80.2:8266/\n然後按下connect\n這時候輸入密碼\n\n### 上傳額外的程式\n![uploader](/images/file_uploader.png)\n點 **選擇檔案** , 選好以後再點 **send to device**\n\n只要改main.py以下這幾行，並且上傳就行了，但是似乎有些小bug\n```\n#每個人的服務器地址都不同哦\nSERVER='m9999.cloudmqtt.com'\n#這個連接埠是未加密\nPORT=1883\n#這是帳號\nUSR='MQTT_USER'\n#這是密碼\nPWD='MQTT_PASSWD'\n#keep-alive=3 minutes\nKEEPALV=180\n#這是client id\nUUID='UUID-1234-5678'\n\n```\n### 在micropython按 **ctrl+D** 重啟 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzack-wang%2Fupy-esp8266-gpiod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzack-wang%2Fupy-esp8266-gpiod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzack-wang%2Fupy-esp8266-gpiod/lists"}