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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST]馃Lua interpreter library integration #378

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

[FEATURE REQUEST]馃Lua interpreter library integration #378

luc-github opened this issue Sep 29, 2019 · 5 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Under definition
Development

No branches or pull requests

1 participant