luc-github / ESP3D

FW for ESP8266/ESP8285/ESP32 used with 3D printer
GNU General Public License v3.0
1.76k stars 466 forks source link

[FEATURE REQUEST]🦄Lua interpreter library integration #378

Closed luc-github closed 2 months ago

luc-github commented 5 years ago

I got several request for unsupported user cases adding some scripting would be a flexible solution like https://github.com/fdu/ESP8266-Arduino-Lua

may be use a dedicated task on esp32 for it for esp8266 TBD as is must not disturb wifi upload and esp8266 is very sensitive

luc-github commented 5 years ago

the lua interpreter seems working well - it is currently limited to esp8266 but it compile on esp32 the footprint is not big so very promising there is a pr for adding additionnal commands that is also nice need to do a user case script to check like :

luc-github commented 5 years ago

Lua interpreter Lib is now ready for integration : https://github.com/luc-github/ESP8266-Arduino-Lua works on ESP8266/ESP32 Next steps will be:

luc-github commented 5 years ago

some integration figures for lib only without extra functions: On ESP32: with lib : 1178950 bytes without lib : 1081694 bytes footprint: 97,256 bytes

On ESP8266: with lib : 598338 bytes without lib : 497818 bytes footprint: 100,520 bytes

So for ESP8266 the impact is noticeable if not 4M Flash but should be ok on others which allow 1M firmware size.

luc-github commented 4 years ago

here https://github.com/luc-github/ESP3D/issues/479 there some user case and should be a good start to list what is missing:

So far what I have been noted 1 - an ESP command to launch script but should not be blocking function 2 - need a function to send data to printer serial to be able to echo it also on websocket monitor, lua allows already to send directly to serial but in that case there is no control on output 3 - need a function to catch the serial input so script can process it 4 - need a state function to get if a script is active, the script name and for how long 5 - need a function to kill an script in case of too long or in dead loop, this part may be also in addition of kind of timeout

luc-github commented 2 years ago

another user case that is also may will part of webUI : https://github.com/luc-github/ESP3D-WEBUI/issues/237 macro_-_home_XY_to_center_of_hole.gcode.txt

luc-github commented 2 months ago

I created a new library https://github.com/luc-github/EspLuaEngine, it is inspired from https://github.com/fdu/ESP8266-Arduino-Lua but it is done from scratch, no common code, and logic is different.

While It is very basic but also very flexible, I want to add it to ESP3D, to replace ESP8266-Arduino-Lua but to avoid a blocking script, I plan to limit usage to ESP32 to use tasks and become not blocking On ESP8266 it could be challenging especially if script is supposed to monitor pins states

github-actions[bot] commented 1 month ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.