{"id":21810923,"url":"https://github.com/vshymanskyy/blynk-library-lua","last_synced_at":"2025-04-13T22:11:40.572Z","repository":{"id":145664574,"uuid":"149600625","full_name":"vshymanskyy/blynk-library-lua","owner":"vshymanskyy","description":"Blynk library for Lua. Works with Lua 5.1+, LuaJIT, NodeMCU.","archived":false,"fork":false,"pushed_at":"2023-02-22T14:32:52.000Z","size":48,"stargazers_count":41,"open_issues_count":3,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-10T17:20:37.261Z","etag":null,"topics":["blynk","esp32","esp8266","iot","lua","lua-library","luajit","openwrt"],"latest_commit_sha":null,"homepage":"https://blynk.io/","language":"Lua","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/vshymanskyy.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":"2018-09-20T11:44:45.000Z","updated_at":"2023-12-18T13:22:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f757b023-58b5-4ecc-a5e5-ba08044034db","html_url":"https://github.com/vshymanskyy/blynk-library-lua","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2Fblynk-library-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2Fblynk-library-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2Fblynk-library-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vshymanskyy%2Fblynk-library-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vshymanskyy","download_url":"https://codeload.github.com/vshymanskyy/blynk-library-lua/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788921,"owners_count":21161727,"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":["blynk","esp32","esp8266","iot","lua","lua-library","luajit","openwrt"],"created_at":"2024-11-27T13:38:47.465Z","updated_at":"2025-04-13T22:11:40.559Z","avatar_url":"https://github.com/vshymanskyy.png","language":"Lua","readme":"# Lua client for Blynk IoT\n\n**Note:** The library has been updated for Blynk 2.0\n\n[![GitHub version](https://img.shields.io/github/release/vshymanskyy/blynk-library-lua.svg)](https://github.com/vshymanskyy/blynk-library-lua/releases/latest)\n[![GitHub download](https://img.shields.io/github/downloads/vshymanskyy/blynk-library-lua/total.svg)](https://github.com/vshymanskyy/blynk-library-lua/releases/latest)\n[![GitHub stars](https://img.shields.io/github/stars/vshymanskyy/blynk-library-lua.svg)](https://github.com/vshymanskyy/blynk-library-lua/stargazers)\n[![GitHub issues](https://img.shields.io/github/issues/vshymanskyy/blynk-library-lua.svg)](https://github.com/vshymanskyy/blynk-library-lua/issues)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vshymanskyy/blynk-library-lua/blob/master/LICENSE)\n\nIf you like **Blynk** - give it a star, or fork it and contribute! \n[![GitHub stars](https://img.shields.io/github/stars/blynkkk/blynk-library.svg?style=social\u0026label=Star)](https://github.com/blynkkk/blynk-library/stargazers) \n[![GitHub forks](https://img.shields.io/github/forks/blynkkk/blynk-library.svg?style=social\u0026label=Fork)](https://github.com/blynkkk/blynk-library/network)\n__________\n\n## What is Blynk?\nBlynk provides **iOS** and **Android** apps to control any hardware **over the Internet** or **directly using Bluetooth**.\nYou can easily build graphic interfaces for all your projects by simply dragging and dropping widgets, **right on your smartphone**.\nBlynk is **the most popular IoT platform** used by design studios, makers, educators, and equipment vendors all over the world.\n\n![Blynk Banner](https://github.com/blynkkk/blynkkk.github.io/blob/master/images/GithubBanner.jpg)\n\n## Download\n\n**Blynk Mobile App:\n[\u003cimg src=\"https://cdn.rawgit.com/simple-icons/simple-icons/develop/icons/googleplay.svg\" width=\"18\" height=\"18\" /\u003e Google Play](https://play.google.com/store/apps/details?id=cloud.blynk) | \n[\u003cimg src=\"https://cdn.rawgit.com/simple-icons/simple-icons/develop/icons/apple.svg\" width=\"18\" height=\"18\" /\u003e App Store](https://apps.apple.com/us/app/blynk-iot/id1559317868)**\n\n## Documentation\nSocial: [Webpage](http://www.blynk.cc) / [Facebook](http://www.fb.com/blynkapp) / [Twitter](http://twitter.com/blynk_app) / [Kickstarter](https://www.kickstarter.com/projects/167134865/blynk-build-an-app-for-your-arduino-project-in-5-m/description)  \nDocumentation: https://docs.blynk.io  \nCommunity Forum: http://community.blynk.cc  \nBlynk for Business: http://www.blynk.io\n\n## Usage example\n\n```lua\nlocal Blynk = require(\"blynk.socket\")\n\nlocal blynk = Blynk.new(\"your_auth_token\")\n\n-- callback to run when V1 changes\nblynk:on(\"V1\", function(param)\n  print(\"V1:\", tonumber(param[1]), tonumber(param[2]))\nend)\n\n-- callback to run when cloud requests V2 value\nblynk:on(\"readV2\", function(param)\n  blynk:virtualWrite(2, os.time())\nend)\n\nlocal sock = getSocketConnection() -- omitted\nblynk:connect(sock)\n\nwhile true do\n  blynk:run()\nend\n```\n\nYou can run the [full example](examples/client.lua):\n\n```sh\nlua ./examples/client.lua \u003cyour_auth_token\u003e\n```\n\n## Features\n- **Lua 5.1, Lua 5.2, Lua 5.3, LuaJIT** support\n- **\u003cimg src=\"https://cdn.rawgit.com/simple-icons/simple-icons/develop/icons/linux.svg\" width=\"18\" height=\"18\" /\u003e Linux,\n\u003cimg src=\"https://cdn.rawgit.com/simple-icons/simple-icons/develop/icons/windows.svg\" width=\"18\" height=\"18\" /\u003e Windows,\n\u003cimg src=\"https://cdn.rawgit.com/simple-icons/simple-icons/develop/icons/apple.svg\" width=\"18\" height=\"18\" /\u003e MacOS** support\n- `virtualWrite`\n- `syncVirtual`\n- `setProperty`\n- `logEvent`\n- events: `Vn`, `readVn`, `connected`, `disconnected`, `redirect`\n- `TCP` and secure `TLS/SSL` connection support\n- can run on embedded hardware, like `NodeMCU` or `OpenWrt`\n\n## OpenWrt installation\n\n```sh\nopkg update\nopkg install lua luasocket luasec\n# openssl is needed for wget to handle https://\nopkg install wget openssl-util libustream-wolfssl\n\n# Get blynk-library-lua from github\ncd /root\nwget --no-check-certificate -qO- https://github.com/vshymanskyy/blynk-library-lua/archive/v0.2.0.tar.gz | tar xvz\ncd blynk-library-lua-0.2.0\n\n# Run it\nlua ./examples/client.lua \u003cyour_auth_token\u003e\n```\n\n## NodeMCU installation\n\nIt is very easy to get it running on NodeMCU (or any other `ESP8266`/`ESP32`-based device):\n- Get the latest [nodemcu-firmware](https://github.com/nodemcu/nodemcu-firmware) running on your device.  \n  You can use their [online build service](https://nodemcu-build.com/).  \n  It is recommended to include `encoder`, `TLS/SSL` modules.\n- Edit `nodemcu.lua` example (put your `auth token` and wifi credentials)\n- Use `nodemcu-tool` or any other method to transfer lua files to the device.  \n  **Note:** the NodeMCU filesystem is \"flat\" (folders not supported), but it handles the `/` symbol nicely.  \n  Be sure to preserve the relative path when copying files:\n    ```sh\n    nodemcu-tool upload -mck ./blynk.lua ./blynk/pipe.lua ./blynk/nodemcu.lua\n    nodemcu-tool upload ./examples/nodemcu.lua -n init.lua\n    ```\n- Open device terminal and run `dofile(\"init.lua\")`\n- `blynk` object is global, so you can call it from the interactive console:\n    ```lua\n    blynk:virtualWrite(1, tmr.time())\n    ```\n\n## Ubuntu/Linux/Raspberry Pi installation\n\n```sh\nsudo apt-get install lua5.3 lua-sec lua-socket\n```\n\n## Bonus\n\nThe `Timer` is included for demonstration purposes.  \nHere are also some handy functions:\n\n```lua\nlocal function millis()\n  return math.floor(socket.gettime()*1000)\nend\n\nlocal function delay(msec)\n  return socket.sleep(msec/1000)\nend\n```\n__________\n\n### Implementations for other platforms\n* [Arduino](https://github.com/blynkkk/blynk-library)\n* [Particle](https://github.com/vshymanskyy/blynk-library-spark)\n* [Node.js, Espruino, Browsers](https://github.com/vshymanskyy/blynk-library-js)\n* [Python, MicroPython](https://github.com/vshymanskyy/blynk-library-python)\n* [OpenWrt packages](https://github.com/vshymanskyy/blynk-library-openwrt)\n* [MBED](https://developer.mbed.org/users/vshymanskyy/code/Blynk/)\n* [Node-RED for Blynk IoT](https://flows.nodered.org/node/node-red-contrib-blynk-iot)\n* [LabVIEW](https://github.com/juncaofish/NI-LabVIEWInterfaceforBlynk)\n* [C#](https://github.com/sverrefroy/BlynkLibrary)\n\n### License\nThis project is released under The MIT License (MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvshymanskyy%2Fblynk-library-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvshymanskyy%2Fblynk-library-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvshymanskyy%2Fblynk-library-lua/lists"}