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 them are not support for both Esp32 at this time, and some of them are not support multi-task.
Our kickstarter campaign is launched. If you back for our project, an Esp32 dev-kit will ship to you once the project goal is completed. The hardware is provided by www.doit.am.
Our Kickstarter campaign is alive: https://www.kickstarter.com/projects/857552561/luanode-for-esp8266-and-esp32 . If you back for it, we will be very appreciated!
New version of LuaNode is developed based on esp-idf and compatible with Esplorer
.
- Download build tools Here
- Export build tools' directory by executing the following command on terminal,
export PATH=/your_path/toolchains/esp32/bin:$PATH
, where theyour_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 inputmake
to build firmware.
For more details, view LuaNode wiki page
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.
For details, see LuaNode wiki page Here.
See LuaNode wiki page Here.
See wiki page Here.
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.
A funny application is to utilize Luanode and Esp32/Esp8266 to create a Wifi tank. You can control the tank via app installed on your phone. The Luanode run on Esp32/Esp8266 and wait for the commands sent from phone, and then drives the motor on tank to move it on.
The hardware contains: T300 Tank Chassis, Esp8266 Development Kit, 720p HD Camera, WR703N Wireless Router.
A video on Youtube to illustrate how to control the tank via phone.
Another video on Youku, a Chinese video website, to illustrate the features of the tank.
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.
See wiki page Here
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.
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.
If you have any question, you can contact me via Email/QQ list below, Thanks:)
Email
: nicholas3388@gmail.comQQ
: 535873968
2016.4.7 Modified lbaselib.c
2016.4.19 Modified code structure
2016.5.11 Replace libc