Skip to content

loboris/LuaNode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

LuaNode

This project is an improved Lua SDK, based on ESP-IDF/ESP8266_RTOS_SDK, for Esp32 (compatible with Esp8266).

As we know, there are some existing Lua SDK such as NodeMCU, esp-open-rtos, but they are not support for both Esp32 at this time, and some of them are not support multi-task.

github

NEW UPDATE FOR ESP32:

New version of LuaNode is developed based on esp-idf and compatible with Esplorer.

github

How To Build LuaNode32

  • Download build tools Here
  • Export build tools' directory by executing the following command on terminal, export PATH=/your_path/toolchains/esp32/bin:$PATH, where the your_path is the path the toolchains stored.
  • Export esp-idf path by the following command: export IDF_PATH=the_esp-idf_path
  • Change current directory to LuaNode32, then input make to build firmware.

For more details, view LuaNode wiki page

LUA PROGRAMMING

Programming with Lua is easy, some samples are as follow:

-- create file on file system
file.open("myfile.lua", "w+");
file.write("hello world");
file.close();

-- read file from file system
file.open("myfile.lua", "r");
-- read 1024 bytes from myfile.lua and save them
-- to content
content=file.read(1024);
print(content);
file.close();

-- remove file
file.remove("myfile.lua");

-- restart device
node.restart();

You can add your own Lua modules to LuaNode at will, visit the LuaNode wiki page for more details.

LuaNode is compatible with Esplorer now, you can edit and download Lua Code to ESP32 with Esplorer conveniently.

Get Esplorer Here

HOW TO BUILD For ESP32/ESP8266:

For details, see LuaNode wiki page Here.

HOW TO FLASH THE FIRMWARE:

See LuaNode wiki page Here.

HOW TO DEBUG:

See wiki page Here.

APPS:

  • task: This is a sample to show how to create an os task. Build the example by executing the gen_misc.sh.

How to create a task:

void task1(void *pvParameters) {
    // do something
}

void user_init(void) {
    xTaskCreate(task1, (signed char *)"tsk1", 256, &mainqueue, 2, NULL);
}

Note: There is a task to receive uart input. You'd better alloc more than 512k memory for this task, since the lua command handler will be called in this task, more memory is required for lua handler.

  • luaapp: A lua app.

  • wifikiller: An wifi sample. Set baud rate to 115200pbs, using UART0. It will disconnect WiFi connection.

  • 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.

APPLICATIONS:

Wifilister

Another 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 Android device via OTG, then you can see the result displayed on Android device.

To test this app, you have to install the LuanodeUsbHost Android app to your Android phone (device). LuanodeUsbHost is an Android USB Host app for ESP8266/ESP32. The Android device receive messages, sent from ESP8266, via OTG. Then the messages display on this app.

Download the LuanodeUsbHost source Here.

Compile Wifilister provided in Luanode, flash it to ESP8266/ESP32, and then connect your ESP8266/ESP32 with Android phone. You can see the scanning results.

github

FAQ:

See wiki page Here

WHO ARE THE PEOPLE BEHIND THIS PROJECT

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.

github

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.

github

CONTACT ME:

If you have any question, you can contact me via Email/QQ list below, Thanks:)

CHANGE LOG:

2016.4.7 Modified lbaselib.c

2016.4.19 Modified code structure

2016.5.11 Replace libc

About

Esp32/esp8266 lua sdk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 90.6%
  • C++ 5.7%
  • Objective-C 1.0%
  • Python 0.8%
  • Assembly 0.7%
  • Makefile 0.6%
  • Other 0.6%