ESP3D
ESP3D copied to clipboard
[FEATURE REQUEST]🦄Lua interpreter library integration
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
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 :
- if pin XX is HIGH send gcode command
- if temperature detected is 200 send GCODE (the temperature detection may need extra coding - TBC)
Lua interpreter Lib is now ready for integration : https://github.com/luc-github/ESP8266-Arduino-Lua works on ESP8266/ESP32 Next steps will be:
- add an
[ESP750] </FS:/scriptname> <RESIDENT>command to execute script on demand, blocking (wait for end) or resident (create a task for it on ESP32 / TBD on ESP8266) - register a lua function to execute
[ESPXXX]<parameters>from lua script - verify what function is missing with some user cases, any idea is welcome ^_^
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.
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
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