{"id":15033658,"url":"https://github.com/nicholas3388/luanode","last_synced_at":"2025-05-16T05:04:38.120Z","repository":{"id":37484443,"uuid":"53863000","full_name":"Nicholas3388/LuaNode","owner":"Nicholas3388","description":"Lua sdk for Esp32/Esp32c2/Esp32c3/Esp32c6/Esp8266/STM32L4","archived":false,"fork":false,"pushed_at":"2024-05-30T07:24:08.000Z","size":66138,"stargazers_count":1224,"open_issues_count":35,"forks_count":298,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-05-16T05:04:37.354Z","etag":null,"topics":["lua","script"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nicholas3388.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":"2016-03-14T14:28:03.000Z","updated_at":"2025-05-16T00:14:47.000Z","dependencies_parsed_at":"2024-01-05T20:59:18.024Z","dependency_job_id":"56863fa7-7a50-4d10-bfce-2c363262e215","html_url":"https://github.com/Nicholas3388/LuaNode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicholas3388%2FLuaNode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicholas3388%2FLuaNode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicholas3388%2FLuaNode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nicholas3388%2FLuaNode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nicholas3388","download_url":"https://codeload.github.com/Nicholas3388/LuaNode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471060,"owners_count":22076585,"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":["lua","script"],"created_at":"2024-09-24T20:22:14.932Z","updated_at":"2025-05-16T05:04:38.102Z","avatar_url":"https://github.com/Nicholas3388.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"LuaNode\n======================================\n\nThis project is an improved `Lua` SDK, based on ESP-IDF/ESP8266_RTOS_SDK, for Esp32 (compatible with Esp8266, W800, etc).\n\nESPRESSIF CHIP FAMILY:\n--------------------------------------\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_1.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_2.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_3.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_4.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_5.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_6.png \"ESP\") \n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp_7.png \"ESP\") \n\n\n\nThis project is developed by `DOIT` WiFi team.\n\nDOIT is a high-tech company, focus on IoT. Visit homepage: [doit.am](https://doit.am/#/ \"DOIT\")\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/logo.jpg \"Esp32 \u0026 Esp8266\")\n\nPLATFORM SUPPORTED (NEW):\n--------------------------------------\n\nLuaNode can be running on the following chip/module\n* ESP32-WROOM (ESP32C6 including)\n* ESP8266\n* STM32L4 (Coming soon)\n\nNEW UPDATE FOR ESP32(ESP32C6):\n--------------------------------------\n\nNew version of LuaNode32 is developed based on esp-idf and compatible with `Esplorer`. User can program with Lua, send and save Lua code to hardware via Esplorer.\n\nLuaNode for ESP32C6 is now available! Check this [document](https://github.com/Nicholas3388/LuaNode/blob/master/LuaNode_Esp32/README.md \"LuaNode for ESP32C6\")\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/startup.png \"Esp32c6 power up log\")\n\n### How To Build LuaNode32\n\nTo build LuaNode firmware for ESP32 series chip, see this [Doc](https://github.com/Nicholas3388/LuaNode/blob/master/LuaNode_Esp32/README.md \"Build firmware\")\n\nFor more details, view LuaNode [wiki page](https://github.com/Nicholas3388/LuaNode/wiki \"LuaNode Wiki\")\n\nLUA PROGRAMMING:\n--------------------------------------\n\n### Examples\n--------------------------------------\n\nProgramming with Lua is easy, some samples are as follow:\n\n```lua\n-- create file on file system\nfile.open(\"myfile.lua\", \"w+\");\nfile.write(\"hello world\");\nfile.close();\n\n-- read file from file system\nfile.open(\"myfile.lua\", \"r\");\n-- read 1024 bytes from myfile.lua and save them\n-- to content\ncontent=file.read(1024);\nprint(content);\nfile.close();\n\n-- remove file\nfile.remove(\"myfile.lua\");\n\n-- restart device\nnode.restart();\n```\n\nThere are some lua sample code within the folder named `lua_samples`. You can learn how to code with Lua and run the same code on any hardware supported by LuaNode.\n\nYou can add your own Lua modules to LuaNode at will, visit the LuaNode [wiki page](https://github.com/Nicholas3388/LuaNode/wiki \"LuaNode Wiki\") for more details.\n\n### Lua Editor\n\nLuaNode is compatible with `Esplorer` now, you can edit and download Lua\nCode to hardware via `Esplorer` conveniently. If you config SPIFFS for your project, you can save your Lua scripts \nto the file system via `ESPlorer`.\n\nGet Esplorer [Here](https://github.com/4refr0nt/ESPlorer \"Esplorer\")\n\nHOW TO BUILD For `ESP32/ESP8266`:\n--------------------------------------\n\nFor details, see LuaNode wiki page [Here](https://github.com/Nicholas3388/LuaNode/wiki/How-to-build-for-ESP8266-ESP32).\n\nHOW TO FLASH THE FIRMWARE:\n--------------------------------------\n\nSee LuaNode wiki page [Here](https://github.com/Nicholas3388/LuaNode/wiki/How-to-flash-the-firmware).\n\n\nAPPS:\n--------------------------------------\n\n* `task`: This is a sample to show how to create an os task. Build the example by executing the gen_misc.sh.\n\nHow to create a task:\n\n```c\nvoid task1(void *pvParameters) {\n    // do something\n}\n\nvoid user_init(void) {\n    xTaskCreate(task1, (signed char *)\"tsk1\", 256, \u0026mainqueue, 2, NULL);\n}\n```\n\n`Note: There is a task to receive uart input. You'd better alloc more than 512k memory for this task,\nsince the lua command handler will be called in this task, more memory is required for lua handler.`\n\n* `luaapp`: A lua app. \n\n* `wifikiller`: An wifi sample. Set baud rate to 115200pbs, using UART0. It will disconnect WiFi connection.\n\n* `wifilister`: List all APs, along with clents connected to them, near your device. The list info then sent to Android device via OTG, and display on Android.\n\nAPPLICATIONS:\n--------------------------------------\n\n### Amazon Alexa for ESP32\nThis is an awesome application that using Amazon Echo Dot to turn on/off the blue LED on DOIT ESP32 dev-board via voice \ncontrol service. You can find the source code, named `alexa_esp32`, within the `examples` directory. The `alexa_esp32` \nsample can control only one pin, if you want to control more pins or to use more resource on ESP32 to do more things, \nyou can learn the `alexa_multi_esp32` sample. The sample will let Alexa to do more things with ESP32.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/alexa_esp32.jpg \"Amazon Echo Dot \u0026 ESP32 board\")\n\nWhen you build the `alexa_esp32` within the examples folder and flash the firmware to ESP32 board, then you can ask \nEcho Dot to discover device by telling her \"Alexa, discover device\". She will answer you \"Discovery starting...\". After about\n20 seconds, if She does find device, she will answer you \"I found 1 device...\". Plus, you can search device via Alexa App or \nvia this page: `alexa.amazon.com`. When Echo Dot find ESP32, you will see the found device named \"esp\" on `alexa.amazon.com`, show \nas the following figure:\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/alexa_esp32_dev.png \"Alexa found ESP32 device\")\n\nWhen Alexa find ESP32 device successfully, you can ask Echo Dot \"Alexa, turn on ESP\" to turn on the blue LED on ESP32 borad. Ask \n\"Alexa, turn off ESP\" to turn off the LED. The following link is a video to show the ESP32 voice control via Amazon Echo Dot: https://youtu.be/Eg1dApUHIBc\n\n### ESP32-Camera\nThis simple application is to use ESP32 to controll a Camera. You can find the source code from the following diretory: _LuaNode_Esp32/LuaNode32/examples/camera_\n\nThere is another ESP32 camera demo create by _igrr_, find it from the link: https://github.com/igrr/esp32-cam-demo. \nWe also utilize OV7725 for our camera test, but the hardware is a little different from _igrr_'s project. \nMy camera is extended with a RAM, which is AL422B, with 390KB RAM. So the camera can cache 2 frames, if the \nresolution is set to 320x240 pixel. The following figure is my camera, called \"Yehuo\", a Chinese name.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/camera_test.jpg \"Yehuo Camera\")\n\nThe following figures is my ESP32-Camera.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp32_cam.jpg \"ESP32-Camera\")\n\n\nI learn _igrr_'s project, and do the same test as _igrr_'s. For instance, I use the camera to scan the board, and then \nyou can see the output from the uart terminal.\n\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp32_cam2.jpg \"Esp32 camera test\")\n\n### ESP32 Drives Nokia5110 LCD\nThis is an application to show how to drive Nokia5110 LCD. It is easy for ESP32 to drive the LCD. You \ndon't even need to use SPI to drive the LCD. The LCD is very cheap, and easy to buy from taobao or eBay.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/esp32_LCD.jpg \"output hello world\")\n\nPin connections:\n\n--------\n| Interface | Nokia5110 Pin | DOIT ESP32 dev-board Pin |\n| --- | --- | --- |\n| RESET | RST | D4 |\n| LCD Enable | CE | D2 |\n| DC | DC | D5 |\n| Data Input | Din | D18 |\n| Clock | Clk | D19 |\n| Back Light | BL | D21 |\n| Power Supply 3.3V | Vcc | 3V3 |\n| Ground | Gnd | GND | \n\nFor more details, view the _lcd_nokia5110_driver_ sample within the **examples** folder.\n\n### ESP32 BLE LED controller\nThis is a sample to show how to create BLE client and BLE server, and create connection between them. \nTo test this sample, you have to prepare two \nESP32 dev-board. Then build the sources within the `LuaNode_ESP32/examples/ble_led_controller`, and flash \nthe client and server firmware to the two ESP32 dev-boards, respectively. you will see the blue LED on the \nserver board is turned on/off each 2 seconds. You can see the test from the following video: https://youtu.be/UnzXCB5EYGU\n\nIn this sample, when the client connect to server, it will send BLE notify to the server each 2 seconds. \nWhen the server recieves the notification, \nthe server will turn on/off the blue LED on board according to the notification value. If the value is 0x1, the server \nwill turn on the LED, otherwise, the LED will be turned off.\n\n### ESP32 communicate with nRF51822 via BLE\n\nThis is a example to show how to create BLE connection between ESP32 and nRF51 device (nRF51822 inside). In this sample, \nESP32 write \"on\"/\"off\" string to the characteristic `6e400002-b5a3-f393-e0a9-e50e24dcca9e`, which provided \nby nRF51 device. When the nRF51 device receives the content sent by ESP32, the nRF51 will turn on/off the LED on board \naccording to the received string. The ESP32 will write \"on\"/\"off\" to the characteristic each 2 seconds, so you \nwill see that the LED on nRF51 device blink each 2 seconds.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/nrf51822_esp32_communication.jpg \"nRF51_ESP32\")\n\nThe folloing video is a test for this example: https://youtu.be/hXuCXh5lEew\n\nThe nRF51 device is a nRF51822 dev-board, you can buy it from Taobao China. You can download the sources and build firmware \nfor the nRF51 device from the following link: https://github.com/Nicholas3388/nRF51822_ESP32_communicate \n\n### BLE debug tool (LuaNode_BLE_Client)\n\nThis is an App (including iOS \u0026 Android) for ESP32 as well as other BLE device. The app named `LuaNode_BLE_Client`.\n You can use this app to connect to ESP32 \nand then control the LED on DOIT ESP32 dev board. Plus, you can scan BLE devices around your phone and then view the \nservices, characteristics, and descriptors provided by the devices. Download LuaNode_BLE_Client sources from the \nfollowing repository: https://github.com/Nicholas3388/LuaNode_BLE_Client\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/ble_debug_tool.png \"LuaNode_BLE_Client\")\n\nTo control the LED on ESP32 board, you have to build the example `esp32_ble_gatt_server_led_control_for_phone`, and then \ndownload the firmware. Run the `LuaNode_BLE_Client` and then toggle the LED switch on app to turn on/off the LED on board. \nThe following video is a test for ESP32: https://www.youtube.com/watch?v=LhvA33yf7P8\n\n### Wifilister\n\nAnother interesting application is the `Wifilister` app. The app scans all APs along with the clients connected to them around device, and scan results are sent to\nAndroid device via OTG, then you can see the result displayed on Android device.\n\nTo test this app, you have to install the `LuanodeUsbHost` Android app to your Android phone (device).\n`LuanodeUsbHost` is an Android USB Host app for ESP8266/ESP32. The Android device receive messages, sent from ESP8266, via OTG.\nThen the messages display on this app.\n\nDownload the `LuanodeUsbHost` source [Here](https://github.com/Nicholas3388/LuanodeUsbHost).\n\nCompile `Wifilister` provided in Luanode, flash it to ESP8266/ESP32, and then connect your ESP8266/ESP32 with Android phone.\nYou can see the scanning results.\n\n![github](https://github.com/Nicholas3388/LuaNode/raw/master/images/luanode_host.jpg \"LuanodeUsbHost\")\n\n\nFAQ:\n--------------------------------------\n\nSee wiki page [Here](https://github.com/Nicholas3388/LuaNode/wiki/FAQ)\n\n\nWHO ARE THE PEOPLE BEHIND THIS PROJECT\n-------------------------------------\n\n`Wei Wang`: He got his master's degree from Guilin University of Electronic Technology in 2012. He has more than 4 years work experience on Embedded System.\n\n`DOIT`(www.doit.am): DOIT is a high-tech company, who focus on IoT technology and open source hardware. He supports this project and provides hardware for this project. Its successful products include WifiMCU, Doit Video Car, and Wifi sniffer, etc.\n\n![github](https://ksr-ugc.imgix.net/assets/010/012/333/2e153bf8a6f1cc5781643ad8d704f285_original.gif?w=680\u0026fit=max\u0026v=1461661228\u0026q=92\u0026s=c8f52001f353a41b455f2a55b3c11256)\n\n\nCONTACT ME:\n--------------------------------------\n\nIf you have any question, you can contact me via Email/QQ list below, Thanks:) \n\n  - `Email`: lihonggang@doit.am\n  - `Wechat`: andy433928 \n\n\nLOG:\n--------------------------------------\n2016.4.7 \n\tModified lbaselib.c\n\n2016.4.19\n\tModified code structure\t\n\n2016.5.11\n\tReplace libc\n\n2017.1.19\n\tUpdate to the latest esp-idf\n\n2018.1.5\n\tUpdate for the latest esp-idf\n\n2023.12.3\n\tCompatible with latest ESP-IDF(5.x) for ESP32\n\t\n2023.12.9 \n\tUpdate LuaNode for ESP8266, work with the latest ESP8266_RTOS_SDK, ESP-IDF style.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholas3388%2Fluanode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicholas3388%2Fluanode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicholas3388%2Fluanode/lists"}