{"id":15976994,"url":"https://github.com/senglk/micropython-neopixel-web-control","last_synced_at":"2025-04-04T17:47:40.218Z","repository":{"id":219693715,"uuid":"210103266","full_name":"senglk/microPython-NeoPixel-Web-Control","owner":"senglk","description":"A micropython script where NeoPixel LED color cycles while webserver receives commands to turn on or off the LED","archived":false,"fork":false,"pushed_at":"2019-09-22T08:03:19.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T03:13:59.105Z","etag":null,"topics":["micropython","micropython-script","neopixel","uasyncio"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senglk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-09-22T06:47:47.000Z","updated_at":"2022-08-07T20:42:39.000Z","dependencies_parsed_at":"2024-01-29T08:09:53.730Z","dependency_job_id":null,"html_url":"https://github.com/senglk/microPython-NeoPixel-Web-Control","commit_stats":null,"previous_names":["senglk/micropython-neopixel-web-control"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senglk%2FmicroPython-NeoPixel-Web-Control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senglk%2FmicroPython-NeoPixel-Web-Control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senglk%2FmicroPython-NeoPixel-Web-Control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senglk%2FmicroPython-NeoPixel-Web-Control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senglk","download_url":"https://codeload.github.com/senglk/microPython-NeoPixel-Web-Control/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226199,"owners_count":20904464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["micropython","micropython-script","neopixel","uasyncio"],"created_at":"2024-10-07T22:41:50.239Z","updated_at":"2025-04-04T17:47:40.200Z","avatar_url":"https://github.com/senglk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microPython-NeoPixel-Web-Control\n\n## Introduction\n\nA micropython script where NeoPixel LED color cycles while webserver receives commands to turn on or off the LED.\n\nThis sample script starts a webserver which receives requests to turn on or off the NeoPixel LED. Upon receiving a `/?led=on` request, the NeoPixel LED will light up and color cycle. The NeoPixel LED will switch off upon receiving a `/?led=off` request.\n\nThe script is referenced from the tutorial [Raspberry Pi ESP32 MicroPython Tutorial](https://www.rototron.info/raspberry-pi-esp32-micropython-tutorial/), the tutorial [ESP32/ESP8266 MicroPython Web Server - Control Outputs](https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/), and asynchronous programming example [Demo of Simple uasyncio-Based Echo Server](https://github.com/peterhinch/micropython-async/blob/master/client_server/userver.py).\n\nIn particular, the 2 tutorials mentioned above does go into how to set up micropython on the ESP32 if this is your first time. I would recommend following at least 1 of the 2 tutorials above so that at least micropython is loaded onto the ESP32.\n\n## Prerequisites\n\n### MicroPython\n\nThis script was written for [MicroPython v1.11](http://docs.micropython.org/en/v1.11/).\n\n### uasyncio\n\nA library for [Asynchronous Programming in MicroPython](https://github.com/peterhinch/micropython-async).\n\nYou can install uasncio library in REPL with (the ESP32 needs to be connected to the internet):\n````\n\u003e\u003e\u003e import upip\n\u003e\u003e\u003e upip.install('micropython-uasyncio')\n````\n\nThis will install the uasyncio library in a `/pyboard/lib/uasyncio/` in the case of MicroPyton on ESP32.\n\nFor more information please refer to [installing uasyncio on bare metal](https://github.com/peterhinch/micropython-async/blob/master/TUTORIAL.md#01-installing-uasyncio-on-bare-metal) or [application of uasyncio to hardware interfaces](https://github.com/peterhinch/micropython-async/blob/master/TUTORIAL.md).\n\n## Usage\n\n### Updating the Pin Number\n\nThe pin number would also need to be changed to the pin number of the GPIO data pin connected to the data pin of the NeoPixel.\n\nCurrently the pin number follows the pin numbering in [Raspberry Pi ESP32 MicroPython Tutorial](https://www.rototron.info/raspberry-pi-esp32-micropython-tutorial/).\n\n### Updating the WiFi SSID and Password\n\nPlease update with the SSID and Password in the line that calls `ap.config()`. This will be the SSID and password that will be used to connect to the ESP32. Currently this is set as `essid='yourSSID'` and `password='yourPassword'`, respectively.\n\n### Uploading the Script\n\nThe script will then need to be uploaded into the ESP32. This can be done in many ways such as [uPyCraft IDE](https://randomnerdtutorials.com/install-upycraft-ide-windows-pc-instructions/) or [rshell](https://github.com/dhylands/rshell). If the file is uploaded as `main.py`, it will start automatically on reset.\n\n### Starting the Script\n\nYou can start the script by soft resetting by pressing `Ctrl+D` on a blank line in REPL or by pressing `EN` on the ESP32 board.\n\n### Controlling On and Off\n\nAfter resetting the ESP32 board, connect to the Access Point broadcasted by the ESP32 based on the SSID and Password in the script, and connect to the IP address of the ESP32. This address should be `192.168.4.1`. For more information about ESP32 Access Point, see [this link](https://randomnerdtutorials.com/esp32-access-point-ap-web-server/). A webpage should pop up with On and Off buttons, which when pressed will switch the NeoPixel LED on or off, respectively. Note that the script starts the NeoPixel LED in an off state.\n\n### Terminating the Script\n\nYou can terminate the script by pressing `Ctrl+C` in REPL, or by simply powering down the ESP32.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenglk%2Fmicropython-neopixel-web-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenglk%2Fmicropython-neopixel-web-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenglk%2Fmicropython-neopixel-web-control/lists"}