{"id":16239418,"url":"https://github.com/nopnop2002/python-esp8266","last_synced_at":"2026-01-28T00:40:03.415Z","repository":{"id":240324520,"uuid":"802325979","full_name":"nopnop2002/python-esp8266","owner":"nopnop2002","description":"Network example using pyseral and esp8266 AT firmware","archived":false,"fork":false,"pushed_at":"2024-09-22T22:36:54.000Z","size":108,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T18:37:56.479Z","etag":null,"topics":["at-commands","esp8266","http-client","luckfox","milkv","mqtt-client","network","ntp-client","pyserial","python","rest-client","sntp-client","tcp-client","udp-client"],"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/nopnop2002.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":"2024-05-18T02:00:43.000Z","updated_at":"2025-02-21T18:30:55.000Z","dependencies_parsed_at":"2024-05-18T03:23:44.440Z","dependency_job_id":"c1652113-de6f-48bb-b818-29649e51cc82","html_url":"https://github.com/nopnop2002/python-esp8266","commit_stats":null,"previous_names":["nopnop2002/python-esp8266"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nopnop2002/python-esp8266","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fpython-esp8266","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fpython-esp8266/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fpython-esp8266/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fpython-esp8266/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nopnop2002","download_url":"https://codeload.github.com/nopnop2002/python-esp8266/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nopnop2002%2Fpython-esp8266/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28829518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["at-commands","esp8266","http-client","luckfox","milkv","mqtt-client","network","ntp-client","pyserial","python","rest-client","sntp-client","tcp-client","udp-client"],"created_at":"2024-10-10T13:43:38.518Z","updated_at":"2026-01-28T00:40:03.410Z","avatar_url":"https://github.com/nopnop2002.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-esp8266   \nNetwork example using pyserial and esp8266 AT firmware.   \nYou don't need Ethernet card.   \nYou need only pyserial library and ESP8266 module.   \n\n# Background   \nI recently bought a LuxkFox Pico Mini board.   \nIt's a very small Linux board.   \nbuildroot linux works.   \nBut there is no network.   \nSo, I made it to use the network with this board.\n\n![ProMini-1](https://github.com/nopnop2002/python-esp8266/assets/6020549/f822d021-d73b-46b0-9485-0b324dbce3e9)\n\n![ProMini-41](https://github.com/nopnop2002/python-esp8266/assets/6020549/6fdd800d-ccd4-47f2-8fa4-b972f2bb4510)\n\n# Hardware requirements   \n\n- Linux board with UART functionality   \n As long as pyserial works, distribution doesn't matter.   \n\n- ESP8266 module like ESP01   \n ESP8266 has SoCs with 1MB Flash (like ESP01) and 4MB Flash (like ESP12), it doesn't matter.\n\n- Regulator that can convert 5V to 3.3V   \n I used AMS1117 breakout.   \n This breakout is equipped with a capacitor, so no other components are required.   \n ![AMS1117-1](https://github.com/user-attachments/assets/2e50876b-a39e-43bb-9c86-92ab9d18274a)\n ![AMS1117-2](https://github.com/user-attachments/assets/e4b1f4c5-e88d-4eb5-b2bf-2012622a0859)\n\n- UART-USB converter   \n Used for initial firmware settings.   \n\n# Software requirements   \n- pyserial library   \n In your buildroot environment you can enable it with this.   \n ![buildroot-71](https://github.com/nopnop2002/python-esp8266/assets/6020549/2b3be767-83e3-4d4c-8d28-93303196fca2)\n\n- ESP8266 AT Firmware   \n AT firmware version can be identified by AT version and SDK version.   \n AT version V2 added MQTT and HTTP commands.   \n However, AT version V2 does not support 1M SoCs like ESP01.   \n When using 1M SoCs like ESP01, it is necessary to use AT version V1.   \n This repository works with both V1 and V2.   \n You can download AT version V1 from [here](https://github.com/espressif/ESP8266_NONOS_SDK/tags).   \n __Note__   \n Some firmware here does not support 1M SoC such as ESP01.   \n I used this.\n```\nAT+GMR\nAT version:1.7.5.0(Oct 20 2021 19:14:04)\nSDK version:3.0.5(b29dcd3)\ncompile time:Oct 20 2021 20:13:50\nBin version(Wroom 02):1.7.5\n```\n\n- Terminal software such as CoolTerm   \n I use TeraTrem.   \n You can down load from [here](https://download.cnet.com/tera-term/3000-2094_4-75766675.html).\n\n# Flash AT firmware to ESP01.   \nThe 3.3V output of the UART-USB converter has too little current to be used.   \nPower is supplied using 5V from the UART-USB converter and 3.3V from the regulator.   \n- GPIO2 must be pulled up.   \n- GPIO0 must be connected to GND.   \n- CH_PD must be pulled up.   \n- RESET must be pulled up.   \n\nClick [here](https://github.com/nopnop2002/Arduino-ESPAT-TCP/tree/master/Flash_AT_firmware) for details.\n\n![esp01-flash](https://user-images.githubusercontent.com/6020549/33159146-b8456238-d053-11e7-8202-a86cca2f8a3d.jpg)\n\n\n# Setup ESP01 using terminal software such as CoolTerm.   \n- GPIO2 must be pulled up.   \n- GPIO0 must be pulled up.   \n- CH_PD must be pulled up.   \n- RESET must be pulled up.   \n\n![esp01-setup](https://user-images.githubusercontent.com/6020549/33159150-bdade984-d053-11e7-9b93-bbbf05573441.jpg)\n\nConnect to ESP01 at 115200 bps using terminal software.   \n\n```\nAT+GMR\nAT version:1.6.2.0(Apr 13 2018 11:10:59)\nSDK version:2.2.1(6ab97e9)\ncompile time:Jun  7 2018 19:34:26\nBin version(Wroom 02):1.6.2\nOK\n\nAT+CWMODE=1\n\nOK\nAT+CWLAP\n+CWLAP:(3,\"Picking\",-86,\"34:12:98:08:4b:4a\",1,-4)\n+CWLAP:(4,\"ctc-g-fa4a2e\",-92,\"c0:25:a2:b1:8c:2e\",2,3)\n+CWLAP:(4,\"aterm-e625c0-g\",-49,\"c0:25:a2:ac:cb:ba\",3,15)\n+CWLAP:(1,\"aterm-e625c0-gw\",-48,\"c2:25:a2:ac:cb:ba\",3,15)\n\nOK\n\nAT+CWJAP=\"Your AP's SSID\",\"Your AP's password\"\nWIFI CONNECTED\nWIFI GOT IP\n\nOK\n\nAT+CIPSTA?\n+CIPSTA:ip:\"192.168.10.142\"\n+CIPSTA:gateway:\"192.168.10.1\"\n+CIPSTA:netmask:\"255.255.255.0\"\n\nOK\nAT+CWQAP\n\nOK\n```\n\nAT firmware has a function that automatically connects to the last connected AP when the module is reset.   \nUsing this function, you can omit the SSID and password.   \n\n```\nAT+RST\nWIFI CONNECTED\nWIFI GOT IP\nAT+CIPSTA?\n+CIPSTA:ip:\"192.168.10.142\"\n+CIPSTA:gateway:\"192.168.10.1\"\n+CIPSTA:netmask:\"255.255.255.0\"\n\nOK\n```\n\nIf you want to change the AP, execute the following command again.   \n```\nAT+CWJAP=\"New AP's SSID\",\"New AP's password\"\nWIFI CONNECTED\nWIFI GOT IP\n```\n\n# How to Firmware Upate\n\n1.Make sure TE(terminal equipment) is in sta mode   \n```\nAT+CWMODE=1\n\nOK\n```\n\n2.Make sure TE got ip address   \n```\nAT+CIPSTA?\n+CIPSTA:ip:\"192.168.10.115\"\n+CIPSTA:gateway:\"192.168.10.1\"\n+CIPSTA:netmask:\"255.255.255.0\"\n\nOK\n```\n\n3.Let's update   \n```\nAT+CIUPDATE\n+CIPUPDATE:1    found server\n+CIPUPDATE:2    connect server\n+CIPUPDATE:3    got edition\n+CIPUPDATE:4    start start\n\nOK\n```\n\n4.Check firmware version   \n```\nAT+GMR\nAT version:1.7.5.0(Oct 20 2021 19:14:04)\nSDK version:3.0.5(b29dcd3)\ncompile time:Oct 20 2021 20:13:50\nBin version(Wroom 02):1.7.5\nOK\n```\n\n# Connect ESP01 to HOST   \n- ESP01(Tx)  - UART-RX port of host   \n- ESP01(Rx)  - UART-TX port of host   \n- ESP01(Gnd) - Gnd of host   \n- ESP01(3v3) - 3V3 of host(*1)   \n\n(*1) It is necessary to be able to supply sufficient current.   \n\n### Know your UART device   \n```\nls /dev/tty*\n/dev/tty  /dev/ttyFIQ0  /dev/ttyS3  /dev/ttyS4\n```\n\n### For LuckFox Pico buildroot   \nYou can use /dev/ttyS3 and /dev/ttyS4.   \n/dev/ttyS3 is IO56(TX)/IO57(RX).   \n/dev/ttyS4 is IO53(TX)/IO52(RX).   \n\n# Retrieving files from github   \n\n### Get files using git   \nIn environments where networking is supported, use git to retrieve the files.   \n```\ngit clone https://github.com/nopnop2002/python-esp8266\n```\n\n### Get files using RNDIS   \nIn environments where networking is not supported, use RNDIS to retrieve the files.   \nUbuntu 20.04/Debian 11 is required as the RNDIS server.   \nIn the Ubuntu 22.04/Debian 12 environment, the usb0 interface has been changed to a \"consistent network device naming method\".   \n\nClone to RNDIS server.\n```\ngit clone https://github.com/nopnop2002/python-esp8266\n```\n\nWhen power is supplied to the RNDIS client from the Ubuntu/Dibian machine, the USB0 interface will be displayed on the Ubuntu/Debian side as shown below.   \n```\n$ sudo ifconfig usb0\nusb0: flags=4163\u003cUP,BROADCAST,RUNNING,MULTICAST\u003e  mtu 1500\n        inet6 fe80::a742:1ab5:c616:d016  prefixlen 64  scopeid 0x20\u003clink\u003e\n        ether 7a:da:62:7c:d5:bb  txqueuelen 1000  (Ethernet)\n        RX packets 21  bytes 2169 (2.1 KB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 39  bytes 8001 (8.0 KB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\n$ nmcli conn show\nNAME        UUID                                  TYPE      DEVICE\nWired connection 2  ea035181-2f58-3f41-bf2b-89c5022bb4e0  ethernet  usb0\nWired connection 1  5bfff474-56e9-3a46-81d7-3b3a7d5692d7  ethernet  enp4s0\n```\n\nAssign a fixed IP address to usb0 interface using the nmcli command.   \nThe fixed IP address assigned to the Ubuntu/Debian side can be any as long as it is on the same segment as the RNDIS client board.   \n```\n$ sudo nmcli connection down \"Wired connection 2\"\n$ sudo nmcli connection modify \"Wired connection 2\" ipv4.addresses \"172.32.0.100/16\"\n$ sudo nmcli connection modify \"Wired connection 2\" ipv4.method manual\n$ sudo nmcli connection up \"Wired connection 2\"\n$ nmcli device show usb0\nGENERAL.DEVICE:                         usb0\nGENERAL.TYPE:                           ethernet\nGENERAL.HWADDR:                         DA:1F:7F:84:10:69\nGENERAL.MTU:                            1500\nGENERAL.STATE:                          100 (connected)\nGENERAL.CONNECTION:                     Wired connection 2\nGENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/6\nWIRED-PROPERTIES.CARRIER:               �I��\nIP4.ADDRESS[1]:                         172.32.0.100/16\nIP4.GATEWAY:                            --\nIP4.ROUTE[1]:                           dst = 172.32.0.0/16, nh = 0.0.0.0, mt = 101\nIP6.ADDRESS[1]:                         fe80::f220:3c47:db11:8fbe/64\nIP6.GATEWAY:                            --\nIP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 101\n```\n\nCheck the result with ifconfig.\n```\n$ sudo ifconfig usb0\nusb0: flags=4163\u003cUP,BROADCAST,RUNNING,MULTICAST\u003e  mtu 1500\n        inet 172.32.0.100  netmask 255.255.0.0  broadcast 172.32.255.255\n        inet6 fe80::f220:3c47:db11:8fbe  prefixlen 64  scopeid 0x20\u003clink\u003e\n        ether da:1f:7f:84:10:69  txqueuelen 1000  (Ethernet)\n        RX packets 53  bytes 7107 (7.1 KB)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 109  bytes 19284 (19.2 KB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n```\n\nNow you can ping the RNDIS client and use ssh and scp.\n```\n$ ping 173.32.0.93\nPING 173.32.0.93 (192.168.10.45) 56(84) bytes of data.\n64 bytes from 192.168.10.45: icmp_seq=1 ttl=64 time=0.607 ms\n64 bytes from 192.168.10.45: icmp_seq=2 ttl=64 time=0.365 ms\n64 bytes from 192.168.10.45: icmp_seq=3 ttl=64 time=0.268 ms\n64 bytes from 192.168.10.45: icmp_seq=4 ttl=64 time=0.373 ms\n^C\n--- 173.32.0.93 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3059ms\nrtt min/avg/max/mdev = 0.268/0.403/0.607/0.124 ms\n\n$ scp -r python-esp8266 root@172.32.0.93:/root\nroot@172.32.0.93's password:\n```\n\n# How to use in Ubuntu/Debian environment   \n```\ncd python-esp8266/connectWiFi\n\n# Root privileges are required on Ubuntu/Debian\nsudo -E python3 main.py --device /dev/ttyS3\n\ndevice=/dev/ttyS3\nspeed=115200\ndebug=False\nip=['192.168.10.108', '192.168.10.1', '192.168.10.1']\nmac=5c:cf:7f:6b:00:1b\n```\n\n# How to use in buildroot environment   \n```\ncd python-esp8266/connectWiFi\n\n# buildroot does not require root privileges\npython3 main.py --device /dev/ttyS3\n\ndevice=/dev/ttyS3\nspeed=115200\ndebug=False\nip=['192.168.10.108', '192.168.10.1', '192.168.10.1']\nmac=5c:cf:7f:6b:00:1b\n```\n\n# UART communication dedicated module   \nWe can get a module for UART communication.   \nWe can write AT firmware to this.   \nIt has a 5V-\u003e3.3V regulator and can supply power directly from 5V.   \nAlthough it supplies 5V power, the TTL level of UART is 3.3V.   \n![ESP-UART-MODULE-1](https://user-images.githubusercontent.com/6020549/104827197-b504cd80-589e-11eb-95a8-f12c75670ced.JPG)\n\n![ESP-UART-MODULE-2](https://user-images.githubusercontent.com/6020549/104827200-b8985480-589e-11eb-9a01-e70d4fbd55cc.JPG)\n\n# ESP01 Adapter board\nOnly $1 for AliExpress/eBay.   \nExternal pin header is 5V,GND,TXD,RXD.   \nIt has a 5V-\u003e3.3V regulator and can supply power directly from 5V.   \nAlthough it supplies 5V power, the TTL level of UART is 3.3V.   \n![ESP01-Adapter-3](https://user-images.githubusercontent.com/6020549/120063987-f3a86100-c0a4-11eb-95e4-c87164812af4.JPG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fpython-esp8266","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnopnop2002%2Fpython-esp8266","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnopnop2002%2Fpython-esp8266/lists"}