Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST]🦄Lua interpreter library integration #378

Closed
luc-github opened this issue Sep 29, 2019 · 7 comments
Closed

[FEATURE REQUEST]🦄Lua interpreter library integration #378

luc-github opened this issue Sep 29, 2019 · 7 comments

Comments

@luc-github
Copy link
Owner

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
Copy link
Owner Author

luc-github commented Sep 30, 2019

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)

@luc-github
Copy link
Owner Author

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 ^_^

@luc-github
Copy link
Owner Author

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
Copy link
Owner Author

luc-github commented Jul 26, 2020

here #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 luc-github moved this to Todo in ESP3D 3.0 Jan 24, 2022
@luc-github luc-github moved this from Todo to Under definition in ESP3D 3.0 Jan 24, 2022
@luc-github luc-github changed the title [FEATURE REQUEST]interpreter library [FEATURE REQUEST]Lua interpreter library integration Mar 25, 2022
@luc-github
Copy link
Owner Author

luc-github commented Apr 19, 2022

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

@luc-github luc-github changed the title [FEATURE REQUEST]Lua interpreter library integration [FEATURE REQUEST]🦄Lua interpreter library integration Mar 6, 2024
@luc-github
Copy link
Owner Author

luc-github commented Aug 17, 2024

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

Copy link

github-actions bot commented Sep 4, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

No branches or pull requests

1 participant