{"id":20368225,"url":"https://github.com/martinvichnal/esp-iot-lamp","last_synced_at":"2026-05-07T20:40:53.791Z","repository":{"id":162315241,"uuid":"636442067","full_name":"martinvichnal/ESP-IoT-Lamp","owner":"martinvichnal","description":"This is a really simple Open Source WiFi smart lamp project with ESP32 and WS2812B LEDs","archived":false,"fork":false,"pushed_at":"2023-08-20T15:37:29.000Z","size":125,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T19:45:05.126Z","etag":null,"topics":["esp32","smarthome","smartlamp","wifi","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"C++","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/martinvichnal.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}},"created_at":"2023-05-04T21:23:57.000Z","updated_at":"2024-11-19T02:00:46.000Z","dependencies_parsed_at":"2023-08-20T17:10:38.456Z","dependency_job_id":null,"html_url":"https://github.com/martinvichnal/ESP-IoT-Lamp","commit_stats":null,"previous_names":["martinvichnal/esp_iot_project","martinvichnal/esp-iot-lamp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/martinvichnal/ESP-IoT-Lamp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinvichnal%2FESP-IoT-Lamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinvichnal%2FESP-IoT-Lamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinvichnal%2FESP-IoT-Lamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinvichnal%2FESP-IoT-Lamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinvichnal","download_url":"https://codeload.github.com/martinvichnal/ESP-IoT-Lamp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinvichnal%2FESP-IoT-Lamp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32755487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"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":["esp32","smarthome","smartlamp","wifi","ws2812b"],"created_at":"2024-11-15T00:39:44.937Z","updated_at":"2026-05-07T20:40:53.775Z","avatar_url":"https://github.com/martinvichnal.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP-IoT-Lamp\n![](https://img.shields.io/github/v/release/martinvichnal/ESP_IOT_Project)\n![](https://img.shields.io/github/last-commit/martinvichnal/ESP_IOT_Project)\n![](https://img.shields.io/github/issues/martinvichnal/ESP_IOT_Project)\n\n------------------------------------------------------------------------------------------------------------------------------\n\n## Introduction\nThis is a really simple Open Source WiFi smart lamp repository. This project was built with Espressif ESP32 and WS2812B LEDs controlled by FastLED library.\nThe main goal was to build a Smart Lamp that you controll with your phone.\n\n- *Feel free to **improve use or fork** this repository in your own projects, just mention me on it :)*\n- *For any bugs or improvements feel free to make an [issue](https://github.com/martinvichnal/ESP_IOT_Project/issues) or make a [pull request](https://github.com/martinvichnal/ESP_IOT_Project/pulls)*\n\n\n\n------------------------------------------------------------------------------------------------------------------------------\n\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Table of Contents](#table-of-contents)\n- [Usage](#usage)\n\t - [Basic Controls](#basic-controls) \n- [Installation](#installation)\n    - [Hardware Requirements](#hardware-requirements)\n    - [Software Requirements](#software-requirements)\n- [Communication](#communication)\n- [Flow Charts](#flow-charts)\n    - [WiFi Manager](#wifi-manager)\n    - [Blending](#blending)\n- [Mentions](#mentions)\n\n------------------------------------------------------------------------------------------------------------------------------\n\n\n## Usage\n- Connect your LEDs to [this](https://github.com/martinvichnal/ESP_IOT_Project/blob/b9c0bc6115a8d086cfb76bf80369942787a9aea7/src/main.cpp#LL111C42-L111C42)\n```C++\n#define LED_PIN 5                // Led DATA output\n```\n- To use this code first you need to set your home WiFi SSID and PASS in the [following code](https://github.com/martinvichnal/ESP_IOT_Project/blob/ecf1069e504b3fa3c4f153a6b806b2fd85c221e6/src/main.cpp#L80):\n```C++\n// Replace with your network credentials\nconst char *ssid = \"your SSID\";\nconst char *password = \"your PASS\";\n```\n- Upload\n- When the ESP has connected to your home internet it will put out a message in the serial monitor with the IP adress.\n- Copy it then paste it in your web. (Disclaimer! you need to be connected to the same internet as your ESP)\n\n*In further versions you won't have to hard code your credentials.*\n\n### Basic Controls\nThe lamp has 3 main effects: ***Rainbow***, ***Colors Fade*** and ***Custom Color***.\nYou can controll the brightness of the leds, in one mode you can controll the hue of the leds and in 2 of the modes you can controll the speed too.\n\n\n\n------------------------------------------------------------------------------------------------------------------------------\n\n## Installation\n\n### Hardware Requirements\n- Board: ***ESP32***\n- Light: ***WS2812B***, 30 LEDs in total\n- Power supply: ***18650 battery*** and ***MP2636 charger board***\n\n### Software Requirements\n- Operating System: ***ALL***\n- Programming environment: ***Visual Studio Code - PlatformIO***\n- Programming language: ***C++***\n- Additional dependencies or libraries:\n```C++\n#include \u003cArduino.h\u003e\n#include \u003cWiFi.h\u003e\n#include \u003cDNSServer.h\u003e\n#include \u003cAsyncTCP.h\u003e\n#include \u003cESPAsyncWebServer.h\u003e\n// https://community.platformio.org/t/solved-asyncelegantota-collect2-exe-error-ld-returned-1-exit-status/28553\n#include \u003cAsyncElegantOTA.h\u003e\n#include \u003cArduinoJson.h\u003e\n#include \u003cFastLED.h\u003e\n#include \"FileSystem.h\"\n#include \"Cipher.h\" // For encryption\n```\n\n------------------------------------------------------------------------------------------------------------------------------\n\n\n## Communication\nThe ESP is communicating via WebSockets and in that it is passing JSON file which is looks like this:\n```JSON\n{\n   \"state\":0,\n   \"mode\":2,\n   \"brightnessValue\":255,\n   \"speedValue\":25,\n   \"rgbValue\":125\n}\n```\n| Name | Value | Description |\n| ----------- | ----------- | ----------- |\n| \"state\" | 1/0, true/false | On/Off state |\n| \"mode\" | 0..2 | Mode select |\n| \"brightnessValue\" | 0..255 | Brightness |\n| \"speedValue\" | 0..100 | Speed in two modes |\n| \"rgbValue\" | 0..255 | Hue value in one mode |\n\n\n------------------------------------------------------------------------------------------------------------------------------\n\n\n## Flow Charts\n\nThis flow chart section contains main functions for easy understanding.\n\n### WiFi Manager\nThis fucntion the initWiFi() where the ESP basically manages the wifi connection.\nThis fucnion is not running in setup() or loop() (so it runs in one of the cores) because then it wouldn't do anything untill you are connected to the internet. This is important because the lamp can be used as a standalone unit (eg. using it withount any internet) just have to put it in some buttons lol\n```mermaid\nflowchart TD\n    initWiFi[\"initWiFi()\"] --\u003e TryToConnectNetwork[Trying to connect to network]\n    TryToConnectNetwork --\u003e TryingForSec[Trying For 'tryForMs' Sec]\n    TryingForSec --\u003e Success{Success ?}\n    Success --\u003e|YES| initServer[Initializing WebServer and WebSocket]\n    Success --\u003e|NO| initWifiManager[\"initWiFiManager()\"]\n\n    initServer --\u003e exitInitWifi[\"Exiting initWiFi()\"]\n\n    initWifiManager --\u003e startWebserverWifiManager[\"Starting servers with AP\"]\n    startWebserverWifiManager --\u003e GettingPWSSID[\"Waiting for PW and SSID\"]\n    GettingPWSSID --\u003e SuccessPWSSID{Success ?}\n    SuccessPWSSID --\u003e|YES| Restart\n    SuccessPWSSID --\u003e|NO| initWifiManager[\"initWiFiManager()\"]\n\n    Restart --\u003e initWiFi\n```\n\n### Blending\nBlending fucntion is just a \"Nice to have\" part of the code. This is blending two led sources when mode change happened.\nLittle buggy at the moment. issue: #2\n```mermaid\nflowchart TD\n\n    ModeChanged{\"Mode Changed ?\"}\n    ModeChanged --\u003e|NO| runPatternActualMode1[\"runPattern(actualMode, leds)\"]\n    ModeChanged --\u003e|YES| runPatternActualMode2[\"runPattern(actualMode, source1)\"]\n    runPatternActualMode2 --\u003e runPatternNewMode[\"runPattern(newMode, source2)\"]\n    runPatternNewMode --\u003e blend[\"blend(source1, source2, leds, NUM_LEDS, blendAmount)\"]\n    blend --\u003e blendIs255{\"blendAmount == 255\"}\n    blendIs255 --\u003e|YES| actualModeIsTheNewMode[\"actualMode = newMode\"]\n    actualModeIsTheNewMode --\u003e ModeChangedisFalse[\"Mode Changed = false\"]\n    ModeChangedisFalse --\u003e blendAmountIs0[\"blendAmount = 0\"]\n\n    blendIs255 --\u003e|NO| blendAmountInc[\"blendAmount++\"]\n```\n\n\n------------------------------------------------------------------------------------------------------------------------------\n\n## Mentions\nThis project would not be here without these repositories so huge thanks :)\n\n[alanswx/ESPAsyncWiFiManager](https://github.com/alanswx/ESPAsyncWiFiManager),\n[kurimawxx00/wifi-manager](https://github.com/kurimawxx00/wifi-manager),\n[me-no-dev/ESPAsyncWebServer](https://github.com/me-no-dev/ESPAsyncWebServer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinvichnal%2Fesp-iot-lamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinvichnal%2Fesp-iot-lamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinvichnal%2Fesp-iot-lamp/lists"}