lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Yes, they basically ported Lua to the Espressif  Development Framework, which is based on FreeRTOS. 

They modified the package system so you can require() code that runs directly out of flash memory, thus saving RAM, which is limited. Also they got rid of parts of Lua that were not useful or possible on FreeRTOS, such as ox.execute() and io.popen(). And they converted the I/O libraries and the default programming style to an event driven mode, like Node.js.

If you want to see how they did it, try diffing the Lua files in the NodeMCU code with the official release from PUC-Rio.



> On 21 Sep 2020, at 09:21, 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
> 
> Hi, Paul Ducklin
> 
>> There is an ESP8266 version (where you can choose Lua 5.1 or 5.3) and ESP32 version (5.1 only).
> So Lua runs on FreeRTOS for ESP8266?
> There is a folder named as FreeRTOS.
> 
> Best regards
> Sunshilong
> 
>> On Sun, Sep 20, 2020 at 7:20 AM Paul Ducklin <pducklin@outlook.com> wrote:
>> 
>> I use NodeMCU on an Espressif ESP32.
>> 
>> It’s basically a Lua-based OS for the ESP and a few other related microcontroller boards.
>> 
>> Check nodemcu/nodemcu-firmware on Github.
>> 
>> It consists of Lua and a bunch of relevant libraries (e.g. Wi-Fi, basic BLE, GPIO twiddling, outputting to various popular microcontroller displays) that are built using the Espressif IoT Development Framework that is based on FreeRTOS.
>> 
>> I really like it but I only use it for fun. How good it is for soft real-time programming I have no idea - I have just used it to play around with Bluetooth and Wi-Fi sniffing.
>> 
>> If you want to see what is possible using pure Lua-based firmware on a microcontroller you might as well try it.
>> 
>> There is an ESP8266 version (where you can choose Lua 5.1 or 5.3) and and ESP32 version (5.1 only). Suitable development test boards are a couple of dollars each, USB powered and with a USB UART so you don’t even need to put them on a breadboard.
>> 
>> I have also tried Whitecatboard, a Lua-based RTOS firmware for a range of different boards (also ESP-based), but haven’t done anything serious with it.
>> 
>> Check whitecatboard/Lua-RTOS-ESP32 on Github.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> On 16 Sep 2020, at 02:40, 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> Can Lua run within the real-time kernel?
>>> Does anybody do such a test?
>>> 
>>> Is it possible to run Lua scripts on the controller for real-time control?
>>> 
>>> Best regards
>>> Sunshilong