{"id":18074350,"url":"https://github.com/zellyn/weblight","last_synced_at":"2025-04-05T18:45:13.916Z","repository":{"id":242171342,"uuid":"808875169","full_name":"zellyn/weblight","owner":"zellyn","description":"esp-idf project for XIAO ESP32C3 + NeoPixel web-controllable lights","archived":false,"fork":false,"pushed_at":"2024-06-14T02:23:15.000Z","size":1043,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T19:03:25.343Z","etag":null,"topics":["esp32-c3","neopixel"],"latest_commit_sha":null,"homepage":"","language":"C","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/zellyn.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-06-01T03:30:43.000Z","updated_at":"2024-06-14T02:23:18.000Z","dependencies_parsed_at":"2024-10-31T10:12:27.467Z","dependency_job_id":"da997759-c7cc-413b-9979-9a862eed0fa7","html_url":"https://github.com/zellyn/weblight","commit_stats":null,"previous_names":["zellyn/web_light","zellyn/weblight"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zellyn%2Fweblight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zellyn%2Fweblight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zellyn%2Fweblight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zellyn%2Fweblight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zellyn","download_url":"https://codeload.github.com/zellyn/weblight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247385623,"owners_count":20930599,"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":["esp32-c3","neopixel"],"created_at":"2024-10-31T10:12:20.557Z","updated_at":"2025-04-05T18:45:13.894Z","avatar_url":"https://github.com/zellyn.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"WebLight\n========\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --\u003e\n**Table of Contents**\n\n- [WebLight](#weblight)\n- [Reference information](#reference-information)\n    - [Neopixels](#neopixels)\n        - [Through-hole LED form-factor pinout](#through-hole-led-form-factor-pinout)\n    - [XIAO ESP32-C3](#xiao-esp32-c3)\n        - [Pinout](#pinout)\n- [Purchasing links](#purchasing-links)\n    - [Batteries](#batteries)\n    - [NeoPixels](#neopixels)\n        - [The ones that ended up working well:](#the-ones-that-ended-up-working-well)\n        - [Untried ones](#untried-ones)\n        - [Other links:](#other-links)\n    - [XIAO ESP32C3](#xiao-esp32c3)\n- [ESP-IDF](#esp-idf)\n    - [Links](#links)\n    - [Creating a new esp-idf project from scratch](#creating-a-new-esp-idf-project-from-scratch)\n    - [Running a project](#running-a-project)\n    - [Monitoring](#monitoring)\n        - [With `idf.py`](#with-idfpy)\n        - [With `emacs`](#with-emacs)\n        - [Discovering the port](#discovering-the-port)\n- [Sources / Acknowledgements](#sources--acknowledgements)\n\n\u003c!-- markdown-toc end --\u003e\n\n\nThis is an attempt to recreate the simple and cheap XIAO ESP32-C3 /\nNeoPixel light seen in [bleeptrack](https://www.bleeptrack.de/)'s\n[paper stars video](https://www.youtube.com/watch?v=MRfAjHKRlBU).\n\nThey were kind enough to\n[reply on mastodon](https://hachyderm.io/@zellyn/111621948922719858) with\nhardware details, thus kick-starting my first ESP32 programming attempt.\nApparently I can still solder a bit. Who knew?\n\n# Reference information\n\n## Neopixels\n\n### Through-hole LED form-factor pinout\n![Through-hole LED form-factor pinout](./img/neopixel-8mm-pins.jpg)\n\n## XIAO ESP32-C3\n\n### Pinout\n![pinout](./img/pinout-xiao-esp32-c3.png)\n\n# Purchasing links\n\n## Batteries\nIt seems that 3.7V LiPo batteries are fairly standard for hobby use,\nand will drive neopixels. \"1S\" is a single cell, the most basic\nconfiguration. [This brushlesswhoop.com\npost](https://brushlesswhoop.com/blog/battery-specifications/) has a\nprimer on LiPo batteries.\n\nThese are cheap, and either have fragile connectors, or I haven't managed to find matching connectors yet:\n- Amazon: 1S LiPo batteries x5 for $16 with charger: https://www.amazon.com/dp/B0CHFG457D\n- These connectors DID NOT FIT (they just broke off the pins):\n  https://www.amazon.com/gp/product/B08H7WZJND -- if anyone knows how\n  to match those cheap batteries with the correct connectors, please\n  tell me.\n\n## NeoPixels\n\n### The ones that ended up working well:\n\n- adafruit NeoPixel Diffused 8mm Through-Hole LED - 5 Pack: https://www.adafruit.com/product/1734\n- adafruit NeoPixel Diffused 5mm Through-Hole LED - 5 Pack: https://www.adafruit.com/product/1938\n\n### Untried ones\n\nThese were too small for me to solder:\n\n- adafruit 10x neopixel for $4.50: https://www.adafruit.com/product/1655\n\nI haven't tried cheap strips of WS2812/WS2812B-compatible LEDs, like this:\n\n- Amazon: Strip of 60 for $9.99: [link](https://www.amazon.com/dp/B01CDTED80)\n\n### Other links:\n\n- Instructable: https://www.instructables.com/Getting-Started-With-NeoPixle-WS2812-RGB-LED/\n- Tim's blog: https://cpldcpu.wordpress.com/category/led/\n- https://hackaday.com/2017/01/25/ws2812b-led-clones-work-better-than-originals/\n- https://learn.adafruit.com/adafruit-neopixel-uberguide/the-magic-of-neopixels\n\n## XIAO ESP32C3\n\nThe [XIAO ESP32C3](https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html)\nis notable for having an integrated battery controller: you can solder\nthe leads of a 1S LiPo battery to the pads, and it will charge it and\nuse it for power.\n\n- Excellent seeed studio [XIAO ESP32C3 Getting Started Guide](https://wiki.seeedstudio.com/XIAO_ESP32C3_Getting_Started/)\n- sigmdel.ca evaluation: [link](https://sigmdel.ca/michel/ha/xiao/xiao_esp32c3_intro_en.html)\n\n# ESP-IDF\n\n## Links\n\n- IDF (IoT Development Framework) homepage with chip choice: https://idf.espressif.com/\n- ESP32-C3 Getting started: [link](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c3/get-started/index.html)\n- Component registry: https://components.espressif.com/\n  - led_strip: [link](https://components.espressif.com/components/espressif/led_strip/versions/2.5.3)\n  - API Guides » Tools » IDF Component Manager: [link](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c3/api-guides/tools/idf-component-manager.html)\n  - IDF Component Manager and ESP Component Registry Documentation: [link](https://docs.espressif.com/projects/idf-component-manager/en/latest/)\n\n## Creating a new esp-idf project from scratch\n\nIt's easiest to copy and modify examples, but it's not always obvious\nwhat's necessary and what's not. Creating a new project from scratch\nis easy.\n\n```shell\nidf.py create-project weblight\ncd weblight\nidf.py add-dependency \"espressif/led_strip^2.5.3\"\nidf.py set-target esp32c3\n\necho build/ managed_components/ sdkconfig.old | tr ' ' '\\n' \u003e\u003e .gitignore\necho sdkconfig \u003e\u003e .gitignore # Good idea?\n\ngit init .\ngit checkout -b main\n```\n\n## Running a project\n\n```shell\n# Configure the Wifi details under \"Weblight\"\nidf.py menuconfig\nidf.py build\nidf.py flash\n```\n\n## Monitoring\n\n### With `idf.py`\n\n`idf.py monitor` will monitor the ESP32-C3 serial console. It's a\nlittle tricky to get out of, since it's passing most keypresses\nthrough. The command prefix is `ctrl-t`:\n\n- help: `ctrl-t` `ctrl-h`\n- exit: `ctrl-t` `ctrl-x`\n\n### With `emacs`\n\n`M-x serial-term` will create a new serial terminal.\n\n- Serial port: /dev/ttyA[TAB]\n- Baud: 115200\n\n`C-c` is the command prefix. For example, to do a normal `M-x` command, type `C-c` `M-x`.\n\n### Discovering the port\n\nAt least on my Raspberry Pi, I could find it with `ls /dev/ttyA*` --\nit's the only thing named that way. Fortunately, `idf.py flash` and\n`idf.py monitor` seem to usually be able to figure out the port.\n\n# Sources / Acknowledgements\n\n- `led_strip` code copied from [led_strip/examples/.../led_strip_rmt_ws2812_main.c](https://github.com/espressif/idf-extra-components/blob/master/led_strip/examples/led_strip_rmt_ws2812/main/led_strip_rmt_ws2812_main.c)\n- HSV conversion copied from [examples/peripherals/rmt/led_strip/main/led_strip_example_main.c](https://github.com/espressif/esp-idf/blob/master/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c)\n- wifi code copied from [examples/wifi/getting_started/station/main/station_example_main.c](https://github.com/espressif/esp-idf/blob/v5.2.1/examples/wifi/getting_started/station/main/station_example_main.c)\n- webserver code copied from [examples/protocols/http_server/simple/main/main.c](https://github.com/espressif/esp-idf/blob/master/examples/protocols/http_server/simple/main/main.c)\n- url encode/decode copied from [examples/common_components/protocol_examples_common/protocol_examples_utils.c](https://github.com/espressif/esp-idf/blob/master/examples/common_components/protocol_examples_common/protocol_examples_utils.c)\n- hsv conversion code copied from [examples/peripherals/rmt/led_strip/main/led_strip_example_main.c](https://github.com/espressif/esp-idf/blob/master/examples/peripherals/rmt/led_strip/main/led_strip_example_main.c)\n\n# Log\n\n## Getting a simple LED chaser to work\n\n![chaser and PI](./img/led-chaser.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzellyn%2Fweblight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzellyn%2Fweblight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzellyn%2Fweblight/lists"}